-
Notifications
You must be signed in to change notification settings - Fork 0
[18.0][MIG] sale_stock_mto_as_mts_orderpoint: Migration to 18.0 #2
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
base: 18.0
Are you sure you want to change the base?
Conversation
For user without proper rights the confirmation of a sale.order can lead to an access error on the orderpoint creation. The sudo fixes that.
On sale confirmation generate the procurement if the rule is on the sale order line OR the rule is activated on the product.
When generation the orderpoint from the sale order line, it might happen that the sale_order_line's product is a BOM, the moves that are generated are based on the components that composes it. For this reason, when creating the purchase order, we have to get the product from moves, not sale order lines.
Add a flag `mto_as_mts`on the warehouse to activate the functionality of the module. It will fix the interferences with other modules in the repository. And allows for better customization This a backport from v16 improvements.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-workflow-14.0/stock-logistics-workflow-14.0-sale_stock_mto_as_mts_orderpoint Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-14-0/stock-logistics-workflow-14-0-sale_stock_mto_as_mts_orderpoint/
7198047 to
639c819
Compare
xaviedoanhduy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you changed quite a bit about accessing from product.route_ids to product_tmpl_id.route_ids. but what is the purpose of this change because the product.product model also has a route_ids field?
| ) | ||
| ) | ||
|
|
||
| self.env["procurement.group"].run(procurements) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a need to check for existence of procurements? https://github.com/odoo/odoo/blob/202d7ac2297185d4384638726afacc2bbe160d40/addons/sale_stock/models/sale_order_line.py#L386-L387
| if ( | ||
| not delivery_move.is_from_mto_route | ||
| or line.product_id._variant_is_not_mto() | ||
| and mto_route |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't the above code return early when mto_route doesn't exist?
if not mto_route:
return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's and mto_route not in delivery_move.product_id.route_ids, because code line is too long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add description of this file appearance? is it split from stock_orderpoint_manual_procurement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I get these code from stock_orderpoint_manual_procurement
639c819 to
b3a8811
Compare
b3a8811 to
4e56965
Compare
stock_orderpoint_manual_procurementis deprecated, so I remove it in depends and write more code aboutstock_warehouse_orderpoint