mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP]repair_stock_move: hook to modify stock move vals
This commit is contained in:
@@ -53,10 +53,8 @@ class RepairOrder(models.Model):
|
|||||||
and not rec.ignore_availability
|
and not rec.ignore_availability
|
||||||
)
|
)
|
||||||
|
|
||||||
def _create_repair_stock_move(self):
|
def _prepare_repair_stock_move(self):
|
||||||
self.ensure_one()
|
return {
|
||||||
return self.env["stock.move"].create(
|
|
||||||
{
|
|
||||||
"name": self.name,
|
"name": self.name,
|
||||||
"product_id": self.product_id.id,
|
"product_id": self.product_id.id,
|
||||||
"product_uom": self.product_uom.id or self.product_id.uom_id.id,
|
"product_uom": self.product_uom.id or self.product_id.uom_id.id,
|
||||||
@@ -68,7 +66,11 @@ class RepairOrder(models.Model):
|
|||||||
"origin": self.name,
|
"origin": self.name,
|
||||||
"company_id": self.company_id.id,
|
"company_id": self.company_id.id,
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
def _create_repair_stock_move(self):
|
||||||
|
self.ensure_one()
|
||||||
|
move_dict = self._prepare_repair_stock_move()
|
||||||
|
return self.env["stock.move"].create(move_dict)
|
||||||
|
|
||||||
def action_repair_confirm(self):
|
def action_repair_confirm(self):
|
||||||
res = super().action_repair_confirm()
|
res = super().action_repair_confirm()
|
||||||
|
|||||||
Reference in New Issue
Block a user