Skip to content

[WIP][18.0][MIG] sale_custom_rounding: Migration to 18.0#4161

Draft
Anxo82 wants to merge 6 commits intoOCA:18.0from
sygel-technology:18.0-mig-sale_custom_rounding
Draft

[WIP][18.0][MIG] sale_custom_rounding: Migration to 18.0#4161
Anxo82 wants to merge 6 commits intoOCA:18.0from
sygel-technology:18.0-mig-sale_custom_rounding

Conversation

@Anxo82
Copy link
Contributor

@Anxo82 Anxo82 commented Feb 18, 2026

@HaraldPanten

  • Replaced the stored compute on tax_calculation_rounding_method with an @api.onchange.
    In Odoo 18 the field is defined in core as a company-related field, so the stored compute approach no longer worked reliably (it could be computed too early and stored with a wrong value).

  • Removed the override of _compute_tax_totals_json.
    In Odoo 18 the tax rounding is handled by the new tax engine and no longer depends on the round context flag, so the custom context-based logic was no longer applicable.

  • Simplified the override of _compute_amount on sale.order.line. The method now simply extends the @api.depends to trigger recomputation when the rounding method changes and delegates the computation entirely to the core logic.

  • [T-9321]

@Anxo82 Anxo82 marked this pull request as draft February 18, 2026 12:17
@Anxo82 Anxo82 changed the title [18.0][MIG] sale_custom_rounding: Migration to 18.0 [WIP][18.0][MIG] sale_custom_rounding: Migration to 18.0 Feb 18, 2026
@Anxo82 Anxo82 force-pushed the 18.0-mig-sale_custom_rounding branch 2 times, most recently from 905d0b8 to 4dc919d Compare February 18, 2026 16:12
@HaraldPanten
Copy link
Contributor

/ocabot migration sale_custom_rounding

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Feb 20, 2026
@Anxo82 Anxo82 force-pushed the 18.0-mig-sale_custom_rounding branch from 9be4cce to 2c9642b Compare February 20, 2026 10:00
@Anxo82 Anxo82 force-pushed the 18.0-mig-sale_custom_rounding branch 3 times, most recently from 4dabaf0 to 4fbebbb Compare February 25, 2026 07:41
Copy link
Contributor

@Jaimermaccione Jaimermaccione left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Anxo82 Module functionally tested and reviewed in a local environment.

Tests Performed

  • Configured a tax rounding method at contact level → correctly inherited in the Sales Order.
  • Configured a different tax rounding method at invoicing address level → invoicing address setting correctly overrides the main contact.
  • Generated invoices from multiple Sales Orders with:
    • Different rounding methods
    • Same customer with different rounding configurations

Results

As described in the README, the tax rounding method is used as a grouping key during invoice creation. The system correctly generates one invoice per tax rounding method.

Conclusion

The README accurately reflects the module behavior.
Functionality works as expected.

LGTM. Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants