Skip to content

[19.0][MIG] purchase_analytic#852

Draft
astirpe wants to merge 74 commits intoOCA:19.0from
astirpe:19_mig_purchase_analytic
Draft

[19.0][MIG] purchase_analytic#852
astirpe wants to merge 74 commits intoOCA:19.0from
astirpe:19_mig_purchase_analytic

Conversation

@astirpe
Copy link
Copy Markdown
Member

@astirpe astirpe commented Nov 25, 2025

Laetitia Gangloff and others added 30 commits November 25, 2025 15:52
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-analytic-12.0/account-analytic-12.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-purchase_analytic/
Some of the "tricks" done in this module are no longer needed
and can be easily implemented with newest framework features:

* No need for an auxiliar `project_id2` field. User can set
  an analytic account with no lines and it is respected.
* Simplify onchange. Now update analytic line on the go (no
  need to save) which is a better UX because avoid unexpected
  changes on save.

Also re-label the field `project_id` to "Analytic Account" to
align with the typical label in newer versions of Odoo.
Tha label "Contract / Analytic" was last used in v8 (
https://github.com/odoo/odoo/blob/8.0/addons/sale/sale.py#L217).
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-analytic-15.0/account-analytic-15.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-15-0/account-analytic-15-0-purchase_analytic/
Currently translated at 100.0% (3 of 3 strings)

Translation: account-analytic-16.0/account-analytic-16.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-purchase_analytic/hr/
Currently translated at 100.0% (3 of 3 strings)

Translation: account-analytic-16.0/account-analytic-16.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-purchase_analytic/es/
Currently translated at 100.0% (3 of 3 strings)

Translation: account-analytic-16.0/account-analytic-16.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-purchase_analytic/fr/
mymage and others added 27 commits November 25, 2025 15:52
Currently translated at 100.0% (5 of 5 strings)

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

Translation: account-analytic-16.0/account-analytic-16.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-purchase_analytic/
Currently translated at 100.0% (5 of 5 strings)

Translation: account-analytic-16.0/account-analytic-16.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-purchase_analytic/it/
Currently translated at 100.0% (5 of 5 strings)

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

Translation: account-analytic-16.0/account-analytic-16.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-purchase_analytic/
Currently translated at 100.0% (7 of 7 strings)

Translation: account-analytic-16.0/account-analytic-16.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-purchase_analytic/it/
Currently translated at 100.0% (7 of 7 strings)

Translation: account-analytic-16.0/account-analytic-16.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-purchase_analytic/pt_BR/
Changelog:
- Set the `readonly` attribute of the purchase analytic field on the
  views based on its state, instead of defining it in the model.
- Update method docstrings to be more descriptive.
- Refactor tests to use `SetUpClass` and remove the unnecessary `_id`
  when acquiring a record (not just the id).
- Remove the unrequired parameters when creating a line.
- Add test cases for setting the analytic distribution on a purchase
  order without lines and unsetting the analytic distribution on a
  purchase order with lines.
- Use `Form` to test the onchange method.
- Add the user to the "Analytic Accounting" group in order to visualize
  analytic distributions in the forms.
- Remove the `company_id` field from the creation of `analytic_plan` as
  the field was moved to the `account.analytic.applicability` model in
  [1].

[1]: odoo/odoo@dc696c8e

Co-authored-by: Wodran Van de Sande <wodran.vandesande@dynapps.be>
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-analytic-17.0/account-analytic-17.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-17-0/account-analytic-17-0-purchase_analytic/
The invisible field in the purchase order form view was removed, as it
will be added automatically if required [1].

[1]: odoo/odoo#137031
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-analytic-18.0/account-analytic-18.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-18-0/account-analytic-18-0-purchase_analytic/
Currently translated at 100.0% (4 of 4 strings)

Translation: account-analytic-18.0/account-analytic-18.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-18-0/account-analytic-18-0-purchase_analytic/it/
Currently translated at 75.0% (3 of 4 strings)

Translation: account-analytic-18.0/account-analytic-18.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-18-0/account-analytic-18-0-purchase_analytic/fr/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-analytic-18.0/account-analytic-18.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-18-0/account-analytic-18-0-purchase_analytic/
Currently translated at 100.0% (7 of 7 strings)

Translation: account-analytic-18.0/account-analytic-18.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-18-0/account-analytic-18-0-purchase_analytic/tr/
Currently translated at 100.0% (7 of 7 strings)

Translation: account-analytic-18.0/account-analytic-18.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-18-0/account-analytic-18-0-purchase_analytic/fr/
Currently translated at 100.0% (7 of 7 strings)

Translation: account-analytic-18.0/account-analytic-18.0-purchase_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-18-0/account-analytic-18-0-purchase_analytic/fr/
@github-actions
Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.