-
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] stock: avoid write on move when create return line #77100
[FIX] stock: avoid write on move when create return line #77100
Conversation
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.
Looks good to me, just change the related value so it's consistent with the later versions. Thank you!
@@ -14,7 +14,7 @@ class ReturnPickingLine(models.TransientModel): | |||
|
|||
product_id = fields.Many2one('product.product', string="Product", required=True, domain="[('id', '=', product_id)]") | |||
quantity = fields.Float("Quantity", digits=dp.get_precision('Product Unit of Measure'), required=True) | |||
uom_id = fields.Many2one('uom.uom', string='Unit of Measure', related='move_id.product_uom', readonly=False) | |||
uom_id = fields.Many2one('uom.uom', string='Unit of Measure', related='move_id.product_uom') |
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.
uom_id = fields.Many2one('uom.uom', string='Unit of Measure', related='move_id.product_uom') | |
uom_id = fields.Many2one('uom.uom', string='Unit of Measure', related='product_id.uom_id') |
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.
@ticodoo updated the related value and added a test in case of outgoing move's uom is different from product's uom
When creating a wizard `stock.return.picking` and call `_onchange_picking_id`, the creation of return picking line will perform a write on move linked with it, due to `uom_id` being set as related with `readonly=False`. Set `readonly` to `True` to avoid it
5cee017
to
006fa29
Compare
Thank you for your contribution! |
When creating a wizard `stock.return.picking` and call `_onchange_picking_id`, the creation of return picking line will perform a write on move linked with it, due to `uom_id` being set as related with `readonly=False`. Set `readonly` to `True` to avoid it closes #77100 Signed-off-by: Tiffany Chang <tic@odoo.com>
When creating a wizard
stock.return.picking
and call_onchange_picking_id
, the creation of return picking line will performa write on move linked with it, due to
uom_id
being set as related withreadonly=False
. Setreadonly
toTrue
to avoid itThis starts with #76923
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr