Commit c7813fe2 by 夏超

[fix] 领料单数据

parent 336c14d5
......@@ -141,6 +141,9 @@ class InheritProductionTask(models.Model):
:return:
"""
self.ensure_one()
picking_type = self._get_default_picking_type()
if not picking_type:
raise ValidationError("未找到默认的调拨类型,请创建业务标识为生产领料单的库存作业类型")
system_id = self.env.ref("roke_workstation_sync_ps.roke_workstation_sync_ps_integrate_system")
sync_address = system_id.sync_address
sync_port = system_id.sync_port
......@@ -174,6 +177,7 @@ class InheritProductionTask(models.Model):
for v in rows_data:
product = self.env["roke.product"].sudo().search([("code", "=", v.get("wlbh", ""))], limit=1)
bom_res.append((0, 0, {
"picking_type_id": picking_type.id,
"material_id": product.id,
"demand_qty": self.plan_qty * v.get("compare", 1),
"qty": self.plan_qty * v.get("compare", 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment