[19.0][MIG] contract_sale_generation: Migration to 19.0#1485
Open
Rad0van wants to merge 69 commits into
Open
Conversation
…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
…l (for recurrency on contract)
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/
…r to the current ones
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration of
contract_sale_generationto 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: renameproduct_uom→product_uom_id(field renamed in 19.0)._prepare_sale_line: drop the.new()/ onchange /_convert_to_writedance that relied onsale.order.line._onchange_product_id_warning()(removed in 19.0). The line values are now built directly, mirroring the base module'scontract.line._prepare_invoice_line(); taxes and other computed values are resolved by the sale order on creation.self.env._translation helper.res.users.groups_id→group_idsandsale.order.line.tax_id→tax_ids(fields renamed in 19.0).product.product_product_2, and drop the chart template loading sinceaccountalready provides a chart of accounts on install).Tests
Run locally on Odoo 19.0, all green both with and without demo data (
0 failed, 0 error(s) of 13 tests).