Skip to content

[19.0][MIG] sale_procurement_group_by_line: Migrate to 19.0#3947

Merged
OCA-git-bot merged 50 commits intoOCA:19.0from
Tatider:19.0-mig-sale-procurement-group-by-line
Dec 23, 2025
Merged

[19.0][MIG] sale_procurement_group_by_line: Migrate to 19.0#3947
OCA-git-bot merged 50 commits intoOCA:19.0from
Tatider:19.0-mig-sale-procurement-group-by-line

Conversation

@Tatider
Copy link

@Tatider Tatider commented Oct 15, 2025

  • Major changes were done to the module because "procurement.group" model was converted to "stock.reference" by Odoo SA (more details here).
    • Removed Update of "partner_id" and "move_type" - no fields like these exist in the "stock.reference"
    • Added overload of _prepare_procurement_values because "group_id" is no longer an arguments
    • Removed origin calculation - no longer an argument of _create_procurements function
    • Removed check of stock.move:name - move no longer has name/description field

P.S. An update of tests was required because in Odoo 19.0, the database by default doesn't have Demo Data

yvaucher and others added 30 commits October 15, 2025 16:50
This module extract logic to create multiple procurement group
for a single sale order for grouped sale order lines.
* Fix OCA#264
* Fix : Can't create delivery from shipping exception
* [ADD] [9.0] sale_delivery_block

* [IMP] Add data with an example Delivery Block Reason.

* [FIX]
 * Able to edit the Delivery Block Reason in state 'sent'
 * README

* [FIX] make sale_delivery_block compatible with sale_procurement_group_by_line

* [FIX] travis and data nouptade.

* [ADD] delivery block tests.

* [IMP] Add the 'Default Delivery Block Reason' in partners.

* [IMP] track visibility of delivery block reason

* [9.0][IMP] sale_delivery_block:
  * default_delivery_block is now a comercial field.
  * When duplicating a sale order the delivery block is recomputed.

* [9.0][UPD] sale_delivery_block_proc_group_by_line: Update README.

* [FIX] api.model used with api.constrains
Currently translated at 66.7% (2 of 3 strings)

Translation: sale-workflow-11.0/sale-workflow-11.0-sale_procurement_group_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-11-0/sale-workflow-11-0-sale_procurement_group_by_line/de/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-13.0/sale-workflow-13.0-sale_procurement_group_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-13-0/sale-workflow-13-0-sale_procurement_group_by_line/es/
…_qty.

This avoids duplicated procurements in some cases, basically for
any operation that has a specific `<sale.order.line>._get_qty_procurement`
relying on `previous_product_uom_qty`. E.g: manufacturing kits,
dropshipping...
…uom_qty

Prevents having duplicated procurements when having several order lines involving any operation that has a specific `<sale.order.line>._get_qty_procurement`
relying on `previous_product_uom_qty` (Manufacturing kits, dropshipping..)
Currently translated at 100.0% (6 of 6 strings)

Translation: sale-workflow-15.0/sale-workflow-15.0-sale_procurement_group_by_line
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-15-0/sale-workflow-15-0-sale_procurement_group_by_line/ca/
Before the fix, when new quantities are added into an already confirmed
line, we are writing in the previous_product_uom_qty only the new qty that
has been processed, not the total amount that has actually been
processed for the line.

Due to this, when we call super() on _action_launch_stock_rule, the new
quantities are procured again, as we have not really updated the amount
in previous_product_uom_qty including what we have already procured
before calling super().
Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

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

Thanks!

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@StefanRijnhart
Copy link
Member

@JordiMForgeFlow @ivantodorovich How is it looking to you at this point?

@JordiMForgeFlow
Copy link
Contributor

LGTM, but in other cases I had to rename a module, the best practice is to rename the entire commit history. Here is how to do it:

git filter-branch --tree-filter 'if [ -d sale_procurement_group_by_line ]; then mv sale_procurement_group_by_line sale_stock_reference_by_line; fi' HEAD git rebase origin/18.0 git push -f

@StefanRijnhart
Copy link
Member

@JordiMForgeFlow That is certainly an option, but it can also be said that the rename is a legitimate part of the module history that takes place now, and is reflected in the module's commit history. Also, the rename of the module directory is only part of the work, and there are field names, file names and external references to consider that cannot easily be rewritten in each commit and will be done in a specific commit. You could consider commits with a rewritten directory name misleading, as they make the history of a module less clear.

@pedrobaeza What is considered the best practice when renaming modules? Is it to rewrite the name throughout the git history or do it in a separate renaming commit?

@JordiMForgeFlow
Copy link
Contributor

@StefanRijnhart actually it was @pedrobaeza who explained the procedure to me 😆

@pedrobaeza
Copy link
Member

pedrobaeza commented Dec 19, 2025

When renaming, if the whole commit history is not renamed, then on next version, the rescue procedure will only catch from the migration commit, losing part of the commit history. Thus, the whole renaming is needed IMO.

@pedrobaeza
Copy link
Member

Anyway, you will need an extra commit with the rest of the work of the renaming (translations, complete XML-IDs where needed, etc).

@StefanRijnhart
Copy link
Member

OK, thanks for clarifying! @Tatider can you apply the git history rewrite?

@Tatider
Copy link
Author

Tatider commented Dec 19, 2025

Anyway, you will need an extra commit with the rest of the work of the renaming (translations, complete XML-IDs where needed, etc).
I have already updated the translations files in main migration commit, no XML ID updated needed. Would it be a problem?

@Tatider
Copy link
Author

Tatider commented Dec 19, 2025

OK, thanks for clarifying! @Tatider can you apply the git history rewrite?

I am trying, but it is not exactly working with just a copy-paste command...
Screenshot 2025-12-19 at 12 47 55

@JordiMForgeFlow are you also sure it should be on top of 18.0 and not 19.0?

@JordiMForgeFlow
Copy link
Contributor

@Tatider yes it should be on top of 19.0, I just copied the template command but you should adapt it to what you need.

@Tatider Tatider force-pushed the 19.0-mig-sale-procurement-group-by-line branch from 08a6281 to 28aa2e8 Compare December 19, 2025 10:52
@Tatider Tatider force-pushed the 19.0-mig-sale-procurement-group-by-line branch from 28aa2e8 to 4f0c900 Compare December 19, 2025 12:20
@Tatider
Copy link
Author

Tatider commented Dec 19, 2025

@StefanRijnhart @JordiMForgeFlow the history is now rewritten.

Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

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

Thanks for all the work! Looking real good.

@rvalyi
Copy link
Member

rvalyi commented Dec 23, 2025

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 19.0-ocabot-merge-pr-3947-by-rvalyi-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 92f7b2d into OCA:19.0 Dec 23, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@StefanRijnhart
Copy link
Member

Rename added to openupgrade 19 apriori in hbrunn/OpenUpgrade#20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.