1.修复产品类别和计量单位去掉审核状态字段2.优化bfm派单至sf的销售订单流程3.工序增加编码字段

This commit is contained in:
jinling.yang
2024-01-19 15:45:15 +08:00
parent eb117aef86
commit 3226942ed3
12 changed files with 26 additions and 101 deletions

View File

@@ -1,5 +1,6 @@
import logging
from odoo import fields, models
from odoo import fields, models, api
from odoo.exceptions import UserError
class ResMrpRoutingWorkcenter(models.Model):
@@ -21,13 +22,17 @@ class ResMrpRoutingWorkcenter(models.Model):
bom_id = fields.Many2one('mrp.bom', required=False)
surface_technics_id = fields.Many2one('sf.production.process', string="表面工艺")
def generate_code(self):
return self.env['ir.sequence'].next_by_code('mrp.routing.workcenter')
code = fields.Char('编码', default=generate_code)
# 获得当前登陆者公司
def get_company_id(self):
self.company_id = self.env.user.company_id.id
company_id = fields.Many2one('res.company', compute="get_company_id", related=False)
# 排产的时候, 根据坯料的长宽高比对一下机床的最大加工尺寸.不符合就不要分配给这个加工中心(机床).
# 工单对应的工作中心,根据工序中的工作中心去匹配,
# 如果只配置了一个工作中心,则默认采用该工作中心;