在sf_base下新增生产线模型,优化了计划管理-工作日历设置的手动输入时间和手动输入班次的格式

This commit is contained in:
yuxianghui
2023-07-06 17:38:08 +08:00
parent f31becc215
commit 123adcfc76
11 changed files with 241 additions and 56 deletions

View File

@@ -0,0 +1,30 @@
from odoo import models,fields,api
class ProductionLine(models.Model):
_name = 'sf.production.line'
_description = '生产线'
def _get_code(self):
"""
自动生成编码
:return:
"""
fixture_material = self.env['sf.production.line'].sudo().search(
[('code', '!=', '')],
limit=1,
order="id desc")
if not fixture_material:
num = "%03d" % 1
else:
m = int(fixture_material.code) + 1
num = "%03d" % m
return num
name = fields.Char('生产线')
code = fields.Char('编码', default=_get_code, readonly=True)
remark = fields.Char('备注')