优化接口和工单

This commit is contained in:
jinling.yang
2024-02-22 19:40:25 +08:00
parent e55f7c59e6
commit 7bf2316c09
4 changed files with 14 additions and 4 deletions

View File

@@ -21,7 +21,6 @@ class Http(models.AbstractModel):
def _auth_method_sf_token(cls):
# 从headers.environ中获取对方传过来的token,timestamp,加密的校验字符串
datas = request.httprequest.headers.environ
logging.info(datas)
if 'HTTP_TOKEN' in datas:
_logger.info('token:%s' % datas['HTTP_TOKEN'])
# 查询密钥

View File

@@ -28,6 +28,7 @@ class Manufacturing_Connect(http.Controller):
res['Datas'].append({
'BillId': item.production_id.name,
'ProductionLine': item.production_id.production_line_id.id,
'SortId': item.sequence,
'CraftName': item.name,
'Quantity': 1,
'MaterialId': item.product_id.default_code,

View File

@@ -136,7 +136,16 @@ class ResMrpWorkOrder(models.Model):
is_delivery = fields.Boolean('是否配送完成', default=False)
rfid_code = fields.Char('RFID')
production_line_id = fields.Many2one('sf.production.line', related='production_id.production_line_id',
string='生产线')
string='生产线', store=True)
production_line_state = fields.Selection(related='production_id.production_line_state',
string='上/下产线', store=True)
@api.onchange('rfid_code')
def compute_rfid(self):
workorder = self.env['mrp.workorder'].search([('production_id', '=', self.production_id)])
if workorder:
for item in workorder:
item.rfid_code = self.rfid_code
def get_plan_workorder(self, production_line):
tomorrow = (date.today() + timedelta(days=+1)).strftime("%Y-%m-%d")

View File

@@ -170,14 +170,15 @@
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
<field name="equipment_id"
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
<field name="production_line_state"
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
<field name="functional_fixture_id"
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
<field name="functional_fixture_code" force_save="1"
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
<field name="functional_fixture_type_id" force_save="1"
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
<field name="rfid_code"
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
<field name="rfid_code" force_save="1"/>
</group>
<group attrs='{"invisible": [("routing_type","=","获取CNC加工程序")]}'>
<div>