Merge branch 'feature/库存优化_2' into feature/质检返工优化
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
'version': '0.1',
|
'version': '0.1',
|
||||||
|
|
||||||
# any module necessary for this one to work correctly
|
# any module necessary for this one to work correctly
|
||||||
'depends': ['base', 'account'],
|
'depends': ['base', 'account', 'l10n_cn'],
|
||||||
|
|
||||||
# always loaded
|
# always loaded
|
||||||
'data': [
|
'data': [
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from odoo import models, fields, api
|
from odoo import models, fields, api, _
|
||||||
|
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
@@ -7,6 +7,14 @@ class CustomAccountMoveLine(models.Model):
|
|||||||
_inherit = 'account.move'
|
_inherit = 'account.move'
|
||||||
_description = "account move line"
|
_description = "account move line"
|
||||||
|
|
||||||
|
fapiao = fields.Char(string='发票号', size=20, copy=False, tracking=True, required=True)
|
||||||
|
|
||||||
|
@api.constrains('fapiao')
|
||||||
|
def _check_fapiao(self):
|
||||||
|
for record in self:
|
||||||
|
if record.fapiao and (len(record.fapiao) != 20 or not record.fapiao.isdecimal()):
|
||||||
|
raise ValidationError(_("Fapiao number is an 20-digit number. Please enter a correct one."))
|
||||||
|
|
||||||
@api.model_create_multi
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals):
|
||||||
for val in vals:
|
for val in vals:
|
||||||
|
|||||||
@@ -87,15 +87,14 @@ class QualityCheck(models.Model):
|
|||||||
raise ValidationError('请重新选择【判定结果】-【检测结果】')
|
raise ValidationError('请重新选择【判定结果】-【检测结果】')
|
||||||
if self.workorder_id.routing_type != 'CNC加工' and self.workorder_id.individuation_page_PTD is False:
|
if self.workorder_id.routing_type != 'CNC加工' and self.workorder_id.individuation_page_PTD is False:
|
||||||
self.workorder_id.production_id.write({'detection_result_ids': [(0, 0, {
|
self.workorder_id.production_id.write({'detection_result_ids': [(0, 0, {
|
||||||
'rework_reason': self.workorder_id.reason,
|
'rework_reason': self.reason,
|
||||||
'detailed_reason': self.workorder_id.detailed_reason,
|
'detailed_reason': self.detailed_reason,
|
||||||
'processing_panel': self.workorder_id.processing_panel,
|
'processing_panel': self.workorder_id.processing_panel,
|
||||||
'routing_type': self.workorder_id.routing_type,
|
'routing_type': self.workorder_id.routing_type,
|
||||||
'handle_result': '待处理' if (self.workorder_id.test_results in ['返工', '报废']
|
'handle_result': '待处理',
|
||||||
or self.workorder_id.is_rework is True) else '',
|
'test_results': self.test_results,
|
||||||
'test_results': self.workorder_id.test_results,
|
|
||||||
'test_report': self.workorder_id.detection_report})],
|
'test_report': self.workorder_id.detection_report})],
|
||||||
'is_scrap': True if self.workorder_id.test_results == '报废' else False
|
'is_scrap': True if self.test_results == '报废' else False
|
||||||
})
|
})
|
||||||
if self.workorder_id.state not in ['done']:
|
if self.workorder_id.state not in ['done']:
|
||||||
self.workorder_id.write(
|
self.workorder_id.write(
|
||||||
|
|||||||
Reference in New Issue
Block a user