diff --git a/rma/wizards/rma_add_stock_move.py b/rma/wizards/rma_add_stock_move.py index ce932a7b..0352a1f3 100644 --- a/rma/wizards/rma_add_stock_move.py +++ b/rma/wizards/rma_add_stock_move.py @@ -37,8 +37,7 @@ class RmaAddStockMove(models.TransientModel): domain="[('state', '=', 'done')]", ) show_lot_filter = fields.Boolean( - string="Show lot filter?", - compute="_compute_lot_domain", + string="Show lot filter?", compute="_compute_lot_domain", ) lot_domain_ids = fields.Many2many( comodel_name="stock.production.lot", @@ -46,9 +45,7 @@ class RmaAddStockMove(models.TransientModel): compute="_compute_lot_domain", ) - @api.depends( - "move_ids.move_line_ids.lot_id", - ) + @api.depends("move_ids.move_line_ids.lot_id") def _compute_lot_domain(self): for rec in self: rec.lot_domain_ids = rec.mapped("move_ids.move_line_ids.lot_id").ids @@ -60,11 +57,7 @@ class RmaAddStockMove(models.TransientModel): def select_all(self): self.ensure_one() - self.write( - { - "lot_ids": [(6, 0, self.lot_domain_ids.ids)], - } - ) + self.write({"lot_ids": [(6, 0, self.lot_domain_ids.ids)]}) return { "type": "ir.actions.act_window", "name": _("Add from Stock Move"), diff --git a/rma/wizards/rma_make_picking.py b/rma/wizards/rma_make_picking.py index ef904584..6951950f 100644 --- a/rma/wizards/rma_make_picking.py +++ b/rma/wizards/rma_make_picking.py @@ -206,17 +206,8 @@ class RmaMakePicking(models.TransientModel): ): move.move_line_ids.unlink() if move.product_id.tracking == "serial": - move.write( - { - "lot_ids": [(6, 0, move.rma_line_id.lot_id.ids)], - } - ) - move.move_line_ids.write( - { - "product_uom_qty": 1, - "qty_done": 0, - } - ) + move.write({"lot_ids": [(6, 0, move.rma_line_id.lot_id.ids)]}) + move.move_line_ids.write({"product_uom_qty": 1, "qty_done": 0}) elif move.product_id.tracking == "lot": if picking_type == "incoming": qty = self.item_ids.filtered( diff --git a/rma_sale/wizards/rma_add_sale.py b/rma_sale/wizards/rma_add_sale.py index c2a4ecc3..eda14eae 100644 --- a/rma_sale/wizards/rma_add_sale.py +++ b/rma_sale/wizards/rma_add_sale.py @@ -42,8 +42,7 @@ class RmaAddSale(models.TransientModel): string="Sale Lines", ) show_lot_filter = fields.Boolean( - string="Show lot filter?", - compute="_compute_lot_domain", + string="Show lot filter?", compute="_compute_lot_domain", ) lot_domain_ids = fields.Many2many( comodel_name="stock.production.lot", @@ -51,9 +50,7 @@ class RmaAddSale(models.TransientModel): compute="_compute_lot_domain", ) - @api.depends( - "sale_line_ids.move_ids.move_line_ids.lot_id", - ) + @api.depends("sale_line_ids.move_ids.move_line_ids.lot_id",) def _compute_lot_domain(self): for rec in self: rec.lot_domain_ids = ( @@ -70,11 +67,7 @@ class RmaAddSale(models.TransientModel): def select_all(self): self.ensure_one() - self.write( - { - "lot_ids": [(6, 0, self.lot_domain_ids.ids)], - } - ) + self.write({"lot_ids": [(6, 0, self.lot_domain_ids.ids)]}) return { "type": "ir.actions.act_window", "name": _("Add Sale Order"),