Skip to content

[17.0]]MIG]sale_stock_analytic: Migration to 17.0 - #617

Closed
moitabenfdz wants to merge 57 commits into
OCA:17.0from
DynAppsNV:17.0-mig-sale_stock_analytic
Closed

[17.0]]MIG]sale_stock_analytic: Migration to 17.0#617
moitabenfdz wants to merge 57 commits into
OCA:17.0from
DynAppsNV:17.0-mig-sale_stock_analytic

Conversation

@moitabenfdz

Copy link
Copy Markdown
Contributor

Hanane ELKHAL and others added 30 commits December 21, 2023 13:20
… Stock analytic XML part is now migrated

Add logo for generic modules
- migration point, put all the modules to not installable
This module allows the user to generate analytic information from stock
moves.

- Fixed flake8 and pylint errors.
Remove sale and purchase dependency. Add test

Only assign analytic account if account != valuation acc

Changing field name account_analytic_id

Adjust to OCA latest guidelines. Add some usahe info on README
Remove remaining encoding hints.
Correct lint in test
Correct flake8 in test
Fix documentation and test_flake8
Currently translated at 100.0% (2 of 2 strings)

Translation: account-analytic-11.0/account-analytic-11.0-stock_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-11-0/account-analytic-11-0-stock_analytic/de/
Currently translated at 100.0% (2 of 2 strings)

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

Translation: account-analytic-12.0/account-analytic-12.0-stock_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-stock_analytic/ca/
Currently translated at 100.0% (3 of 3 strings)

Translation: account-analytic-12.0/account-analytic-12.0-stock_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-stock_analytic/hr/
Currently translated at 100.0% (4 of 4 strings)

Translation: account-analytic-12.0/account-analytic-12.0-stock_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-stock_analytic/de/
Currently translated at 100.0% (4 of 4 strings)

Translation: account-analytic-12.0/account-analytic-12.0-stock_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-stock_analytic/pt/
Currently translated at 100.0% (4 of 4 strings)

Translation: account-analytic-12.0/account-analytic-12.0-stock_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-stock_analytic/es/
(cherry picked from commit 9255622)
alan196 and others added 23 commits December 21, 2023 13:22
Currently translated at 100.0% (6 of 6 strings)

Translation: account-analytic-14.0/account-analytic-14.0-stock_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-14-0/account-analytic-14-0-stock_analytic/pt_BR/
Currently translated at 100.0% (6 of 6 strings)

Translation: account-analytic-14.0/account-analytic-14.0-stock_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-14-0/account-analytic-14-0-stock_analytic/ca/
If we add extra move lines in stock pickings and wanted to set the
analytic account on it, as the related move is not yet created, the
behaviour of the related field is not wanted.

So, store the analytic account on move line level too and add it in
the values preparation hooks.
- Add validation on analytic distribution according to how it is done
  in other models (account.move.line, sale.order.line, etc.).
- Update readme to reflect the current design.
- Other cosmetic adjustments.
Currently translated at 88.8% (8 of 9 strings)

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

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

Translation: account-analytic-16.0/account-analytic-16.0-stock_analytic
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-stock_analytic/pt_BR/
@moitabenfdz moitabenfdz mentioned this pull request Jan 8, 2024
20 tasks
sol = sol_model.browse(sol_id)
analytic_distribution = sol.analytic_distribution
if analytic_distribution:
move_values.update({"analytic_distribution": analytic_distribution})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You might take into account the case where analytic account is at the sale order level...
you might cherry-pick DynAppsNV#2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Alternatively, Odoo's own logic merges the two when preparing the invoice line information from a sale line: https://github.com/odoo/odoo/blob/1648ee1abff1ae12b3933baa85a2e048fa2eb557/addons/sale/models/sale_order_line.py#L1142C9-L1142C35.

@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 Aug 18, 2024
@github-actions github-actions Bot closed this Sep 22, 2024
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.