OCA / stock-logistics-workflow

Odoo Stock, Workflow and Organization
GNU Affero General Public License v3.0
227 stars 644 forks source link

[16.0][FIX] stock_picking_invoice_link: don't store auxiliar fields #1620

Closed chienandalu closed 3 months ago

chienandalu commented 3 months ago

fw of https://github.com/OCA/stock-logistics-workflow/pull/1617

In c332869b09d99231f3c5f957089fddd257ee23ba a new computed field was introduced to show the count of a move's related pickings. But it was made stored, which is needless for this kind of field and adds a huge overhead when migrating from big DBs from previous versions.

With this commit:

cc @Tecnativa TT46020

please review @pedrobaeza @sergio-teruel

pedrobaeza commented 3 months ago

/ocabot merge minor

pedrobaeza commented 3 months ago

Only 17.0 is pending

OCA-git-bot commented 3 months ago

What a great day to merge this nice PR. Let's do it! Prepared branch 16.0-ocabot-merge-pr-1620-by-pedrobaeza-bump-minor, awaiting test results.

OCA-git-bot commented 3 months ago

Congratulations, your PR was merged at 8f9a7c87f14e5453b75533e5eab239b95588701e. Thanks a lot for contributing to OCA. ❤️

rousseldenis commented 3 months ago

@pedrobaeza @chienandalu You forgot to watch warnings in logs: https://github.com/OCA/stock-logistics-workflow/actions/runs/9496218506/job/26170126787#step:8:89

Please fix it

rousseldenis commented 3 months ago

@pedrobaeza @chienandalu You forgot to watch warnings in logs: https://github.com/OCA/stock-logistics-workflow/actions/runs/9496218506/job/26170126787#step:8:89

Please fix it

You should use another compute method for the count

pedrobaeza commented 3 months ago

Uhm, maybe other module is creating the same field? Both fields in this module don't have compute_sudo?

rousseldenis commented 3 months ago

Uhm, maybe other module is creating the same field? Both fields in this module don't have compute_sudo?

Nope. See https://github.com/odoo/odoo/blob/16.0/odoo/modules/registry.py#L322

rousseldenis commented 3 months ago

Moreover you changed the field name.

It shouldn't as this was done at purpose to avoid name collisions. delivery_count is really the meaning of the field.

pedrobaeza commented 3 months ago

No, that one is incorrect, as it doesn't reflect the real thing, and more with purchase_stock_picking_invoice_link. So this is finally a name collision with other module?