1、处理返工报错,2、保存的合同文档添加对应销售订单号
This commit is contained in:
@@ -9,7 +9,7 @@ class MrpWorkorder(models.Model):
|
|||||||
exception_ids = fields.One2many('jikimo.workorder.exception', 'workorder_id', string='工单异常记录')
|
exception_ids = fields.One2many('jikimo.workorder.exception', 'workorder_id', string='工单异常记录')
|
||||||
|
|
||||||
def write(self, values):
|
def write(self, values):
|
||||||
if values.get('test_results') and self.exception_ids:
|
if 'test_results' in values and self.exception_ids:
|
||||||
pending_exception = self.exception_ids.filtered(
|
pending_exception = self.exception_ids.filtered(
|
||||||
lambda exc: exc.state == 'pending' and exc.exception_code == 'YC0005'
|
lambda exc: exc.state == 'pending' and exc.exception_code == 'YC0005'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -207,7 +207,8 @@ class SaleOrder(models.Model):
|
|||||||
'name': contract_file_name,
|
'name': contract_file_name,
|
||||||
'attachment_id': attachment.id,
|
'attachment_id': attachment.id,
|
||||||
'folder_id': workspace,
|
'folder_id': workspace,
|
||||||
'res_model': 'sale.order'
|
'res_model': 'sale.order',
|
||||||
|
'res_id': self.id,
|
||||||
})
|
})
|
||||||
|
|
||||||
self.write({
|
self.write({
|
||||||
|
|||||||
Reference in New Issue
Block a user