1、优化由质检返工生成的制造订单检测结果数据不全的问题;2、 发票账单:增加字段及优化
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from odoo import models, fields, api
|
||||
from odoo import models, fields, api, _
|
||||
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
@@ -7,6 +7,14 @@ class CustomAccountMoveLine(models.Model):
|
||||
_inherit = 'account.move'
|
||||
_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
|
||||
def create(self, vals):
|
||||
for val in vals:
|
||||
|
||||
Reference in New Issue
Block a user