Skip to content

[18.0][ADD] hr_expense_tax_distribution : add module#341

Open
metaminux wants to merge 1 commit into
OCA:18.0from
akretion:18.0-add-hr_expense_tax_distribution
Open

[18.0][ADD] hr_expense_tax_distribution : add module#341
metaminux wants to merge 1 commit into
OCA:18.0from
akretion:18.0-add-hr_expense_tax_distribution

Conversation

@metaminux
Copy link
Copy Markdown

This module addresses a limitation of standard Odoo when dealing with mixed-rate receipts (e.g. restaurant bills in France, where food, soft drinks and alcoholic beverages are taxed at 5.5%, 10% and 20% respectively). In standard Odoo, an expense accepts a single set of taxes applied to the full amount, leading to an incorrect VAT breakdown in the accounting entry and wrong figures in the tax declaration.

When an expense carries more than one tax, a Tax Distribution table appears on the expense form. The user fills in the tax-excluded base amount for each applicable rate; tax amount and TTC total are computed automatically. The module validates that the distribution totals match the expense total before submission, and generates one base line and one tax line per distribution entry in the final accounting entry instead of a single blended line. Expenses with a single tax are unaffected.

Key design decisions

  • Distribution lines are managed via _sync_tax_distribution_lines(), a dedicated public method that downstream modules can override to add extra fields (e.g. a specific expense account per line) without touching the onchange.
  • The submission constraint is enforced in action_submit_expenses rather than via @api.constrains, to avoid false positives during incremental onchange processing.

@OCA-git-bot OCA-git-bot added series:18.0 mod:hr_expense_tax_distribution Module hr_expense_tax_distribution labels May 9, 2026
@metaminux metaminux force-pushed the 18.0-add-hr_expense_tax_distribution branch from 7cddcdb to 8f1c8cf Compare May 10, 2026 21:22
@metaminux
Copy link
Copy Markdown
Author

Hi @OCA/human-resources-maintainers

Can someone review this PR please ?

Regards,

@metaminux
Copy link
Copy Markdown
Author

cc @sebastienbeau

@metaminux
Copy link
Copy Markdown
Author

Hi @sebalix and @florian-dacosta

Can you review this PR ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:hr_expense_tax_distribution Module hr_expense_tax_distribution series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants