1.agv配置参数新增地码
2.bpm分配工厂时的客户(业务平台)的必填信息(税,邮箱,号码)赋值 3.报价页面的客户改为不可新建
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import base64
|
import base64
|
||||||
|
import urllib.parse
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import requests
|
import requests
|
||||||
@@ -908,15 +909,17 @@ class WorkPieceDelivery(models.Model):
|
|||||||
|
|
||||||
# 配送至avg小车
|
# 配送至avg小车
|
||||||
def _delivery_avg(self):
|
def _delivery_avg(self):
|
||||||
res = {'reqCode': self.production_id.name, 'reqTime': '', 'clientCode': '', 'tokenCode': '',
|
res = {'reqCode': urllib.parse.quote(self.production_id.name), 'reqTime': '', 'clientCode': '', 'tokenCode': '',
|
||||||
'taskTyp': 'F01', 'ctnrTyp': '', 'ctnrCode': '', 'wbCode': '', 'positionCodePath': [], 'podCode': '',
|
'taskTyp': 'F01', 'ctnrTyp': '', 'ctnrCode': '', 'wbCode': '006848AB006774', 'positionCodePath': [], 'podCode': '',
|
||||||
'podDir': '', 'materialLot': '', 'priority': '', 'taskCode': '', 'agvCode': '', 'materialLot': '',
|
'podDir': '', 'materialLot': '', 'priority': '', 'taskCode': '', 'agvCode': '', 'materialLot': '',
|
||||||
'data': ''}
|
'data': ''}
|
||||||
config = self.env['res.config.settings'].get_values()
|
config = self.env['res.config.settings'].get_values()
|
||||||
try:
|
try:
|
||||||
logging.info('config-AGV请求路径:%s' % config['agv_rcms_url'])
|
logging.info('AGV请求路径:%s' % config['agv_rcs_url'])
|
||||||
logging.info('config-json:%s' % res)
|
logging.info('AGV-json:%s' % res)
|
||||||
ret = requests.post((config['agv_rcms_url']), json=res)
|
|
||||||
|
headers = {'Content-Type': 'application/json'}
|
||||||
|
ret = requests.post((config['agv_rcs_url']), json=res, headers=headers)
|
||||||
ret = ret.json()
|
ret = ret.json()
|
||||||
logging.info('config-ret:%s' % ret)
|
logging.info('config-ret:%s' % ret)
|
||||||
if ret['code'] == 0:
|
if ret['code'] == 0:
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
agv_rcms_url = fields.Char(string='avg_rcms访问地址',
|
agv_rcms_url = fields.Char(string='avg_rcms访问地址',
|
||||||
default='http://IP:PORT/rcms/services/rest/hikRpcService/genAgvSchedulingTask')
|
default='http://IP:PORT/rcms/services/rest/hikRpcService/genAgvSchedulingTask')
|
||||||
agv_rcs_url = fields.Char(string='avg_rcs访问地址', default='http://IP:PORT/xxx/agv/agvCallbackService/agvCallback')
|
agv_rcs_url = fields.Char(string='avg_rcs访问地址', default='http://IP:PORT/xxx/agv/agvCallbackService/agvCallback')
|
||||||
|
wbcode = fields.Char('地码')
|
||||||
model_parser_url = fields.Char('特征识别路径')
|
model_parser_url = fields.Char('特征识别路径')
|
||||||
ftp_host = fields.Char(string='FTP的ip')
|
ftp_host = fields.Char(string='FTP的ip')
|
||||||
ftp_port = fields.Char(string='FTP端口')
|
ftp_port = fields.Char(string='FTP端口')
|
||||||
|
|||||||
@@ -81,12 +81,12 @@
|
|||||||
<div class="o_setting_left_pane"/>
|
<div class="o_setting_left_pane"/>
|
||||||
<div class="o_setting_right_pane">
|
<div class="o_setting_right_pane">
|
||||||
<div class="text-muted">
|
<div class="text-muted">
|
||||||
<label for="agv_rcms_url" string="调度系统(cms)访问地址"/>
|
<label for="agv_rcs_url" string="访问地址"/>
|
||||||
<field name="agv_rcms_url"/>
|
<field name="agv_rcs_url"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-muted">
|
<div class="text-muted">
|
||||||
<label for="agv_rcs_url" string="RCS-2000系统访问地址"/>
|
<label for="wbcode"/>
|
||||||
<field name="agv_rcs_url"/>
|
<field name="wbcode"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import base64
|
import base64
|
||||||
|
from odoo import Command
|
||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from odoo.exceptions import UserError, ValidationError
|
from odoo.exceptions import UserError, ValidationError
|
||||||
|
|
||||||
@@ -88,7 +89,10 @@ class ReSaleOrder(models.Model):
|
|||||||
if customer:
|
if customer:
|
||||||
return customer
|
return customer
|
||||||
else:
|
else:
|
||||||
partner = self.env['res.partner'].create({'name': '业务平台'})
|
partner_tag = self.env['res.partner.category'].create({'name': '平台客户'})
|
||||||
|
partner = self.env['res.partner'].create(
|
||||||
|
{'name': '业务平台', 'vat': '91430103MA7BRH9K4M', 'phone': '0731-85115515',
|
||||||
|
'email': 'jikimo@jikimo.com', 'category_id': [Command.set([partner_tag.id])]})
|
||||||
return partner
|
return partner
|
||||||
|
|
||||||
# 业务平台分配工厂时在创建完产品后再创建销售明细信息
|
# 业务平台分配工厂时在创建完产品后再创建销售明细信息
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
<!-- </xpath>-->
|
<!-- </xpath>-->
|
||||||
<field name="partner_id" position="replace">
|
<field name="partner_id" position="replace">
|
||||||
<field name="partner_id" widget="res_partner_many2one" context="{'is_customer': True }"
|
<field name="partner_id" widget="res_partner_many2one" context="{'is_customer': True }"
|
||||||
options='{"always_reload": True}'/>
|
options='{"always_reload": True,"no_create": True}'/>
|
||||||
</field>
|
</field>
|
||||||
<field name="payment_term_id" position="attributes">
|
<field name="payment_term_id" position="attributes">
|
||||||
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
|||||||
Reference in New Issue
Block a user