Skip to content

Conversation

@fw-bot-adhoc
Copy link
Contributor

Forward-Port-Of: #851

jjscarafia and others added 2 commits January 5, 2026 14:36
…osition support

This commit improves the exchange difference wizard to properly handle taxes
and fiscal positions when creating debit/credit notes.

Main changes:
- Add fiscal_position field to wizard (automatic/manual selection)
- Add fiscal_position_id field for manual fiscal position assignment
- Implement tax proration logic in _prepare_invoice_lines_by_taxes():
  * Groups invoice lines by tax combination
  * For Argentina: only considers VAT taxes (with l10n_ar_vat_afip_code)
  * Prorates exchange difference amount across tax groups based on their weight
  * Handles rounding differences by adjusting the last line
- Refactor _prepare_debit_credit_note() to:
  * Accept exch_moves parameter to retrieve related invoice lines
  * Generate separate lines for each tax combination
  * Apply manual fiscal position when configured
- Update wizard view to show fiscal position fields

This ensures exchange difference debit/credit notes have the same tax structure
as the original invoices, maintaining proper tax tracking and compliance.

X-original-commit: 22f4f94
…osition

When calculating tax groups for proration in the exchange difference wizard, we need to ensure that
if the invoice has a fiscal position, the perceptions and other tax amounts should not be included in the subtotal used for proration.
This case only applies if the user selects automatic fiscal position application in the wizard.

Also, if user selects manual and not fiscal position id, the fiscal position will be cleaned from the invoice
to avoid re-calculation taxes when adding the date.

X-original-commit: a26a4a1
@roboadhoc
Copy link

Pull request status dashboard

@fw-bot-adhoc
Copy link
Contributor Author

@jjscarafia @cav-adhoc this PR targets 19.0 and is the last of the forward-port chain.

To merge the full chain, use

@roboadhoc r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@cav-adhoc
Copy link
Contributor

@roboadhoc r+

roboadhoc pushed a commit that referenced this pull request Jan 5, 2026
…osition support

This commit improves the exchange difference wizard to properly handle taxes
and fiscal positions when creating debit/credit notes.

Main changes:
- Add fiscal_position field to wizard (automatic/manual selection)
- Add fiscal_position_id field for manual fiscal position assignment
- Implement tax proration logic in _prepare_invoice_lines_by_taxes():
  * Groups invoice lines by tax combination
  * For Argentina: only considers VAT taxes (with l10n_ar_vat_afip_code)
  * Prorates exchange difference amount across tax groups based on their weight
  * Handles rounding differences by adjusting the last line
- Refactor _prepare_debit_credit_note() to:
  * Accept exch_moves parameter to retrieve related invoice lines
  * Generate separate lines for each tax combination
  * Apply manual fiscal position when configured
- Update wizard view to show fiscal position fields

This ensures exchange difference debit/credit notes have the same tax structure
as the original invoices, maintaining proper tax tracking and compliance.

X-original-commit: 22f4f94
Part-of: #865
Signed-off-by: Camila Vives <[email protected]>
@roboadhoc roboadhoc closed this in 67d4654 Jan 5, 2026
@roboadhoc roboadhoc deleted the 19.0-18.0-t-61301-jjs-2762-fw branch January 5, 2026 15:03
@roboadhoc roboadhoc added the 18.1 label Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants