Hello,
How to mask "MARK AS DONE" button in manufacturing order if there is a backorder not done in transfert? Odoo.sh V15
Denis
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
How to mask "MARK AS DONE" button in manufacturing order if there is a backorder not done in transfert? Odoo.sh V15
Denis
To mask the "Mark as Done" button in a manufacturing order if there is a backorder not done in transfer, you will need to create a new computed field in the manufacturing order model that checks for the presence of a backorder not done in transfer and then use this field to control the visibility of the button.
Here's an example of how you can do this in Odoo 15:
Create a new computed field in the manufacturing order model to check for the presence of a backorder not done in transfer. For example:
has_backorder = fields.Boolean(compute='_compute_has_backorder')
def _compute_has_backorder(self): for order in self: order.has_backorder = any(move.state != 'done' for move in order.picking_ids.mapped('move_lines').filtered(lambda m: m.product_id.type=='product' and m.location_dest_id.usage == 'internal' and m.location_id.usage != 'internal'))
In the XML view of the form, add a new attribute to the "Mark as Done" button called "attrs" and use the "has_backorder" field to control its visibility
This way, the button will be invisible when the "has_backorder" computed field is set to True, indicating that there is a backorder not done in transfer.
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký