Skip to content

[19.0][MIG] contract_sale_generation: Migration to 19.0#1485

Open
Rad0van wants to merge 69 commits into
OCA:19.0from
Rad0van:19.0-mig-contract_sale_generation
Open

[19.0][MIG] contract_sale_generation: Migration to 19.0#1485
Rad0van wants to merge 69 commits into
OCA:19.0from
Rad0van:19.0-mig-contract_sale_generation

Conversation

@Rad0van

@Rad0van Rad0van commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Migration of contract_sale_generation to 19.0.

This continues the work started in #1333 (draft, CI red, marked stale and pending auto-close) by @Wodran14, doing the actual 19.0 API migration that was missing there.

Changes

  • sale.order.line: rename product_uomproduct_uom_id (field renamed in 19.0).
  • _prepare_sale_line: drop the .new() / onchange / _convert_to_write dance that relied on sale.order.line._onchange_product_id_warning() (removed in 19.0). The line values are now built directly, mirroring the base module's contract.line._prepare_invoice_line(); taxes and other computed values are resolved by the sale order on creation.
  • Use the lazy self.env._ translation helper.
  • Tests:
    • res.users.groups_idgroup_ids and sale.order.line.tax_idtax_ids (fields renamed in 19.0).
    • Build the test data instead of relying on demo data (create the product locally instead of using product.product_product_2, and drop the chart template loading since account already provides a chart of accounts on install).
    • Keep the sale tax in the test fiscal position, because since 19.0 an empty fiscal position removes all taxes.

Tests

Run locally on Odoo 19.0, all green both with and without demo data (0 failed, 0 error(s) of 13 tests).

angelmoya and others added 30 commits July 15, 2026 15:21
…ata (OCA#130)

* [FIX+IMP] contract: Improve usability and don't fail on wrong data

* Cron create invoices masked for avoiding silent errors
* New constraints for assuring data consistency
* UI helps for entering consistent data
* Spanish translation
* Remove double company_id field on form

* [FIX] contract_sale_generation: Adapt tests to upstream contract
* Change the method called in the view
* Complete the create_invoice method
* Bump version + authoring
* Correct bad call of method
  Small Documentation
* Add super call in python test
* FIX bad field names causing bad quantities in sale.order.line
Currently translated at 100.0% (10 of 10 strings)

Translation: contract-10.0/contract-10.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-10-0/contract-10-0-contract_sale_generation/gl/
Currently translated at 100.0% (10 of 10 strings)

Translation: contract-10.0/contract-10.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-10-0/contract-10-0-contract_sale_generation/de/
Currently translated at 100.0% (10 of 10 strings)

Translation: contract-10.0/contract-10.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-10-0/contract-10-0-contract_sale_generation/fi/
Currently translated at 100.0% (15 of 15 strings)

Translation: contract-12.0/contract-12.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract_sale_generation/pt_BR/
Currently translated at 100.0% (15 of 15 strings)

Translation: contract-12.0/contract-12.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract_sale_generation/fr/
….order.line

The product UOM qty was not correctly set on the Sale Order Line
During the creation of a recurring Order from a Contract, the given quantity on the Contract Line was not correctly set on the created Sale Order Line.
Use the generation_type field defined now in contract base module.

Improve tests
…fter generation on contract level

As in contract module, recompute recurring_next_date after sale generation on contract level
weblate and others added 27 commits July 15, 2026 15:21
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: contract-16.0/contract-16.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/
Currently translated at 100.0% (12 of 12 strings)

Translation: contract-16.0/contract-16.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/pt_BR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: contract-16.0/contract-16.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/
Currently translated at 100.0% (15 of 15 strings)

Translation: contract-16.0/contract-16.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/es/
Currently translated at 100.0% (15 of 15 strings)

Translation: contract-16.0/contract-16.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/nl/
Currently translated at 100.0% (15 of 15 strings)

Translation: contract-16.0/contract-16.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/it/
Currently translated at 100.0% (15 of 15 strings)

Translation: contract-16.0/contract-16.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/pt_BR/
Currently translated at 86.6% (13 of 15 strings)

Translation: contract-16.0/contract-16.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/hr/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: contract-18.0/contract-18.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract_sale_generation/
Currently translated at 100.0% (15 of 15 strings)

Translation: contract-18.0/contract-18.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract_sale_generation/it/
Currently translated at 93.3% (14 of 15 strings)

Translation: contract-18.0/contract-18.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract_sale_generation/tr/
Currently translated at 100.0% (15 of 15 strings)

Translation: contract-18.0/contract-18.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract_sale_generation/sl/
- Bump manifest to 19.0.1.0.0 and regenerate README.
- sale.order.line: rename product_uom -> product_uom_id (field renamed
  in 19.0).
- _prepare_sale_line: drop the .new()/onchange/_convert_to_write dance
  that relied on sale.order.line._onchange_product_id_warning() (removed
  in 19.0). Build the line values directly, mirroring the base module's
  contract.line._prepare_invoice_line(); taxes and other computed values
  are now resolved by the sale order on creation.
- Use the lazy self.env._ translation helper.
- tests:
  - res.users.groups_id -> group_ids and sale.order.line.tax_id ->
    tax_ids (fields renamed in 19.0).
  - Build the test data instead of relying on demo data: create the
    product locally instead of using product.product_product_2, and
    drop the chart template loading (the account module already provides
    a chart of accounts on install).
  - Keep the sale tax in the test fiscal position: since 19.0 an empty
    fiscal position removes all taxes, which emptied the taxes on the
    generated sale order lines.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@OCA-git-bot OCA-git-bot added series:19.0 mod:contract_sale_generation Module contract_sale_generation labels Jul 15, 2026
@Rad0van Rad0van mentioned this pull request Jul 16, 2026
27 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:contract_sale_generation Module contract_sale_generation series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.