Skip to content

Conversation

@chaule97
Copy link
Owner

@chaule97 chaule97 commented Jan 8, 2025

  • because stock_orderpoint_manual_procurement is deprecated, so I remove it in depends and write more code about stock_warehouse_orderpoint

grindtildeath and others added 30 commits January 2, 2025 15:48
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/
@chaule97 chaule97 force-pushed the 18.0-mig-sale_stock_mto_as_mts_orderpoint branch from 7198047 to 639c819 Compare January 8, 2025 11:10
Copy link

@xaviedoanhduy xaviedoanhduy left a 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)

Choose a reason for hiding this comment

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

if (
not delivery_move.is_from_mto_route
or line.product_id._variant_is_not_mto()
and mto_route

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

Copy link
Owner Author

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

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?

Copy link
Owner Author

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

@chaule97 chaule97 force-pushed the 18.0-mig-sale_stock_mto_as_mts_orderpoint branch from 639c819 to b3a8811 Compare January 9, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.