Skip to content

[19.0][PATCH] contract#9

Open
CRogos wants to merge 271 commits into
19.0from
pr/BhaveshHeliconia/1312
Open

[19.0][PATCH] contract#9
CRogos wants to merge 271 commits into
19.0from
pr/BhaveshHeliconia/1312

Conversation

@CRogos
Copy link
Copy Markdown

@CRogos CRogos commented May 28, 2026

Waiting for: OCA#1312

gorozcoh and others added 30 commits May 18, 2026 11:36
* Correct domain attribute in field journal_id

Original domain includes unknown value company_id. Throws error when selecting the journal.

* Corregidos errores detectados por Lint

* Refactoring, DRY

* [FIX] Add missing field company_id to account_analytic_contract

* Small refactoring for company_id field
…orrect references in the contract report

* company_id was empty because an onchange, not inheritance nor visibility
* Added multi-company group to company_id fields
* Added multi-company access rule to contract templates
* Fix double %% in XML dates that was causing an error
* When creating a contract, recurring_invoices is set by default
* [IMP] Add computed dates from/to period invoiced (OCA#140)
* [IMP] Improve partner contract smartbutton
* [FIX] Onchange contract template raise error
* [FIX] Invalid pricelist name
If you have contract lines with automatic price and your pricelist
contains different prices per quantity, the price is not changed
when computing quantity.

This PR fixes this.
Bug description
---------------

`account.analytic.contract.line` inherits
`account.analytic.invoice.line`

`account.analytic.invoice.line` defines field `analytic_account_id`:
   - comodel='account.analytic.account'

`account.analytic.contract.line` redefines field `analytic_account_id`:
   - comodel='account.analytic.contract'

On attempt to extend `account.analytic.invoice.line` model adding
field that depends on `analytic_account_id.date_start`
Odoo fails to update, because it adds this field to
`account.analytic.contract.line` through inheritance,
and `account.analytic.contract` model have no this field.

What is done
------------

Change inheritance order:
- `account.analytic.invoice.line` inherits
`account.analytic.contract.line`
- no file renames at this stage (this wil be done in next commit)
Runbot URL in old README.rst pointed to 10.0 runbot,
fixed by upgrading template
Currently translated at 96.0% (96 of 100 strings)

Translation: contract-11.0/contract-11.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-contract/nl/
Currently translated at 53.0% (53 of 100 strings)

Translation: contract-11.0/contract-11.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-contract/de/
Currently translated at 98.0% (98 of 100 strings)

Translation: contract-11.0/contract-11.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-contract/es/
Currently translated at 10.0% (10 of 100 strings)

Translation: contract-11.0/contract-11.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-contract/pt_PT/
The test as it was, leaves to the demo pricelist the control on the price of
the product, so other modules that modifies this pricelist will make the
test to fail.

This is the minimum change needed for avoiding the problem.
    - Module: contract
    - Summary: several terms where not translated to Spanish.
Currently translated at 100.0% (109 of 109 strings)

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

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

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/de/
Currently translated at 83.5% (91 of 109 strings)

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

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

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/pt/
Currently translated at 51.8% (57 of 110 strings)

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

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/de/
Currently translated at 40.9% (45 of 110 strings)

Translation: contract-12.0/contract-12.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract/zh_CN/
glitchov and others added 30 commits May 18, 2026 14:26
…ing onchanges

When copying values from the contract template, skip assignment if the
value is already the same on the contract. This prevents triggering
unnecessary onchanges without altering the behavior.
We should add a validation of company as it might collide if we have multiple companies installed and this companies have a sequence.
Currently translated at 96.8% (248 of 256 strings)

Translation: contract-18.0/contract-18.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract/ca/
…ct lines

This field is unused in this module, but in the contract_sale_invoicing module it is used to search Sales Orders. However, many times this field goes unnoticed and users set the analytic distribution directly on the lines.

After this commit, the field is computed automatically based on the contract lines.
…ontract

line

Adding analytic.mixin on a model adds the analytic_distribution compute field
In the mixin the compute is not implemented, letting the method being implemented
in each concrete model. This wasn't done yet for contract line.

Before this commit: adding a product to a contract line didn't fill the analytic distribution.

After this commit: adding a product to a contract line triggers the compute method
(similarly to the one on sale order lines), evaluating the account analytic distribution
models and setting the correct analytic distribution
On portal, the cancelled lines are not distinguished from running ones,
as the next invoice date is still displayed, and the color is the same
(on contrary than the backend, that appears greyed).

So let's do something similar in portal:

- Put the row as grey.
- Hide the nexte invoice date on that case.

TT59704
Currently translated at 100.0% (258 of 258 strings)

Translation: contract-18.0/contract-18.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract/fr/
This field slightly degrades performance.
We don't need to maintain retro-compatibility with 11- anymore.
Currently translated at 6.6% (17 of 256 strings)

Translation: contract-18.0/contract-18.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract/sl/
Currently translated at 96.4% (247 of 256 strings)

Translation: contract-18.0/contract-18.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract/ca/
Allow to hook contract._prepare_invoice to add more invoice lines
Fix date_ref when invoicing multiple contracts
Currently translated at 92.5% (237 of 256 strings)

Translation: contract-18.0/contract-18.0-contract
Translate-URL: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract/es/
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.