代码注释,前后置检查
This commit is contained in:
@@ -21,6 +21,7 @@ class MrpProduction(models.Model):
|
||||
for production in self:
|
||||
production.maintenance_count = len(production.request_ids)
|
||||
|
||||
#维修模块按钮
|
||||
def button_maintenance_req(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
@@ -34,7 +35,7 @@ class MrpProduction(models.Model):
|
||||
},
|
||||
'domain': [('production_id', '=', self.id)],
|
||||
}
|
||||
|
||||
#打开维修模块请求
|
||||
def open_maintenance_request_mo(self):
|
||||
self.ensure_one()
|
||||
action = {
|
||||
@@ -135,6 +136,7 @@ class MrpProduction(models.Model):
|
||||
for workorder in production.workorder_ids:
|
||||
workorder.duration_expected = workorder._get_duration_expected()
|
||||
|
||||
#在之前的销售单上重新生成制造订单
|
||||
def create_production1_values(self, production):
|
||||
production_values_str = {'origin': production.origin,
|
||||
'product_id': production.product_id.id,
|
||||
@@ -156,6 +158,7 @@ class MrpProduction(models.Model):
|
||||
'user_id': production.user_id.id}
|
||||
return production_values_str
|
||||
|
||||
#工单排序
|
||||
def _reset_work_order_sequence1(self, k):
|
||||
for rec in self:
|
||||
current_sequence = 1
|
||||
@@ -166,6 +169,7 @@ class MrpProduction(models.Model):
|
||||
for a in sfa:
|
||||
print(a)
|
||||
|
||||
#在制造订单上新增工单
|
||||
def _create_workorder1(self, k):
|
||||
for production in self:
|
||||
if not production.bom_id or not production.product_id:
|
||||
@@ -229,6 +233,7 @@ class MrpProduction(models.Model):
|
||||
work.sequence = current_sequence
|
||||
current_sequence += 1
|
||||
|
||||
#创建工单并进行排序
|
||||
def _create_workorder(self):
|
||||
res = self._create_workorder3()
|
||||
self._reset_work_order_sequence()
|
||||
|
||||
Reference in New Issue
Block a user