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

[18.0][MIG] sale_procurement_group_by_line: Migration to 18.0. #3420

Open
wants to merge 44 commits into
base: 18.0
Choose a base branch
from

Conversation

MeritxellAForgeFlow
Copy link

Migration to 18.0

@ForgeFlow

yvaucher and others added 30 commits November 21, 2024 10:43
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().
@MeritxellAForgeFlow MeritxellAForgeFlow force-pushed the 18.0-mig-sale_procurement_group_by_line branch from 6d53c3f to 7e59cd0 Compare November 22, 2024 09:20
@OCA-git-bot
Copy link
Contributor

Sorry @RicardCForgeFlow you are not allowed to mark the addon tobe migrated.

To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons.

If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the maintainers key of its manifest.

Copy link
Contributor

@JordiMForgeFlow JordiMForgeFlow left a comment

Choose a reason for hiding this comment

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

Could you include the module name in the MIG commit like: [MIG] sale_procurement_group_by_line: Migration to V18?

Code review LGTM :)

@MeritxellAForgeFlow MeritxellAForgeFlow force-pushed the 18.0-mig-sale_procurement_group_by_line branch from 7e59cd0 to 926ec31 Compare November 22, 2024 09:45
Copy link

@RicardCForgeFlow RicardCForgeFlow left a comment

Choose a reason for hiding this comment

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

Code review 👍

Copy link
Contributor

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

Code review LGTM

@MeritxellAForgeFlow MeritxellAForgeFlow force-pushed the 18.0-mig-sale_procurement_group_by_line branch 3 times, most recently from c22bae1 to efd1ae8 Compare November 22, 2024 11:24
@MeritxellAForgeFlow MeritxellAForgeFlow force-pushed the 18.0-mig-sale_procurement_group_by_line branch from efd1ae8 to cac406c Compare November 25, 2024 10:48
@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 18.0-mig-sale_procurement_group_by_line branch 2 times, most recently from e6c97a9 to 9fc802a Compare November 25, 2024 13:10
@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 18.0-mig-sale_procurement_group_by_line branch from 9fc802a to 1c7646d Compare November 25, 2024 13:28
@MiquelRForgeFlow
Copy link
Contributor

Added v17 changes in a separated commit (a forward port of #3428).

@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). 🤖

@RicardCForgeFlow
Copy link

Hi @rousseldenis, could you check this PR? Thank you very much! 😄

@rousseldenis
Copy link
Contributor

/ocabot migration sale_procurement_group_by_line

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Dec 6, 2024
@@ -43,7 +43,7 @@ def _action_launch_stock_rule(self, previous_product_uom_qty=False):
if (
line.state != "sale"
or line.order_id.locked
or line.product_id.type not in ("consu", "product")
or line.product_id.type != "consu"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if we should test is_storable field

Choose a reason for hiding this comment

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

Hi @rousseldenis, I see Odoo does this

sale_stock/models/sale_order_line.py#L357

Although is_storable=False implies no inventory tracking, consumable products (type: consu, is_storable: False) may still require provisioning rules.

Do you agree?

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.