Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] stock_request_analytic: Migration to 16.0 #16

Closed
wants to merge 23 commits into from

Conversation

victoralmau
Copy link
Member

@victoralmau victoralmau commented Mar 26, 2024

Superseed #3

Migration to 16.0

Changes done:

  • Analytic_account_id field is removed from stock.request (and all related).
  • Added analytic_distribution field to stock.request.

Please @chienandalu and @pedrobaeza can you review it?

@Tecnativa TT47865

AaronHForgeFlow and others added 23 commits March 26, 2024 08:36
 * clean views.
 * allow to create a stock.request with no analytic account.
 * remove copy attribute in non-stored field.
 * remove non-existing field from compute method.
Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (8 of 8 strings)

Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_request_analytic
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_request_analytic/zh_CN/
Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (8 of 8 strings)

Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_request_analytic
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_request_analytic/pt_BR/
Co-authored-by: Pimolnat Suntian <pimolnats@ecosoft.co.th>

TT28896

[UPD] Update stock_request_analytic.pot

[UPD] README.rst
…nt values

If procurement will trigger a purchase and not a move,
there is no mean to transmit it (e.g.: to purchase).

[UPD] Update stock_request_analytic.pot

[UPD] README.rst

stock_request_analytic 14.0.1.0.1
stock_request_analytic 14.0.1.0.2
Currently translated at 100.0% (9 of 9 strings)

Translation: stock-logistics-warehouse-14.0/stock-logistics-warehouse-14.0-stock_request_analytic
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_request_analytic/pt_BR/
[UPD] README.rst

stock_request_analytic 14.0.1.0.3
[UPD] Update stock_request_analytic.pot

[UPD] README.rst

stock_request_analytic 15.0.1.0.1

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-warehouse-15.0/stock-logistics-warehouse-15.0-stock_request_analytic
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_request_analytic/
Translated using Weblate (Spanish)

Currently translated at 41.6% (5 of 12 strings)

Translation: stock-logistics-warehouse-15.0/stock-logistics-warehouse-15.0-stock_request_analytic
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_request_analytic/es/

Translated using Weblate (Spanish)

Currently translated at 100.0% (12 of 12 strings)

Translation: stock-logistics-warehouse-15.0/stock-logistics-warehouse-15.0-stock_request_analytic
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_request_analytic/es/

[UPD] README.rst
…to avoid permissions errors

[BOT] post-merge updates
Translated using Weblate (Italian)

Currently translated at 100.0% (12 of 12 strings)

Translation: stock-logistics-warehouse-15.0/stock-logistics-warehouse-15.0-stock_request_analytic
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-15-0/stock-logistics-warehouse-15-0-stock_request_analytic/it/
Changes done:
- Analytic_account_id field is removed from stock.request (and all related).
- Added analytic_distribution field to stock.request.

TT47865

Co-authored-by: Urvisha-OSI
@pedrobaeza
Copy link
Member

/ocabot migration stock_request_analytic

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Mar 26, 2024
@OCA-git-bot
Copy link
Contributor

There's no issue in this repo with the title 'Migration to version 16.0' and the milestone 16.0, so not possible to add the comment.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

class AccountAnalyticAccount(models.Model):
_inherit = "account.analytic.account"

stock_request_ids = fields.One2many(
Copy link
Member

Choose a reason for hiding this comment

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

Why removing this? I think it's still useful, but it should be computed and extracted from the analytic distributions.

Copy link
Member Author

Choose a reason for hiding this comment

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

The analytical distribution is done at each record (in each stock.request), not at the analytical account level, so I can't extract it from there directly. Although what you mention could be done, I don't know if it is worthwhile and/or useful because I think this is not done in any other module.

Copy link
Member

Choose a reason for hiding this comment

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

You should know if the smart-button was used or not, but I would bet it was...

class StockRequestOrder(models.Model):
_inherit = "stock.request.order"

analytic_count = fields.Integer(
Copy link
Member

Choose a reason for hiding this comment

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

The same

readonly=True,
compute_sudo=True,
)
default_analytic_account_id = fields.Many2one(
Copy link
Member

Choose a reason for hiding this comment

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

A similar feature should be added

Copy link
Member Author

Choose a reason for hiding this comment

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

What functionality exactly? The analytical accounts are no longer "useful", analytical distribution (from stock.request) is now what matters. Do you want to add a default analytical distribution at stock.request.order level?

Copy link
Member

Choose a reason for hiding this comment

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

That the analytic distribution is filled with this default analytic account. Anyway, the same, check if it's used or not in our customers.

@victoralmau
Copy link
Member Author

Finally I will not continue with this migration because I do not need this module, although anyone can continue with the work already done.

Some comments that I think may be useful:

  • Analytic account has been removed because now (v16) only the analytic distribution (stock_analytic) is used.
  • Analytic distribution has been added in stock.request to make it compatible with stock_analytic.
  • Analytic tags have been removed, now they are not in core and it would be necessary to create (after merging this PR) a new module stock_request_analytic_tag to add that functionality (probably it would also be necessary to create stock_analytic_tag).

Copy link

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 Jul 28, 2024
@pedrobaeza pedrobaeza closed this Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migration needs review 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.