-
Notifications
You must be signed in to change notification settings - Fork 23.1k
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
[FIX] mrp: auto-generate backorder in "always backorder" setup #164560
[FIX] mrp: auto-generate backorder in "always backorder" setup #164560
Conversation
2249c60
to
5a17203
Compare
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.
LGTM
3b48acd
to
e773815
Compare
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.
To avoid a big stack of function calls with empty recordset
addons/mrp/models/mrp_production.py
Outdated
prods_auto_backorder = [prod for prod in quantity_issues if prod.picking_type_id.create_backorder == "always"] | ||
auto_backorders = self.env['mrp.production.backorder'].create({ |
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.
prods_auto_backorder = [prod for prod in quantity_issues if prod.picking_type_id.create_backorder == "always"] | |
auto_backorders = self.env['mrp.production.backorder'].create({ | |
prods_auto_backorder = [prod for prod in quantity_issues if prod.picking_type_id.create_backorder == "always"] | |
if prods_auto_backorder: | |
auto_backorders = self.env['mrp.production.backorder'].create({ |
addons/mrp/models/mrp_production.py
Outdated
}) for prod in prods_auto_backorder | ||
], | ||
}) | ||
auto_backorders.action_backorder() |
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.
auto_backorders.action_backorder() | |
return auto_backorders.action_backorder() |
we want to open the backorder automatically at validation
Steps to reproduce: - Inventory > Configuration > Warehouse Management > Operations types - Click on Manufacturing and put "Always" on create a backorder - Create a new MO for 2 units of a product and produce 1 unit > A wizzard appears to ask you if you want to create a backorder Cause of the issue: Clicking on the produce button will call the "button_mark_done" method. However, the parameters of backorder creations are not checked before the wizzard generation: https://github.com/odoo/odoo/blob/5c2f60ae2b8eb6699bd322bc4ea3d5054c7aea37/addons/mrp/models/mrp_production.py#L2118-L2120 will call the opw-3890886
e773815
to
045351e
Compare
Thanks a lot for the review @Whenrow ! |
robodoo r+ |
Steps to reproduce: - Inventory > Configuration > Warehouse Management > Operations types - Click on Manufacturing and put "Always" on create a backorder - Create a new MO for 2 units of a product and produce 1 unit > A wizzard appears to ask you if you want to create a backorder Cause of the issue: Clicking on the produce button will call the "button_mark_done" method. However, the parameters of backorder creations are not checked before the wizzard generation: https://github.com/odoo/odoo/blob/5c2f60ae2b8eb6699bd322bc4ea3d5054c7aea37/addons/mrp/models/mrp_production.py#L2118-L2120 will call the opw-3890886 closes #164560 Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Steps to reproduce: - Inventory > Configuration > Warehouse Management > Operations types - Click on Manufacturing and put "Always" on create a backorder - Create a new MO for 2 units of a product and produce 1 unit > A wizzard appears to ask you if you want to create a backorder Cause of the issue: Clicking on the produce button will call the "button_mark_done" method. However, the parameters of backorder creations are not checked before the wizzard generation: https://github.com/odoo/odoo/blob/5c2f60ae2b8eb6699bd322bc4ea3d5054c7aea37/addons/mrp/models/mrp_production.py#L2118-L2120 will call the opw-3890886 closes #164560 Signed-off-by: William Henrotin (whe) <whe@odoo.com>
@lase-odoo @Whenrow this pull request has forward-port PRs awaiting action (not merged or closed): |
@lase-odoo @Whenrow this pull request has forward-port PRs awaiting action (not merged or closed): |
Steps to reproduce: - Inventory > Configuration > Warehouse Management > Operations types - Click on Manufacturing and put "Always" on create a backorder - Create a new MO for 2 units of a product and produce 1 unit > A wizzard appears to ask you if you want to create a backorder Cause of the issue: Clicking on the produce button will call the "button_mark_done" method. However, the parameters of backorder creations are not checked before the wizzard generation: https://github.com/odoo/odoo/blob/5c2f60ae2b8eb6699bd322bc4ea3d5054c7aea37/addons/mrp/models/mrp_production.py#L2118-L2120 will call the opw-3890886 closes odoo#164560 Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Steps to reproduce:
> A wizzard appears to ask you if you want to create a backorder
Cause of the issue:
Clicking on the produce button will call the "button_mark_done" method. However, the parameters of backorder creations are not checked before the wizzard generation:
odoo/addons/mrp/models/mrp_production.py
Lines 2118 to 2120 in 5c2f60a
opw-3890886
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr