212
This commit is contained in:
6
.idea/inspectionProfiles/profiles_settings.xml
generated
6
.idea/inspectionProfiles/profiles_settings.xml
generated
@@ -1,6 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<settings>
|
|
||||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
|
||||||
<version value="1.0" />
|
|
||||||
</settings>
|
|
||||||
</component>
|
|
||||||
8
.idea/jikimo-sf.iml
generated
8
.idea/jikimo-sf.iml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="PYTHON_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/jikimo-sf.iml" filepath="$PROJECT_DIR$/.idea/jikimo-sf.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -1 +1,2 @@
|
|||||||
from . import models
|
from . import models
|
||||||
|
from . import commons
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
{
|
{
|
||||||
'name': '机企猫藏智能工厂 基础模块',
|
'name': '机企猫智能工厂 基础模块',
|
||||||
'version': '1.0',
|
'version': '1.0',
|
||||||
'summary': '智能工厂基础模块',
|
'summary': '智能工厂基础模块',
|
||||||
'sequence': 1,
|
'sequence': 1,
|
||||||
@@ -10,15 +10,13 @@
|
|||||||
""",
|
""",
|
||||||
'category': 'YZ',
|
'category': 'YZ',
|
||||||
'website': 'https://www.sf.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['account', 'base', 'mrp', 'sale'],
|
'depends': ['account', 'base', 'mrp'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/group_security.xml',
|
'security/group_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'views/mrs_base_view.xml',
|
'views/base_view.xml',
|
||||||
'views/mrs_common_view.xml',
|
'views/common_view.xml',
|
||||||
"views/menu_view.xml",
|
"views/menu_view.xml"
|
||||||
'views/sale_order_view.xml',
|
|
||||||
'views/product_template_view.xml',
|
|
||||||
|
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
from. import common
|
from. import common
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
<!--<?xml version="1.0" encoding="UTF-8" ?>-->
|
|
||||||
<!--<odoo>-->
|
|
||||||
<!-- <data noupdate="0">-->
|
|
||||||
<!-- <record id="mrp_routing_workcenter_template_automatic_coding_sf" model="mrp.routing.workcenter">-->
|
|
||||||
<!-- <field name="name">获取自动编码程序</field>-->
|
|
||||||
<!-- <field name="code">automatic coding</field>-->
|
|
||||||
<!-- <field name="time_mode">manual</field>-->
|
|
||||||
<!-- <field name="time_cycle">60</field>-->
|
|
||||||
<!-- <field name="active">True</field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
|
|
||||||
<!-- <record id="mrp_routing_workcenter_template_clamping_sf" model="mrp.routing.workcenter">-->
|
|
||||||
<!-- <field name="name">装夹</field>-->
|
|
||||||
<!-- <field name="code">clamping</field>-->
|
|
||||||
<!-- <field name="time_mode">manual</field>-->
|
|
||||||
<!-- <field name="time_cycle">60</field>-->
|
|
||||||
<!-- <field name="active">True</field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
|
|
||||||
<!-- <record id="mrp_routing_workcenter_template_pre_ternary_sf" model="mrp.routing.workcenter">-->
|
|
||||||
<!-- <field name="name">前置三元定位检测</field>-->
|
|
||||||
<!-- <field name="code">pre-ternary</field>-->
|
|
||||||
<!-- <field name="time_mode">manual</field>-->
|
|
||||||
<!-- <field name="time_cycle">60</field>-->
|
|
||||||
<!-- <field name="active">True</field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
|
|
||||||
<!-- <record id="mrp_routing_workcenter_template_cnc_sf" model="mrp.routing.workcenter">-->
|
|
||||||
<!-- <field name="name">CNC加工</field>-->
|
|
||||||
<!-- <field name="code">CNC machining</field>-->
|
|
||||||
<!-- <field name="time_mode">manual</field>-->
|
|
||||||
<!-- <field name="time_cycle">60</field>-->
|
|
||||||
<!-- <field name="active">True</field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
|
|
||||||
<!-- <record id="mrp_routing_workcenter_template_post_ternary_sf" model="mrp.routing.workcenter">-->
|
|
||||||
<!-- <field name="name">后置三元质量检测</field>-->
|
|
||||||
<!-- <field name="code">post ternary</field>-->
|
|
||||||
<!-- <field name="time_mode">manual</field>-->
|
|
||||||
<!-- <field name="time_cycle">60</field>-->
|
|
||||||
<!-- <field name="active">True</field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
|
|
||||||
<!-- <record id="mrp_routing_workcenter_template_remove_clamping_sf" model="mrp.routing.workcenter">-->
|
|
||||||
<!-- <field name="name">解除装夹</field>-->
|
|
||||||
<!-- <field name="code">remove the clamping</field>-->
|
|
||||||
<!-- <field name="time_mode">manual</field>-->
|
|
||||||
<!-- <field name="time_cycle">60</field>-->
|
|
||||||
<!-- <field name="active">True</field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
<!-- </data>-->
|
|
||||||
<!--</odoo>-->
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
from. import sf_base
|
from . import base
|
||||||
from. import sf_common
|
from . import common
|
||||||
from. import process
|
|
||||||
from. import product_template
|
|
||||||
from. import sale_order
|
|
||||||
|
|||||||
@@ -13,29 +13,29 @@ _logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class MachineBrandTags(models.Model):
|
class MachineBrandTags(models.Model):
|
||||||
_name = 'mrs.machine.brand.tags'
|
_name = 'sf.machine.brand.tags'
|
||||||
_description = '标签'
|
_description = '标签'
|
||||||
name = fields.Char('名称', size=50)
|
name = fields.Char('名称', size=50)
|
||||||
color = fields.Integer('颜色', default=0)
|
color = fields.Integer('颜色', default=0)
|
||||||
|
|
||||||
|
|
||||||
class MachineControlSystem(models.Model):
|
class MachineControlSystem(models.Model):
|
||||||
_name = 'mrs.machine.control_system'
|
_name = 'sf.machine.control_system'
|
||||||
_description = '控制系统'
|
_description = '控制系统'
|
||||||
|
|
||||||
code = fields.Char('编码', size=10)
|
code = fields.Char('编码', size=10)
|
||||||
name = fields.Char('名称', size=10)
|
name = fields.Char('名称', size=10)
|
||||||
brand_id = fields.Many2one('mrs.machine.brand', '品牌')
|
brand_id = fields.Many2one('sf.machine.brand', '品牌')
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
|
|
||||||
# 品牌标签
|
# 品牌标签
|
||||||
class MachineBrand(models.Model):
|
class MachineBrand(models.Model):
|
||||||
_name = 'mrs.machine.brand'
|
_name = 'sf.machine.brand'
|
||||||
_description = '品牌'
|
_description = '品牌'
|
||||||
|
|
||||||
name = fields.Char('名称')
|
name = fields.Char('名称')
|
||||||
tag_ids = fields.Many2many('mrs.machine.brand.tags', 'rel_machine_brand_tags', string='类别')
|
tag_ids = fields.Many2many('sf.machine.brand.tags', 'rel_machine_brand_tags', string='类别')
|
||||||
image_brand = fields.Image("品牌图片")
|
image_brand = fields.Image("品牌图片")
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
code = fields.Char('编码')
|
code = fields.Char('编码')
|
||||||
@@ -43,7 +43,7 @@ class MachineBrand(models.Model):
|
|||||||
|
|
||||||
# 机床
|
# 机床
|
||||||
class MachineTool(models.Model):
|
class MachineTool(models.Model):
|
||||||
_name = 'mrs.machine_tool'
|
_name = 'sf.machine_tool'
|
||||||
_description = '机床'
|
_description = '机床'
|
||||||
MTcode = fields.Char("编码")
|
MTcode = fields.Char("编码")
|
||||||
code = fields.Char('行业编码')
|
code = fields.Char('行业编码')
|
||||||
@@ -64,11 +64,11 @@ class MachineTool(models.Model):
|
|||||||
c_axis = fields.Integer('C轴')
|
c_axis = fields.Integer('C轴')
|
||||||
remark = fields.Text('备注')
|
remark = fields.Text('备注')
|
||||||
precision = fields.Float('加工精度')
|
precision = fields.Float('加工精度')
|
||||||
control_system_id = fields.Many2one('mrs.machine.control_system',
|
control_system_id = fields.Many2one('sf.machine.control_system',
|
||||||
string="控制系统")
|
string="控制系统")
|
||||||
# 多个机床型号对应一个机床
|
# 多个机床型号对应一个机床
|
||||||
type_id = fields.Many2one('mrs.machine_tool.type', '型号')
|
type_id = fields.Many2one('sf.machine_tool.type', '型号')
|
||||||
brand_id = fields.Many2one('mrs.machine.brand', string='品牌')
|
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
|
||||||
state = fields.Selection(
|
state = fields.Selection(
|
||||||
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
|
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
|
||||||
default='正常', string="状态")
|
default='正常', string="状态")
|
||||||
@@ -145,10 +145,10 @@ class MachineTool(models.Model):
|
|||||||
def enroll_machine_tool(self):
|
def enroll_machine_tool(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
strurl = sf_sync_config['mrs_url'] + self.crea_url
|
strurl = sf_sync_config['sf_url'] + self.crea_url
|
||||||
objs_all = request.env['mrs.machine_tool'].sudo().search([])
|
objs_all = request.env['sf.machine_tool'].sudo().search([])
|
||||||
machine_tool_list = []
|
machine_tool_list = []
|
||||||
if objs_all:
|
if objs_all:
|
||||||
for item in objs_all:
|
for item in objs_all:
|
||||||
@@ -162,10 +162,10 @@ class MachineTool(models.Model):
|
|||||||
'number_of_knife_library': item.number_of_knife_library,
|
'number_of_knife_library': item.number_of_knife_library,
|
||||||
'rotate_speed': item.rotate_speed,
|
'rotate_speed': item.rotate_speed,
|
||||||
'number_of_axles': item.number_of_axles,
|
'number_of_axles': item.number_of_axles,
|
||||||
'control_system_id': self.env['mrs.machine.control_system'].search(
|
'control_system_id': self.env['sf.machine.control_system'].search(
|
||||||
[('id', '=', item.control_system_id.id)]).code,
|
[('id', '=', item.control_system_id.id)]).code,
|
||||||
'type_id': self.env['mrs.machine_tool.type'].search([('id', '=', item.type_id.id)]).code,
|
'type_id': self.env['sf.machine_tool.type'].search([('id', '=', item.type_id.id)]).code,
|
||||||
'brand_id': self.env['mrs.machine.brand'].search([('id', '=', item.brand_id.id)]).code,
|
'brand_id': self.env['sf.machine.brand'].search([('id', '=', item.brand_id.id)]).code,
|
||||||
'supplier_id': item.supplier_id.id,
|
'supplier_id': item.supplier_id.id,
|
||||||
'x_axis': item.x_axis,
|
'x_axis': item.x_axis,
|
||||||
'y_axis': item.y_axis,
|
'y_axis': item.y_axis,
|
||||||
@@ -188,19 +188,19 @@ class MachineTool(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class MachineToolType(models.Model):
|
class MachineToolType(models.Model):
|
||||||
_name = 'mrs.machine_tool.type'
|
_name = 'sf.machine_tool.type'
|
||||||
_description = '机床型号'
|
_description = '机床型号'
|
||||||
# _order = 'priority desc, code, name, id'
|
# _order = 'priority desc, code, name, id'
|
||||||
|
|
||||||
name = fields.Char('名称')
|
name = fields.Char('名称')
|
||||||
brand_id = fields.Many2one('mrs.machine.brand', string='品牌')
|
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
|
||||||
knife_type = fields.Selection(
|
knife_type = fields.Selection(
|
||||||
[("BT40", "BT40"), ("BT30", "BT30")],
|
[("BT40", "BT40"), ("BT30", "BT30")],
|
||||||
default="", string="刀把类型")
|
default="", string="刀把类型")
|
||||||
number_of_knife_library = fields.Integer('刀库数量')
|
number_of_knife_library = fields.Integer('刀库数量')
|
||||||
rotate_speed = fields.Integer('转速')
|
rotate_speed = fields.Integer('转速')
|
||||||
# 多个型号对应一个机床
|
# 多个型号对应一个机床
|
||||||
machine_tool_id = fields.Many2one('mrs.machine_tool', '机床')
|
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
|
||||||
number_of_axles = fields.Selection(
|
number_of_axles = fields.Selection(
|
||||||
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴")],
|
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴")],
|
||||||
default="", string="轴数")
|
default="", string="轴数")
|
||||||
@@ -212,7 +212,7 @@ class MachineToolType(models.Model):
|
|||||||
c_axis = fields.Integer('C轴')
|
c_axis = fields.Integer('C轴')
|
||||||
remark = fields.Text('备注')
|
remark = fields.Text('备注')
|
||||||
precision = fields.Float('加工精度')
|
precision = fields.Float('加工精度')
|
||||||
control_system_id = fields.Many2one('mrs.machine.control_system',
|
control_system_id = fields.Many2one('sf.machine.control_system',
|
||||||
string="控制系统")
|
string="控制系统")
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
code = fields.Char('编码')
|
code = fields.Char('编码')
|
||||||
@@ -220,7 +220,7 @@ class MachineToolType(models.Model):
|
|||||||
|
|
||||||
# 刀具
|
# 刀具
|
||||||
class CuttingTool(models.Model):
|
class CuttingTool(models.Model):
|
||||||
_name = 'mrs.cutting_tool.category'
|
_name = 'sf.cutting_tool.category'
|
||||||
_description = '刀具类别'
|
_description = '刀具类别'
|
||||||
|
|
||||||
code = fields.Char('编码')
|
code = fields.Char('编码')
|
||||||
@@ -231,7 +231,7 @@ class CuttingTool(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class CuttingToolType(models.Model):
|
class CuttingToolType(models.Model):
|
||||||
_name = 'mrs.cutting_tool.type'
|
_name = 'sf.cutting_tool.type'
|
||||||
_description = '刀具型号'
|
_description = '刀具型号'
|
||||||
|
|
||||||
code = fields.Char('编码')
|
code = fields.Char('编码')
|
||||||
@@ -243,26 +243,8 @@ class CuttingToolType(models.Model):
|
|||||||
taper_shank_length = fields.Integer('锥柄长')
|
taper_shank_length = fields.Integer('锥柄长')
|
||||||
tool_length = fields.Integer('刀具总长')
|
tool_length = fields.Integer('刀具总长')
|
||||||
blade_number = fields.Integer('刃数')
|
blade_number = fields.Integer('刃数')
|
||||||
category_id = fields.Many2one('mrs.cutting_tool.category', string='刀具类别')
|
category_id = fields.Many2one('sf.cutting_tool.category', string='刀具类别')
|
||||||
brand_id = fields.Many2one('mrs.machine.brand', string='品牌')
|
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
|
||||||
remark = fields.Text('备注')
|
remark = fields.Text('备注')
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
|
|
||||||
class CNCprocessing(models.Model):
|
|
||||||
_name = 'cnc.processing'
|
|
||||||
_description = "CNC加工"
|
|
||||||
|
|
||||||
cnc_id = fields.Many2one('ir.attachment')
|
|
||||||
FNo = fields.Char(string="序号")
|
|
||||||
FPGName = fields.Char(string="程序名")
|
|
||||||
FKnifeName = fields.Char(string="刀具名称")
|
|
||||||
FDNo = fields.Char(string="刀号")
|
|
||||||
FWorkType = fields.Char(string="加工类型")
|
|
||||||
FXY = fields.Char(string="余量_X/Y")
|
|
||||||
FZ = fields.Char(string="余量_Z")
|
|
||||||
FJGSD = fields.Char(string="加工深度(Z)")
|
|
||||||
FSCCD = fields.Char(string="刀具伸出长度")
|
|
||||||
FDJSpec = fields.Char(string="刀柄型号")
|
|
||||||
FJGDate = fields.Datetime(string="预计加工时间")
|
|
||||||
FComment = fields.Char(string="备注")
|
|
||||||
@@ -7,64 +7,65 @@ _logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
# 材料
|
# 材料
|
||||||
class MrsProductionMaterials(models.Model):
|
class MrsProductionMaterials(models.Model):
|
||||||
_name = 'mrs.production.materials'
|
_name = 'sf.production.materials'
|
||||||
_description = '材料'
|
_description = '材料'
|
||||||
remark = fields.Text("备注")
|
|
||||||
|
materials_no = fields.Char("编码")
|
||||||
name = fields.Char('名称')
|
name = fields.Char('名称')
|
||||||
partner_ids = fields.Many2many('res.partner', 'materials_ids', '加工工厂')
|
partner_ids = fields.Many2many('res.partner', 'materials_ids', '加工工厂')
|
||||||
materials_model_ids = fields.One2many('mrs.materials.model', 'materials_id', '材料型号')
|
materials_model_ids = fields.One2many('sf.materials.model', 'materials_id', '材料型号')
|
||||||
materials_no = fields.Char("编码")
|
remark = fields.Text("备注")
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
|
|
||||||
# 材料型号
|
# 材料型号
|
||||||
class MrsMaterialModel(models.Model):
|
class MrsMaterialModel(models.Model):
|
||||||
_name = 'mrs.materials.model'
|
_name = 'sf.materials.model'
|
||||||
_description = '材料型号'
|
_description = '材料型号'
|
||||||
remark = fields.Text("备注")
|
|
||||||
|
materials_no = fields.Char("编码")
|
||||||
|
materials_num = fields.Char("编码号")
|
||||||
name = fields.Char('型号名')
|
name = fields.Char('型号名')
|
||||||
need_h = fields.Boolean("热处理", default="false")
|
need_h = fields.Boolean("热处理", default="false")
|
||||||
mf_materia_post = fields.Char("热处理后密度")
|
mf_materia_post = fields.Char("热处理后密度")
|
||||||
density = fields.Float("密度(kg/m³)")
|
density = fields.Float("密度(kg/m³)")
|
||||||
materials_id = fields.Many2one('mrs.production.materials', "材料名")
|
materials_id = fields.Many2one('sf.production.materials', "材料名")
|
||||||
materials_num = fields.Char("编码号")
|
remark = fields.Text("备注")
|
||||||
materials_no = fields.Char("编码")
|
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
|
|
||||||
# 工艺 编码,名称,备注
|
# 工艺 编码,名称,备注
|
||||||
class MrsProductionProcess(models.Model):
|
class MrsProductionProcess(models.Model):
|
||||||
_name = 'mrs.production.process'
|
_name = 'sf.production.process'
|
||||||
_description = '表面工艺'
|
_description = '表面工艺'
|
||||||
name = fields.Char('表面工艺')
|
|
||||||
remark = fields.Text("备注")
|
|
||||||
processing_order_ids = fields.One2many('mrs.processing.order', 'production_process_id', string='工序')
|
|
||||||
partner_process_ids = fields.Many2many('res.partner', 'process_ids', '加工工厂')
|
|
||||||
process_encode = fields.Char("编码")
|
process_encode = fields.Char("编码")
|
||||||
|
name = fields.Char('名称')
|
||||||
|
remark = fields.Text("备注")
|
||||||
|
processing_order_ids = fields.One2many('sf.processing.order', 'production_process_id', string='工序')
|
||||||
|
partner_process_ids = fields.Many2many('res.partner', 'process_ids', '加工工厂')
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
|
|
||||||
class MrsProcessingTechnology(models.Model):
|
class MrsProcessingTechnology(models.Model):
|
||||||
_name = 'mrs.processing.technology'
|
_name = 'sf.processing.technology'
|
||||||
_description = '加工工艺'
|
_description = '加工工艺'
|
||||||
remark = fields.Text("备注")
|
|
||||||
name = fields.Char('加工工艺', index=True)
|
name = fields.Char('名称', index=True)
|
||||||
remark = fields.Text('备注', index=True)
|
remark = fields.Text('备注', index=True)
|
||||||
process_encode = fields.Char("编码")
|
process_encode = fields.Char("编码")
|
||||||
processing_order_ids = fields.Many2many('mrs.processing.order', 'mrs_associated_processes',
|
processing_order_ids = fields.Many2many('sf.processing.order', 'sf_associated_processes',
|
||||||
index=True, string='工序')
|
index=True, string='工序')
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
|
|
||||||
class MrsProcessingOrder(models.Model):
|
class MrsProcessingOrder(models.Model):
|
||||||
_name = 'mrs.processing.order'
|
_name = 'sf.processing.order'
|
||||||
_description = '工序'
|
_description = '工序'
|
||||||
sequence = fields.Integer('Sequence')
|
sequence = fields.Integer('Sequence')
|
||||||
|
|
||||||
processing_technology_ids = fields.Many2many('mrs.processing.technology', 'mrs_associated_processes',
|
processing_technology_ids = fields.Many2many('sf.processing.technology', 'sf_associated_processes',
|
||||||
|
|
||||||
index=True, string='加工工艺')
|
index=True, string='加工工艺')
|
||||||
|
|
||||||
production_process_id = fields.Many2one('mrs.production.process', string="表面工艺")
|
production_process_id = fields.Many2one('mrs.production.process', string="表面工艺")
|
||||||
|
|
||||||
|
|
||||||
@@ -72,7 +73,7 @@ class Tray(models.Model):
|
|||||||
_name = 'sf.tray'
|
_name = 'sf.tray'
|
||||||
_description = '托盘'
|
_description = '托盘'
|
||||||
|
|
||||||
code = fields.Char('编码',copy=False)
|
code = fields.Char('编码', copy=False)
|
||||||
name = fields.Char('名称')
|
name = fields.Char('名称')
|
||||||
state = fields.Selection(
|
state = fields.Selection(
|
||||||
[("空闲", "空闲"), ("占用", "占用"), ("报损", "报损")],
|
[("空闲", "空闲"), ("占用", "占用"), ("报损", "报损")],
|
||||||
@@ -1,21 +1,20 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
access_mrs_machine_tool,mrs_machine_tool,model_mrs_machine_tool,base.group_user,1,1,1,1
|
access_sf_machine_tool,sf_machine_tool,model_sf_machine_tool,base.group_user,1,1,1,1
|
||||||
access_mrs_cutting_tool_category,mrs_cutting_tool_category,model_mrs_cutting_tool_category,base.group_user,1,1,1,1
|
access_sf_cutting_tool_category,sf_cutting_tool_category,model_sf_cutting_tool_category,base.group_user,1,1,1,1
|
||||||
access_mrs_machine_tool_type,mrs_machine_tool_type,model_mrs_machine_tool_type,base.group_user,1,1,1,1
|
access_sf_machine_tool_type,sf_machine_tool_type,model_sf_machine_tool_type,base.group_user,1,1,1,1
|
||||||
access_mrs_cutting_tool_type,mrs_cutting_tool_type,model_mrs_cutting_tool_type,base.group_user,1,1,1,1
|
access_sf_cutting_tool_type,sf_cutting_tool_type,model_sf_cutting_tool_type,base.group_user,1,1,1,1
|
||||||
access_mrs_machine_brand,mrs_machine_brand,model_mrs_machine_brand,base.group_user,1,1,1,1
|
access_sf_machine_brand,sf_machine_brand,model_sf_machine_brand,base.group_user,1,1,1,1
|
||||||
access_mrs_machine_brand_tags,mrs_machine_brand_tags,model_mrs_machine_brand_tags,base.group_user,1,1,1,1
|
access_sf_machine_brand_tags,sf_machine_brand_tags,model_sf_machine_brand_tags,base.group_user,1,1,1,1
|
||||||
access_mrs_machine_control_system,mrs_machine_control_system,model_mrs_machine_control_system,base.group_user,1,1,1,1
|
access_sf_machine_control_system,sf_machine_control_system,model_sf_machine_control_system,base.group_user,1,1,1,1
|
||||||
|
access_sf_processing_order,sf_processing_order,model_sf_processing_order,base.group_user,1,1,1,1
|
||||||
access_mrs_processing_order,mrs_processing_order,model_mrs_processing_order,base.group_user,1,1,1,1
|
access_sf_production_process,sf_production_process,model_sf_production_process,base.group_user,1,1,1,1
|
||||||
access_mrs_production_process,mrs_production_process,model_mrs_production_process,base.group_user,1,1,1,1
|
access_sf_production_materials,sf_production_materials,model_sf_production_materials,base.group_user,1,1,1,1
|
||||||
access_mrs_production_materials,mrs_production_materials,model_mrs_production_materials,base.group_user,1,1,1,1
|
access_sf_materials_model,sf_materials_model,model_sf_materials_model,base.group_user,1,1,1,1
|
||||||
access_mrs_materials_model,mrs_materials_model,model_mrs_materials_model,base.group_user,1,1,1,1
|
access_sf_processing_technology,sf_processing_technology,model_sf_processing_technology,base.group_user,1,1,1,1
|
||||||
access_mrs_processing_technology,mrs_processing_technology,model_mrs_processing_technology,base.group_user,1,1,1,1
|
|
||||||
access_sf_tray,sf_tray,model_sf_tray,base.group_user,1,1,1,1
|
access_sf_tray,sf_tray,model_sf_tray,base.group_user,1,1,1,1
|
||||||
access_cnc_processing,cnc_processing,model_cnc_processing,base.group_user,1,1,1,1
|
|
||||||
access_sf_model_type,sf_model_type,model_sf_model_type,base.group_user,1,1,1,1
|
|
||||||
access_sf_model_type_routing_sort,sf_model_type_routing_sort,model_sf_model_type_routing_sort,base.group_user,1,1,1,1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<odoo>
|
<odoo>
|
||||||
#------------------品牌------------------
|
#------------------品牌------------------
|
||||||
<record model="ir.ui.view" id="search_mrs_machine_brand_view">
|
<record model="ir.ui.view" id="search_sf_machine_brand_view">
|
||||||
<field name="name">search.mrs.machine.brand</field>
|
<field name="name">search.sf.machine.brand</field>
|
||||||
<field name="model">mrs.machine.brand</field>
|
<field name="model">sf.machine.brand</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="品牌">
|
<search string="品牌">
|
||||||
<!-- <field name="name" string="名称"-->
|
<!-- <field name="name" string="名称"-->
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="tree_mrs_machine_brand_view">
|
<record model="ir.ui.view" id="tree_sf_machine_brand_view">
|
||||||
<field name="name">tree.mrs.machine.brand</field>
|
<field name="name">tree.sf.machine.brand</field>
|
||||||
<field name="model">mrs.machine.brand</field>
|
<field name="model">sf.machine.brand</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="品牌">
|
<tree string="品牌">
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
@@ -29,9 +29,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="form_mrs_machine_brand">
|
<record model="ir.ui.view" id="form_sf_machine_brand">
|
||||||
<field name="name">form.mrs.machine.brand</field>
|
<field name="name">form.sf.machine.brand</field>
|
||||||
<field name="model">mrs.machine.brand</field>
|
<field name="model">sf.machine.brand</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="品牌">
|
<form string="品牌">
|
||||||
<!-- <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>-->
|
<!-- <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>-->
|
||||||
@@ -55,10 +55,10 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_mrs_machine_brand" model="ir.actions.act_window">
|
<record id="action_sf_machine_brand" model="ir.actions.act_window">
|
||||||
<field name="name">品牌</field>
|
<field name="name">品牌</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrs.machine.brand</field>
|
<field name="res_model">sf.machine.brand</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@@ -71,9 +71,9 @@
|
|||||||
|
|
||||||
#------------------机床型号------------------
|
#------------------机床型号------------------
|
||||||
|
|
||||||
<record model="ir.ui.view" id="search_mrs_machine_tool_type_view">
|
<record model="ir.ui.view" id="search_sf_machine_tool_type_view">
|
||||||
<field name="name">search.mrs.machine_tool.type</field>
|
<field name="name">search.sf.machine_tool.type</field>
|
||||||
<field name="model">mrs.machine_tool.type</field>
|
<field name="model">sf.machine_tool.type</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="机床型号">
|
<search string="机床型号">
|
||||||
<field name="name" string="模糊搜索"
|
<field name="name" string="模糊搜索"
|
||||||
@@ -82,9 +82,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="tree_mrs_machine_tool_type_view">
|
<record model="ir.ui.view" id="tree_sf_machine_tool_type_view">
|
||||||
<field name="name">tree.mrs.machine_tool.type</field>
|
<field name="name">tree.sf.machine_tool.type</field>
|
||||||
<field name="model">mrs.machine_tool.type</field>
|
<field name="model">sf.machine_tool.type</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="机床型号">
|
<tree string="机床型号">
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
@@ -95,9 +95,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="form_mrs_machine_tool_type">
|
<record model="ir.ui.view" id="form_sf_machine_tool_type">
|
||||||
<field name="name">form.mrs.machine_tool.type</field>
|
<field name="name">form.sf.machine_tool.type</field>
|
||||||
<field name="model">mrs.machine_tool.type</field>
|
<field name="model">sf.machine_tool.type</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="机床型号">
|
<form string="机床型号">
|
||||||
<group string="基本信息" name="base_info">
|
<group string="基本信息" name="base_info">
|
||||||
@@ -155,10 +155,10 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_mrs_machine_tool_type" model="ir.actions.act_window">
|
<record id="action_sf_machine_tool_type" model="ir.actions.act_window">
|
||||||
<field name="name">机床型号</field>
|
<field name="name">机床型号</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrs.machine_tool.type</field>
|
<field name="res_model">sf.machine_tool.type</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@@ -171,9 +171,9 @@
|
|||||||
|
|
||||||
#------------------刀具型号------------------
|
#------------------刀具型号------------------
|
||||||
|
|
||||||
<record model="ir.ui.view" id="search_mrs_cutting_tool_type_view">
|
<record model="ir.ui.view" id="search_sf_cutting_tool_type_view">
|
||||||
<field name="name">search.mrs.cutting_tool.type</field>
|
<field name="name">search.sf.cutting_tool.type</field>
|
||||||
<field name="model">mrs.cutting_tool.type</field>
|
<field name="model">sf.cutting_tool.type</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="刀具型号">
|
<search string="刀具型号">
|
||||||
<field name="name" string="模糊搜索"
|
<field name="name" string="模糊搜索"
|
||||||
@@ -183,8 +183,8 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="tree_cutting_tool_type_view">
|
<record model="ir.ui.view" id="tree_cutting_tool_type_view">
|
||||||
<field name="name">tree.mrs.cutting_tool.type</field>
|
<field name="name">tree.sf.cutting_tool.type</field>
|
||||||
<field name="model">mrs.cutting_tool.type</field>
|
<field name="model">sf.cutting_tool.type</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="刀具型号">
|
<tree string="刀具型号">
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
@@ -194,9 +194,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="form_mrs_cutting_tool_type">
|
<record model="ir.ui.view" id="form_sf_cutting_tool_type">
|
||||||
<field name="name">form.mrs.cutting_tool.type</field>
|
<field name="name">form.sf.cutting_tool.type</field>
|
||||||
<field name="model">mrs.cutting_tool.type</field>
|
<field name="model">sf.cutting_tool.type</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="刀具型号">
|
<form string="刀具型号">
|
||||||
<group string="基本信息">
|
<group string="基本信息">
|
||||||
@@ -230,10 +230,10 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_mrs_cutting_tool_type" model="ir.actions.act_window">
|
<record id="action_sf_cutting_tool_type" model="ir.actions.act_window">
|
||||||
<field name="name">刀具型号</field>
|
<field name="name">刀具型号</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrs.cutting_tool.type</field>
|
<field name="res_model">sf.cutting_tool.type</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@@ -246,9 +246,9 @@
|
|||||||
|
|
||||||
#------------------刀具类别------------------
|
#------------------刀具类别------------------
|
||||||
|
|
||||||
<record model="ir.ui.view" id="search_mrs_cutting_tool_category_view">
|
<record model="ir.ui.view" id="search_sf_cutting_tool_category_view">
|
||||||
<field name="name">search.mrs.cutting_tool.category</field>
|
<field name="name">search.sf.cutting_tool.category</field>
|
||||||
<field name="model">mrs.cutting_tool.category</field>
|
<field name="model">sf.cutting_tool.category</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="刀具类别">
|
<search string="刀具类别">
|
||||||
<field name="name" string="模糊搜索"
|
<field name="name" string="模糊搜索"
|
||||||
@@ -257,9 +257,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="tree_mrs_cutting_tool_category_view">
|
<record model="ir.ui.view" id="tree_sf_cutting_tool_category_view">
|
||||||
<field name="name">tree.mrs.cutting_tool.category</field>
|
<field name="name">tree.sf.cutting_tool.category</field>
|
||||||
<field name="model">mrs.cutting_tool.category</field>
|
<field name="model">sf.cutting_tool.category</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="刀具类别">
|
<tree string="刀具类别">
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
@@ -268,9 +268,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="mrs_cutting_tool_category_form">
|
<record model="ir.ui.view" id="sf_cutting_tool_category_form">
|
||||||
<field name="name">form.mrs.cutting_tool.category</field>
|
<field name="name">form.sf.cutting_tool.category</field>
|
||||||
<field name="model">mrs.cutting_tool.category</field>
|
<field name="model">sf.cutting_tool.category</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="刀具类别">
|
<form string="刀具类别">
|
||||||
<group string="基本信息">
|
<group string="基本信息">
|
||||||
@@ -306,10 +306,10 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_mrs_cutting_tool_category" model="ir.actions.act_window">
|
<record id="action_sf_cutting_tool_category" model="ir.actions.act_window">
|
||||||
<field name="name">刀具类别</field>
|
<field name="name">刀具类别</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrs.cutting_tool.category</field>
|
<field name="res_model">sf.cutting_tool.category</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@@ -322,9 +322,9 @@
|
|||||||
|
|
||||||
#------------------机床注册------------------
|
#------------------机床注册------------------
|
||||||
|
|
||||||
<record model="ir.ui.view" id="search_mrs_machine_tool_view">
|
<record model="ir.ui.view" id="search_sf_machine_tool_view">
|
||||||
<field name="name">search.mrs.machine_tool</field>
|
<field name="name">search.sf.machine_tool</field>
|
||||||
<field name="model">mrs.machine_tool</field>
|
<field name="model">sf.machine_tool</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="机床">
|
<search string="机床">
|
||||||
<field name="name" string="名称" filter_domain="[('name', 'ilike', self)]"/>
|
<field name="name" string="名称" filter_domain="[('name', 'ilike', self)]"/>
|
||||||
@@ -338,9 +338,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="tree_mrs_machine_tool_view">
|
<record model="ir.ui.view" id="tree_sf_machine_tool_view">
|
||||||
<field name="name">tree.mrs.machine_tool</field>
|
<field name="name">tree.sf.machine_tool</field>
|
||||||
<field name="model">mrs.machine_tool</field>
|
<field name="model">sf.machine_tool</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="机床">
|
<tree string="机床">
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
@@ -353,9 +353,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="mrs_machine_tool_form">
|
<record model="ir.ui.view" id="sf_machine_tool_form">
|
||||||
<field name="name">form.mrs.machine_tool</field>
|
<field name="name">form.sf.machine_tool</field>
|
||||||
<field name="model">mrs.machine_tool</field>
|
<field name="model">sf.machine_tool</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="机床">
|
<form string="机床">
|
||||||
<header>
|
<header>
|
||||||
@@ -427,10 +427,10 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_mrs_machine_tool" model="ir.actions.act_window">
|
<record id="action_sf_machine_tool" model="ir.actions.act_window">
|
||||||
<field name="name">机床</field>
|
<field name="name">机床</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrs.machine_tool</field>
|
<field name="res_model">sf.machine_tool</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<!-- <field name="search_view_id" ref="view_okr_filter"/>-->
|
<!-- <field name="search_view_id" ref="view_okr_filter"/>-->
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
@@ -444,9 +444,9 @@
|
|||||||
|
|
||||||
#------------------控制系统------------------
|
#------------------控制系统------------------
|
||||||
|
|
||||||
<record model="ir.ui.view" id="search_mrs_machine_control_system_view">
|
<record model="ir.ui.view" id="search_sf_machine_control_system_view">
|
||||||
<field name="name">search.mrs.machine.control_system</field>
|
<field name="name">search.sf.machine.control_system</field>
|
||||||
<field name="model">mrs.machine.control_system</field>
|
<field name="model">sf.machine.control_system</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="控制系统">
|
<search string="控制系统">
|
||||||
<field name="name" string="模糊搜索"
|
<field name="name" string="模糊搜索"
|
||||||
@@ -455,9 +455,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="tree_mrs_machine_control_system_view">
|
<record model="ir.ui.view" id="tree_sf_machine_control_system_view">
|
||||||
<field name="name">tree.mrs.machine.control_system</field>
|
<field name="name">tree.sf.machine.control_system</field>
|
||||||
<field name="model">mrs.machine.control_system</field>
|
<field name="model">sf.machine.control_system</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="控制系统">
|
<tree string="控制系统">
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
@@ -467,9 +467,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="form_mrs_machine_control_system">
|
<record model="ir.ui.view" id="form_sf_machine_control_system">
|
||||||
<field name="name">form.mrs.machine.control_system</field>
|
<field name="name">form.sf.machine.control_system</field>
|
||||||
<field name="model">mrs.machine.control_system</field>
|
<field name="model">sf.machine.control_system</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="控制系统">
|
<form string="控制系统">
|
||||||
<group>
|
<group>
|
||||||
@@ -487,10 +487,10 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_mrs_machine_control_system" model="ir.actions.act_window">
|
<record id="action_sf_machine_control_system" model="ir.actions.act_window">
|
||||||
<field name="name">控制系统</field>
|
<field name="name">控制系统</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrs.machine.control_system</field>
|
<field name="res_model">sf.machine.control_system</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@@ -500,65 +500,4 @@
|
|||||||
</p>
|
</p>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
#------------------模型类型------------------
|
|
||||||
|
|
||||||
<record model="ir.ui.view" id="search_sf_model_type_view">
|
|
||||||
<field name="name">search.sf.model.type</field>
|
|
||||||
<field name="model">sf.model.type</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<search string="模型类型">
|
|
||||||
<field name="name" string="模糊搜索"
|
|
||||||
filter_domain="[('name', 'ilike', self)]"/>
|
|
||||||
</search>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record model="ir.ui.view" id="tree_sf_model_type_view">
|
|
||||||
<field name="name">tree.sf.model.type</field>
|
|
||||||
<field name="model">sf.model.type</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<tree string="模型类型">
|
|
||||||
<field name="name"/>
|
|
||||||
</tree>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record model="ir.ui.view" id="form_sf_model_type">
|
|
||||||
<field name="name">form.sf.model.type</field>
|
|
||||||
<field name="model">sf.model.type</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<form string="模型类型">
|
|
||||||
<group>
|
|
||||||
<field name="name" required="1"/>
|
|
||||||
<field name="embryo_tolerance" required="1"/>
|
|
||||||
</group>
|
|
||||||
<group>
|
|
||||||
<field name='routing_tmpl_ids'>
|
|
||||||
<tree editable='bottom'>
|
|
||||||
<field name="sequence" widget="handle" string="序号"/>
|
|
||||||
<field name="route_workcenter_id" string="工序"/>
|
|
||||||
<field name="routing_type" string="类型"/>
|
|
||||||
<field name="is_repeat" string="重复"/>
|
|
||||||
<field name="workcenter_ids" string="工作中心" widget="many2many_tags" />
|
|
||||||
</tree>
|
|
||||||
</field>
|
|
||||||
</group>
|
|
||||||
</form>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="action_sf_model_type" model="ir.actions.act_window">
|
|
||||||
<field name="name">模型类型</field>
|
|
||||||
<field name="type">ir.actions.act_window</field>
|
|
||||||
<field name="res_model">sf.model.type</field>
|
|
||||||
<field name="view_mode">tree,form</field>
|
|
||||||
<field name="help" type="html">
|
|
||||||
<p class="o_view_nocontent_smiling_face">
|
|
||||||
[模型类型] 还没有哦!点左上角的[创建]按钮,沙发归你了!
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
</p>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<!--加工工艺-->
|
<!--加工工艺-->
|
||||||
<record model="ir.ui.view" id="mrs_processing_technology_form">
|
<record model="ir.ui.view" id="sf_processing_technology_form">
|
||||||
<field name="model">mrs.processing.technology</field>
|
<field name="model">sf.processing.technology</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="加工工艺">
|
<form string="加工工艺">
|
||||||
|
|
||||||
@@ -27,8 +26,8 @@
|
|||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.view" id="mrs_processing_technology_tree">
|
<record model="ir.ui.view" id="sf_processing_technology_tree">
|
||||||
<field name="model">mrs.processing.technology</field>
|
<field name="model">sf.processing.technology</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="加工工艺">
|
<tree string="加工工艺">
|
||||||
|
|
||||||
@@ -38,9 +37,9 @@
|
|||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.view" id="search_mrs_processing_technology_view">
|
<record model="ir.ui.view" id="search_sf_processing_technology_view">
|
||||||
<field name="name">search.mrs.processing.technology.type</field>
|
<field name="name">search.sf.processing.technology.type</field>
|
||||||
<field name="model">mrs.processing.technology</field>
|
<field name="model">sf.processing.technology</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||||
@@ -49,8 +48,8 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<!--表面工艺-->
|
<!--表面工艺-->
|
||||||
<record model="ir.ui.view" id="mrs_production_process_tree">
|
<record model="ir.ui.view" id="sf_production_process_tree">
|
||||||
<field name="model">mrs.production.process</field>
|
<field name="model">sf.production.process</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="表面工艺">
|
<tree string="表面工艺">
|
||||||
|
|
||||||
@@ -60,8 +59,8 @@
|
|||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.view" id="mrs_production_process_form">
|
<record model="ir.ui.view" id="sf_production_process_form">
|
||||||
<field name="model">mrs.production.process</field>
|
<field name="model">sf.production.process</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="表面工艺">
|
<form string="表面工艺">
|
||||||
<group>
|
<group>
|
||||||
@@ -92,9 +91,9 @@
|
|||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.view" id="search_mrs_production_process_view">
|
<record model="ir.ui.view" id="search_sf_production_process_view">
|
||||||
<field name="name">search.mrs.production.process.type</field>
|
<field name="name">search.sf.production.process.type</field>
|
||||||
<field name="model">mrs.production.process</field>
|
<field name="model">sf.production.process</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||||
@@ -103,8 +102,8 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<!--材料型号-->
|
<!--材料型号-->
|
||||||
<record model="ir.ui.view" id="mrs_materials_model_form">
|
<record model="ir.ui.view" id="sf_materials_model_form">
|
||||||
<field name="model">mrs.materials.model</field>
|
<field name="model">sf.materials.model</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="材料型号">
|
<form string="材料型号">
|
||||||
<group>
|
<group>
|
||||||
@@ -132,8 +131,8 @@
|
|||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.view" id="mrs_materials_model_tree">
|
<record model="ir.ui.view" id="sf_materials_model_tree">
|
||||||
<field name="model">mrs.materials.model</field>
|
<field name="model">sf.materials.model</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="材料型号">
|
<tree string="材料型号">
|
||||||
<field name="materials_no"/>
|
<field name="materials_no"/>
|
||||||
@@ -144,9 +143,9 @@
|
|||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.view" id="search_mrs_materials_model_type_view">
|
<record model="ir.ui.view" id="search_sf_materials_model_type_view">
|
||||||
<field name="name">search.mrs.materials.model.type</field>
|
<field name="name">search.sf.materials.model.type</field>
|
||||||
<field name="model">mrs.materials.model</field>
|
<field name="model">sf.materials.model</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="name" string="型号名搜索" filter_domain="[('name','ilike',self)]"/>
|
<field name="name" string="型号名搜索" filter_domain="[('name','ilike',self)]"/>
|
||||||
@@ -159,8 +158,8 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<!--材料-->
|
<!--材料-->
|
||||||
<record model="ir.ui.view" id="mrs_production_materials_form">
|
<record model="ir.ui.view" id="sf_production_materials_form">
|
||||||
<field name="model">mrs.production.materials</field>
|
<field name="model">sf.production.materials</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="材料">
|
<form string="材料">
|
||||||
|
|
||||||
@@ -189,8 +188,8 @@
|
|||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.view" id="mrs_production_materials_tree">
|
<record model="ir.ui.view" id="sf_production_materials_tree">
|
||||||
<field name="model">mrs.production.materials</field>
|
<field name="model">sf.production.materials</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="材料">
|
<tree string="材料">
|
||||||
<field name="materials_no" readonly="1"/>
|
<field name="materials_no" readonly="1"/>
|
||||||
@@ -199,9 +198,9 @@
|
|||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.view" id="search_mrs_production_materials_view">
|
<record model="ir.ui.view" id="search_sf_production_materials_view">
|
||||||
<field name="name">search.mrs.production.materials.type</field>
|
<field name="name">search.sf.production.materials.type</field>
|
||||||
<field name="model">mrs.production.materials</field>
|
<field name="model">sf.production.materials</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||||
@@ -210,8 +209,8 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- <record model="ir.ui.view" id="mrs_production_materials_form">-->
|
<!-- <record model="ir.ui.view" id="sf_production_materials_form">-->
|
||||||
<!-- <field name="model">mrs.production.materials</field>-->
|
<!-- <field name="model">sf.production.materials</field>-->
|
||||||
<!-- <field name="arch" type="xml">-->
|
<!-- <field name="arch" type="xml">-->
|
||||||
<!-- <form string="材料">-->
|
<!-- <form string="材料">-->
|
||||||
|
|
||||||
@@ -230,10 +229,10 @@
|
|||||||
<!-- </field>-->
|
<!-- </field>-->
|
||||||
<!-- </record>-->
|
<!-- </record>-->
|
||||||
|
|
||||||
<record id="mrs_production_materials" model="ir.actions.act_window">
|
<record id="sf_production_materials" model="ir.actions.act_window">
|
||||||
<field name="name">材料</field>
|
<field name="name">材料</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrs.production.materials</field>
|
<field name="res_model">sf.production.materials</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@@ -241,10 +240,10 @@
|
|||||||
</p>
|
</p>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="mrs_production_process" model="ir.actions.act_window">
|
<record id="sf_production_process" model="ir.actions.act_window">
|
||||||
<field name="name">表面工艺</field>
|
<field name="name">表面工艺</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrs.production.process</field>
|
<field name="res_model">sf.production.process</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@@ -252,10 +251,10 @@
|
|||||||
</p>
|
</p>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="mrs_materials_model" model="ir.actions.act_window">
|
<record id="sf_materials_model" model="ir.actions.act_window">
|
||||||
<field name="name">材料型号</field>
|
<field name="name">材料型号</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrs.materials.model</field>
|
<field name="res_model">sf.materials.model</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@@ -263,10 +262,10 @@
|
|||||||
</p>
|
</p>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="mrs_processing_technology" model="ir.actions.act_window">
|
<record id="sf_processing_technology" model="ir.actions.act_window">
|
||||||
<field name="name">加工工艺</field>
|
<field name="name">加工工艺</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrs.processing.technology</field>
|
<field name="res_model">sf.processing.technology</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
|
|
||||||
@@ -320,10 +319,10 @@
|
|||||||
<field name="name">sf.tray.form</field>
|
<field name="name">sf.tray.form</field>
|
||||||
<field name="model">sf.tray</field>
|
<field name="model">sf.tray</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<header>
|
|
||||||
<field name='state' widget="radio" options="{'horizontal': True}"/>
|
|
||||||
</header>
|
|
||||||
<form string="托盘">
|
<form string="托盘">
|
||||||
|
<header>
|
||||||
|
<field name='state' widget="radio" options="{'horizontal': True}"/>
|
||||||
|
</header>
|
||||||
<group string="基本信息" name="group1">
|
<group string="基本信息" name="group1">
|
||||||
<group>
|
<group>
|
||||||
<field name="code" required="1"/>
|
<field name="code" required="1"/>
|
||||||
@@ -335,8 +334,5 @@
|
|||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
action="action_mrp_configuration"
|
action="action_mrp_configuration"
|
||||||
groups="base.group_system"/>-->
|
groups="base.group_system"/>-->
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_machine_tool"
|
id="menu_sf_machine_tool"
|
||||||
parent="mrp.menu_mrp_configuration"
|
parent="mrp.menu_mrp_configuration"
|
||||||
name="机床"
|
name="机床"
|
||||||
sequence="1"
|
sequence="1"
|
||||||
action="action_mrs_machine_tool"
|
action="action_sf_machine_tool"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
@@ -34,13 +34,13 @@
|
|||||||
<menuitem
|
<menuitem
|
||||||
sequence="2"
|
sequence="2"
|
||||||
name="基础数据"
|
name="基础数据"
|
||||||
id="menu_mrs_base"
|
id="menu_sf_base"
|
||||||
action="mrs_production_materials"
|
action="sf_production_materials"
|
||||||
parent="mrp.menu_mrp_configuration"
|
parent="mrp.menu_mrp_configuration"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_production_materials_1"
|
id="menu_sf_production_materials_1"
|
||||||
name="原材料"
|
name="原材料"
|
||||||
parent="mrp.menu_mrp_configuration"
|
parent="mrp.menu_mrp_configuration"
|
||||||
sequence="3"
|
sequence="3"
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_production_process_1"
|
id="menu_sf_production_process_1"
|
||||||
name="工艺"
|
name="工艺"
|
||||||
parent="mrp.menu_mrp_configuration"
|
parent="mrp.menu_mrp_configuration"
|
||||||
sequence="4"
|
sequence="4"
|
||||||
@@ -56,101 +56,90 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_production_process"
|
id="menu_sf_production_process"
|
||||||
name="表面工艺"
|
name="表面工艺"
|
||||||
parent="menu_mrs_production_process_1"
|
parent="menu_sf_production_process_1"
|
||||||
sequence="1"
|
sequence="1"
|
||||||
action="mrs_production_process"
|
action="sf_production_process"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_production_materials"
|
id="menu_sf_production_materials"
|
||||||
name="材料"
|
name="材料"
|
||||||
parent="menu_mrs_production_materials_1"
|
parent="menu_sf_production_materials_1"
|
||||||
sequence="1"
|
sequence="1"
|
||||||
action="mrs_production_materials"
|
action="sf_production_materials"
|
||||||
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_materials_model"
|
id="menu_sf_materials_model"
|
||||||
name="材料型号"
|
name="材料型号"
|
||||||
parent="menu_mrs_production_materials_1"
|
parent="menu_sf_production_materials_1"
|
||||||
sequence="1"
|
sequence="1"
|
||||||
action="mrs_materials_model"
|
action="sf_materials_model"
|
||||||
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_processing_technology"
|
id="menu_sf_processing_technology"
|
||||||
name="加工工艺"
|
name="加工工艺"
|
||||||
parent="menu_mrs_production_process_1"
|
parent="menu_sf_production_process_1"
|
||||||
sequence="1"
|
sequence="1"
|
||||||
action="mrs_processing_technology"/>
|
action="sf_processing_technology"/>
|
||||||
|
|
||||||
<!-- <menuitem-->
|
<!-- <menuitem-->
|
||||||
<!-- id="menu_sf_partner_views"-->
|
<!-- id="menu_sf_partner_views"-->
|
||||||
<!-- name="工厂token"-->
|
<!-- name="工厂token"-->
|
||||||
<!-- parent="menu_mrs_base"-->
|
<!-- parent="menu_sf_base"-->
|
||||||
<!-- sequence="1"-->
|
<!-- sequence="1"-->
|
||||||
<!-- action="token_factory_view"-->
|
<!-- action="token_factory_view"-->
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
|
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_machine_brand"
|
id="menu_sf_machine_brand"
|
||||||
parent="menu_mrs_base"
|
parent="menu_sf_base"
|
||||||
name="品牌"
|
name="品牌"
|
||||||
sequence="1"
|
sequence="1"
|
||||||
action="action_mrs_machine_brand"/>
|
action="action_sf_machine_brand"/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_machine_tool_type"
|
id="menu_sf_machine_tool_type"
|
||||||
parent="menu_mrs_base"
|
parent="menu_sf_base"
|
||||||
name="机床型号"
|
name="机床型号"
|
||||||
sequence="1"
|
sequence="1"
|
||||||
action="action_mrs_machine_tool_type"/>
|
action="action_sf_machine_tool_type"/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_cutting_tool"
|
id="menu_sf_cutting_tool"
|
||||||
parent="mrp.menu_mrp_configuration"
|
parent="mrp.menu_mrp_configuration"
|
||||||
name="刀具"
|
name="刀具"
|
||||||
sequence="5"/>
|
sequence="5"/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_cutting_tool_category"
|
id="menu_sf_cutting_tool_category"
|
||||||
parent="menu_mrs_cutting_tool"
|
parent="menu_sf_cutting_tool"
|
||||||
name="刀具类别"
|
name="刀具类别"
|
||||||
sequence="1"
|
sequence="1"
|
||||||
action="action_mrs_cutting_tool_category"/>
|
action="action_sf_cutting_tool_category"/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_cutting_tool_type"
|
id="menu_sf_cutting_tool_type"
|
||||||
parent="menu_mrs_cutting_tool"
|
parent="menu_sf_cutting_tool"
|
||||||
name="刀具型号"
|
name="刀具型号"
|
||||||
sequence="1"
|
sequence="1"
|
||||||
action="action_mrs_cutting_tool_type"/>
|
action="action_sf_cutting_tool_type"/>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_mrs_machine_control_system"
|
id="menu_sf_machine_control_system"
|
||||||
parent="menu_mrs_base"
|
parent="menu_sf_base"
|
||||||
name="控制系统"
|
name="控制系统"
|
||||||
sequence="1"
|
sequence="1"
|
||||||
action="action_mrs_machine_control_system"/>
|
action="action_sf_machine_control_system"/>
|
||||||
|
|
||||||
|
|
||||||
<menuitem
|
|
||||||
id="menu_sf_model_type"
|
|
||||||
name="模型类型"
|
|
||||||
parent="mrp.menu_mrp_configuration"
|
|
||||||
sequence="10"
|
|
||||||
action="action_sf_model_type"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<record model="ir.ui.view" id="view_product_template_form_inherit_sf">
|
|
||||||
<field name="name">product.template.form.inherit.sf</field>
|
|
||||||
<field name="model">product.template</field>
|
|
||||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<xpath expr="//page[last()]" position="after">
|
|
||||||
<page string="加工参数">
|
|
||||||
<group>
|
|
||||||
<group string="模型">
|
|
||||||
<field name="model_long" string="长[mm]"/>
|
|
||||||
<field name="model_width" string="宽[mm]"/>
|
|
||||||
<field name="model_height" string="高[mm]"/>
|
|
||||||
<field name="model_volume" string="体积[mm]"/>
|
|
||||||
<field name="model_type_id" string="模板类型"/>
|
|
||||||
<field name="model_processing_panel" placeholder="例如A,B" string="加工面板"/>
|
|
||||||
<field name="model_precision" string="精度要求"/>
|
|
||||||
<field name="model_materials_id" string="材料"/>
|
|
||||||
<field name="model_materials_type_id" string="型号"
|
|
||||||
domain="[('materials_id', '=', model_materials_id)]"/>
|
|
||||||
</group>
|
|
||||||
<group string="胚料">
|
|
||||||
<field name="embryo_long" string="长[mm]"/>
|
|
||||||
<field name="embryo_width" string="宽[mm]"/>
|
|
||||||
<field name="embryo_height" string="高[mm]"/>
|
|
||||||
<field name="volume" string="体积[mm³]"/>
|
|
||||||
<field name="embryo_materials_id" string="材料"/>
|
|
||||||
<field name="embryo_materials_type_id" string="型号"
|
|
||||||
domain="[('materials_id', '=',embryo_materials_id)]"/>
|
|
||||||
</group>
|
|
||||||
</group>
|
|
||||||
</page>
|
|
||||||
</xpath>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="view_product_category_form_inherit_sf" model="ir.ui.view">
|
|
||||||
<field name="name">product.category.form.inherit.sf</field>
|
|
||||||
<field name="model">product.category</field>
|
|
||||||
<field name="inherit_id" ref="product.product_category_form_view"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="parent_id" position="before">
|
|
||||||
<field name="is_embryo"/>
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@@ -1 +1,4 @@
|
|||||||
# -*-coding:utf-8-*-
|
# -*-coding:utf-8-*-
|
||||||
|
from . import controllers
|
||||||
|
from . import models
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
{
|
{
|
||||||
'name': '机企猫智能工厂 同步模块',
|
'name': '机企猫智能工厂 连接业务平台模块',
|
||||||
'version': '1.0',
|
'version': '1.0',
|
||||||
'summary': '智能工厂同步模块',
|
'summary': '连接业务平台模块',
|
||||||
'sequence': 1,
|
'sequence': 1,
|
||||||
'description': """
|
'description': """
|
||||||
在本模块,同步资源库
|
在本模块,接收业务平台的模块
|
||||||
""",
|
""",
|
||||||
'category': 'YZ',
|
'category': 'YZ',
|
||||||
'website': 'https://www.sf.cs.jikimo.com',
|
'website': 'https://www.sf.cs.jikimo.com',
|
||||||
'depends': ['account', 'sf_base', 'base', 'sale'],
|
'depends': ['sf_base'],
|
||||||
'data': [
|
'data': [
|
||||||
# 'views/sale_process_order_view.xml'
|
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
from .import controllers
|
from .import controllers
|
||||||
|
|
||||||
|
|||||||
@@ -4,29 +4,38 @@ import logging
|
|||||||
from datetime import date, timedelta
|
from datetime import date, timedelta
|
||||||
from odoo import http
|
from odoo import http
|
||||||
from odoo.http import request
|
from odoo.http import request
|
||||||
from odoo.addons.mrs_gateway_api.models.common import Common
|
|
||||||
from odoo.addons.mrs_gateway_api.models.basicdata_str import BasicDataStr
|
|
||||||
|
|
||||||
|
|
||||||
class Sf_Bf_Connect(http.Controller):
|
class Sf_Bf_Connect(http.Controller):
|
||||||
|
|
||||||
@http.route('/api/bfm_process_order/list', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
@http.route('/api/bfm_process_order/list', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def get_bfm_process_order_list(self, **kw):
|
def get_bfm_process_order_list(self, **kw):
|
||||||
"""
|
"""
|
||||||
获取业务平台传送来的业务平台订单
|
获取业务平台传送来的订单
|
||||||
:param kw:
|
:param kw:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
result = json.loads('bfm_process_order_list')
|
res = {'status': 1, 'factory_order_no': ''}
|
||||||
for item in result:
|
logging.info('get_bfm_process_order_list:%s' % kw)
|
||||||
self.env['mrs.production.process'].create({
|
try:
|
||||||
"id": item['id'],
|
datas = request.httprequest.data
|
||||||
"model_file": item['model_file'],
|
ret = json.loads(datas)
|
||||||
"model_name": item['model_name'],
|
ret = json.loads(ret['result'])
|
||||||
"type": item['type'],
|
product_id = request.env.ref('sf_bpm_api.product_template_sf').sudo()
|
||||||
"surface_technics": item['surface_technics'],
|
company_id = request.env.ref('base.main_company').sudo()
|
||||||
"unit_price": item['unit_price'],
|
order_id = request.env['sale.order'].with_user(request.env.ref("base.user_admin")).sale_order_create(ret['delivery_end_date'], company_id)
|
||||||
"amount": item['amount'],
|
i = 1
|
||||||
"money": item['money']
|
for item in ret['bfm_process_order_list']:
|
||||||
})
|
product = request.env['product.template'].sudo().product_create(product_id, item, order_id,
|
||||||
|
ret['order_number'], i)
|
||||||
|
order_id.with_user(request.env.ref("base.user_admin")).sale_order_create_line(product, item)
|
||||||
|
bom = request.env['mrp.bom'].with_user(request.env.ref("base.user_admin")).bom_create(product)
|
||||||
|
bom.with_user(request.env.ref("base.user_admin")).bom_create_Line(product)
|
||||||
|
i += 1
|
||||||
|
res['factory_order_no'] = order_id.name
|
||||||
|
return json.JSONEncoder().encode(res)
|
||||||
|
except Exception as e:
|
||||||
|
logging.info('get_bfm_process_order_list error:%s' % e)
|
||||||
|
res['status'] = -1
|
||||||
|
return json.JSONEncoder().encode(res)
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
from . import sf_process_order
|
from . import http
|
||||||
|
from . import models
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
from odoo import models,fields
|
|
||||||
from odoo.exceptions import ValidationError
|
|
||||||
|
|
||||||
|
|
||||||
class bfmOrderLine(models.Model):
|
|
||||||
_name = 'sf.bfm.order.line'
|
|
||||||
_description = '业务平台订单'
|
|
||||||
|
|
||||||
model_file = fields.Binary('模型文件', attachment=False)
|
|
||||||
model_name = fields.char('模型名称')
|
|
||||||
type = fields.Many2one('mrs.materials.model', '型号')
|
|
||||||
surface_technics = fields.Many2one('mrs.production.process', string='表面工艺')
|
|
||||||
# technological_parameter = fields.Many2one('',string='工艺参数')
|
|
||||||
unit_price = fields.Float('单价')
|
|
||||||
amount = fields.Integer('数量')
|
|
||||||
money = fields.Float('金额')
|
|
||||||
|
|
||||||
|
|
||||||
class sale(models.Model):
|
|
||||||
_inherit = 'sale.order'
|
|
||||||
|
|
||||||
bfm_process_order_ids = fields.Many2one('sf.bfm.order.line', string='业务平台订单')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<!-- <record model="ir.ui.view" id="view_sf_form_inherit">-->
|
|
||||||
<!-- <field name="model">sale.order</field>-->
|
|
||||||
<!-- <field name="inherit_id" ref="sale.view_order_form"/>-->
|
|
||||||
<!-- <field name="arch" type="xml">-->
|
|
||||||
<!--<!– <xpath expr="//page[@name='Customer Signature']" position="before">–>-->
|
|
||||||
<!--<!– <page string="Bfm Line">–>-->
|
|
||||||
<!--<!– <group>–>-->
|
|
||||||
<!--<!– <field name="bfm_process_order_ids"/>–>-->
|
|
||||||
<!--<!– </group>–>-->
|
|
||||||
<!--<!– </page>–>-->
|
|
||||||
<!--<!– </xpath>–>-->
|
|
||||||
<!-- </field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# -*-coding:utf-8-*-
|
|
||||||
from . import controllers
|
|
||||||
from . import models
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
from .import controllers
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
import json
|
|
||||||
import logging
|
|
||||||
from datetime import date, timedelta
|
|
||||||
from odoo import http
|
|
||||||
from odoo.http import request
|
|
||||||
|
|
||||||
|
|
||||||
class Sf_Bf_Connect(http.Controller):
|
|
||||||
|
|
||||||
@http.route('/api/bfm_process_order/list', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
|
||||||
cors="*")
|
|
||||||
def get_bfm_process_order_list(self, **kw):
|
|
||||||
"""
|
|
||||||
获取业务平台传送来的订单
|
|
||||||
:param kw:
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
res = {'status': 1, 'factory_order_no': ''}
|
|
||||||
logging.info('get_bfm_process_order_list:%s' % kw)
|
|
||||||
try:
|
|
||||||
datas = request.httprequest.data
|
|
||||||
ret = json.loads(datas)
|
|
||||||
ret = json.loads(ret['result'])
|
|
||||||
product_id = request.env.ref('sf_bpm_api.product_template_sf').sudo()
|
|
||||||
company_id = request.env.ref('base.main_company').sudo()
|
|
||||||
order_id = request.env['sale.order'].with_user(request.env.ref("base.user_admin")).sale_order_create(ret['delivery_end_date'], company_id)
|
|
||||||
i = 1
|
|
||||||
for item in ret['bfm_process_order_list']:
|
|
||||||
product = request.env['product.template'].sudo().product_create(product_id, item, order_id,
|
|
||||||
ret['order_number'], i)
|
|
||||||
order_id.with_user(request.env.ref("base.user_admin")).sale_order_create_line(product, item)
|
|
||||||
bom = request.env['mrp.bom'].with_user(request.env.ref("base.user_admin")).bom_create(product)
|
|
||||||
bom.with_user(request.env.ref("base.user_admin")).bom_create_Line(product)
|
|
||||||
i += 1
|
|
||||||
res['factory_order_no'] = order_id.name
|
|
||||||
return json.JSONEncoder().encode(res)
|
|
||||||
except Exception as e:
|
|
||||||
logging.info('get_bfm_process_order_list error:%s' % e)
|
|
||||||
res['status'] = -1
|
|
||||||
return json.JSONEncoder().encode(res)
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<record id="product_template_sf" model="product.product">
|
|
||||||
<field name="name">CNC加工产品模板</field>
|
|
||||||
<field name="categ_id" ref="product.product_category_5"/>
|
|
||||||
<field name="invoice_policy">delivery</field>
|
|
||||||
<field name="detailed_type">product</field>
|
|
||||||
<field name="purchase_ok">false</field>
|
|
||||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
|
||||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
|
||||||
<field name="company_id" ref="base.main_company"/>
|
|
||||||
<field name="active">false</field>
|
|
||||||
</record>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,2 +1 @@
|
|||||||
# -*-coding:utf-8-*-
|
|
||||||
from . import models
|
from . import models
|
||||||
@@ -1,18 +1,19 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
{
|
{
|
||||||
'name': '机企猫智能工厂 API模块',
|
'name': '机企猫智能工厂 产品模块',
|
||||||
'version': '1.0',
|
'version': '1.0',
|
||||||
'summary': '智能工厂API模块',
|
'summary': '智能工厂产品模块',
|
||||||
'sequence': 1,
|
'sequence': 1,
|
||||||
'description': """
|
'description': """
|
||||||
在本模块,接收业务平台订单
|
在本模块,为业务平台传过来的订单信息
|
||||||
""",
|
""",
|
||||||
'category': 'sf',
|
'category': 'sf',
|
||||||
'website': 'https://www.sf.cs.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['sale', 'sf_base'],
|
'depends': ['product', 'base'],
|
||||||
'data': [
|
'data': [
|
||||||
|
'data/product_data.xml',
|
||||||
|
'views/product_template_view.xml'
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
],
|
],
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data noupdate="0">
|
||||||
<record id="product_template_sf" model="product.product">
|
<record id="product_template_sf" model="product.product">
|
||||||
<field name="name">CNC加工产品模板</field>
|
<field name="name">CNC加工产品模板</field>
|
||||||
<field name="categ_id" ref="product.product_category_5"/>
|
<field name="categ_id" ref="product.product_category_5"/>
|
||||||
<field name="invoice_policy">delivery</field>
|
<field name="invoice_policy">delivery</field>
|
||||||
3
sf_dlm/models/__init__.py
Normal file
3
sf_dlm/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from. import product_template
|
||||||
|
|
||||||
|
|
||||||
@@ -9,43 +9,27 @@ class ResProductTemplate(models.Model):
|
|||||||
model_long = fields.Float('模型长[mm]', digits=(16, 3))
|
model_long = fields.Float('模型长[mm]', digits=(16, 3))
|
||||||
model_width = fields.Float('模型宽[mm]', digits=(16, 3))
|
model_width = fields.Float('模型宽[mm]', digits=(16, 3))
|
||||||
model_height = fields.Float('模型高[mm]', digits=(16, 3))
|
model_height = fields.Float('模型高[mm]', digits=(16, 3))
|
||||||
model_volume = fields.Float('模型体积[mm³]', digits=(16, 3), compute='_compute_model_volume', store=True)
|
model_volume = fields.Float('模型体积[mm³]', digits=(16, 3))
|
||||||
model_precision = fields.Float('精度要求', digits=(16, 3))
|
model_precision = fields.Float('精度要求', digits=(16, 3))
|
||||||
model_materials_id = fields.Many2one('mrs.production.materials', string='模型材料')
|
|
||||||
model_materials_type_id = fields.Many2one('mrs.materials.model', string='模型材料型号')
|
|
||||||
model_type_id = fields.Many2one('sf.model.type', string='模型类型')
|
model_type_id = fields.Many2one('sf.model.type', string='模型类型')
|
||||||
model_processing_panel = fields.Char('模型加工面板')
|
model_processing_panel = fields.Char('模型加工面板')
|
||||||
model_surface_process_id = fields.Many2one('mrs.production.process', string='表面工艺')
|
model_surface_process_id = fields.Many2one('sf.production.process', string='表面工艺')
|
||||||
model_process_parameters_id = fields.Many2one('mrs.processing.technology', string='工艺参数')
|
model_process_parameters_id = fields.Many2one('sf.processing.technology', string='工艺参数')
|
||||||
# price = fields.Float('单价', digits=(16, 3))
|
model_price = fields.Float('模型单价', digits=(16, 3))
|
||||||
# number = fields.Integer('数量', default=1)
|
model_total_amount = fields.Float('模型金额', digits=(16, 3))
|
||||||
# total_amount = fields.Float('金额', digits=(16, 3), compute='_compute_total_amount')
|
model_number = fields.Integer('模型数量', default=1)
|
||||||
# model_number =
|
model_remark = fields.Char('模型备注说明')
|
||||||
|
|
||||||
|
|
||||||
# 胚料的长,宽,高
|
|
||||||
embryo_long = fields.Float('胚料长[mm]', digits=(16, 3), onchange='count_embryo_size')
|
|
||||||
embryo_width = fields.Float('胚料宽[mm]', digits=(16, 3), onchange='count_embryo_size')
|
|
||||||
embryo_height = fields.Float('胚料高[mm]', digits=(16, 3), onchange='count_embryo_size')
|
|
||||||
embryo_materials_id = fields.Many2one('mrs.production.materials', string='胚料材料')
|
|
||||||
embryo_materials_type_id = fields.Many2one('mrs.materials.model', string='胚料材料型号')
|
|
||||||
|
|
||||||
long = fields.Float('长[mm]', digits=(16, 3), onchange='add_product_size')
|
long = fields.Float('长[mm]', digits=(16, 3), onchange='add_product_size')
|
||||||
width = fields.Float('宽[mm]', digits=(16, 3), onchange='add_product_size')
|
width = fields.Float('宽[mm]', digits=(16, 3), onchange='add_product_size')
|
||||||
height = fields.Float('高[mm]', digits=(16, 3), onchange='add_product_size')
|
height = fields.Float('高[mm]', digits=(16, 3), onchange='add_product_size')
|
||||||
materials_id = fields.Many2one('mrs.production.materials', string='材料')
|
materials_id = fields.Many2one('sf.production.materials', string='材料')
|
||||||
materials_type_id = fields.Many2one('mrs.materials.model', string='材料型号')
|
materials_type_id = fields.Many2one('sf.materials.model', string='材料型号')
|
||||||
|
|
||||||
|
|
||||||
volume = fields.Float(compute='_compute_volume', store=True)
|
volume = fields.Float(compute='_compute_volume', store=True)
|
||||||
|
single_manufacturing = fields.Boolean(string="单个制造")
|
||||||
|
|
||||||
@api.depends('embryo_long', 'embryo_width', 'embryo_height')
|
@api.depends('long', 'width', 'height')
|
||||||
def _compute_volume(self):
|
def _compute_volume(self):
|
||||||
self.volume = self.embryo_long * self.embryo_width * self.embryo_height
|
self.volume = self.long * self.width * self.height
|
||||||
|
|
||||||
@api.depends('model_long', 'model_width', 'model_height')
|
|
||||||
def _compute_model_volume(self):
|
|
||||||
self.model_volume = self.model_long * self.model_width * self.model_height
|
|
||||||
|
|
||||||
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品
|
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品
|
||||||
def product_create(self, product_id, item, order_id, order_number, i):
|
def product_create(self, product_id, item, order_id, order_number, i):
|
||||||
@@ -57,16 +41,19 @@ class ResProductTemplate(models.Model):
|
|||||||
'model_width': item['model_width'],
|
'model_width': item['model_width'],
|
||||||
'model_height': item['model_height'],
|
'model_height': item['model_height'],
|
||||||
'model_volume': item['model_volume'],
|
'model_volume': item['model_volume'],
|
||||||
|
'model_price': item['price'],
|
||||||
|
'model_total_amount': item['total_amount'],
|
||||||
|
'model_number': item['number'],
|
||||||
'list_price': item['price'],
|
'list_price': item['price'],
|
||||||
'model_materials_id': self.env['mrs.production.materials'].search(
|
'materials_id': self.env['sf.production.materials'].search(
|
||||||
[('materials_no', '=', item['texture_code'])]).id,
|
[('materials_no', '=', item['texture_code'])]).id,
|
||||||
'model_materials_type_id': self.env['mrs.materials.model'].search(
|
'materials_type_id': self.env['sf.materials.model'].search(
|
||||||
[('materials_no', '=', item['texture_type_code'])]).id,
|
[('materials_no', '=', item['texture_type_code'])]).id,
|
||||||
'model_surface_process_id': self.env['mrs.production.process'].search(
|
# 'model_surface_process_id': self.env['mrs.production.process'].search(
|
||||||
[('process_encode', '=', item['surface_process_code'])]).id,
|
# [('process_encode', '=', item['surface_process_code'])]).id,
|
||||||
'model_process_parameters_id': self.env['mrs.processing.technology'].search(
|
# 'model_process_parameters_id': self.env['mrs.processing.technology'].search(
|
||||||
[('process_encode', '=', item['process_parameters_code'])]).id,
|
# [('process_encode', '=', item['process_parameters_code'])]).id,
|
||||||
''
|
'model_remark': item['remark'],
|
||||||
'default_code': '%s-%s' % (order_number, i),
|
'default_code': '%s-%s' % (order_number, i),
|
||||||
'barcode': item['barcode'],
|
'barcode': item['barcode'],
|
||||||
'active': True
|
'active': True
|
||||||
@@ -74,26 +61,6 @@ class ResProductTemplate(models.Model):
|
|||||||
copy_product_id.sudo().write(vals)
|
copy_product_id.sudo().write(vals)
|
||||||
return copy_product_id
|
return copy_product_id
|
||||||
|
|
||||||
|
|
||||||
# 在产品上增加模型类型和加工的面(例如:A、B) ,
|
|
||||||
# 并根据模型类型计算出产品的胚料尺寸;
|
|
||||||
@api.onchange('model_type_id')
|
|
||||||
def count_embryo_size(self):
|
|
||||||
if not self.model_type_id:
|
|
||||||
return
|
|
||||||
bom = self.env['product.product'].search(
|
|
||||||
[('categ_id.is_embryo', '=', True), ('product_tmpl_id', '=', self.id)],
|
|
||||||
limit=1,
|
|
||||||
order='volume desc'
|
|
||||||
)
|
|
||||||
for item in self:
|
|
||||||
item.embryo_long = bom.embryo_long + 1
|
|
||||||
item.embryo_width = bom.embryo_width + 1
|
|
||||||
item.embryo_height = bom.embryo_height + 1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 根据模型类型默认给模型的长高宽加配置的长度;
|
# 根据模型类型默认给模型的长高宽加配置的长度;
|
||||||
@api.onchange('model_type_id')
|
@api.onchange('model_type_id')
|
||||||
def add_product_size(self):
|
def add_product_size(self):
|
||||||
@@ -113,13 +80,6 @@ class ResProductTemplate(models.Model):
|
|||||||
item.model_height = item.model_width + model_type.embryo_tolerance
|
item.model_height = item.model_width + model_type.embryo_tolerance
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ResProductCategory(models.Model):
|
|
||||||
_inherit = "product.category"
|
|
||||||
|
|
||||||
is_embryo = fields.Boolean('胚料')
|
|
||||||
|
|
||||||
|
|
||||||
class ResMrpBom(models.Model):
|
class ResMrpBom(models.Model):
|
||||||
_inherit = 'mrp.bom'
|
_inherit = 'mrp.bom'
|
||||||
|
|
||||||
@@ -140,9 +100,9 @@ class ResMrpBom(models.Model):
|
|||||||
# 四、如果匹配成功多个胚料,则选取体积最小的胚料;
|
# 四、如果匹配成功多个胚料,则选取体积最小的胚料;
|
||||||
def bom_create_Line(self, product):
|
def bom_create_Line(self, product):
|
||||||
embryo = self.env['product.product'].search(
|
embryo = self.env['product.product'].search(
|
||||||
[('categ_id.is_embryo', '=', True), ('embryo_materials_type_id', '=', product.model_materials_type_id.id),
|
[('categ_id.is_embryo', '=', True), ('materials_type_id', '=', product.materials_type_id.id),
|
||||||
('embryo_long', '>', product.model_long), ('embryo_width', '>', product.model_width),
|
('long', '>', product.long), ('width', '>', product.width),
|
||||||
('embryo_height', '>', product.model_height)
|
('height', '>', product.height)
|
||||||
],
|
],
|
||||||
limit=1,
|
limit=1,
|
||||||
order='volume desc'
|
order='volume desc'
|
||||||
@@ -155,3 +115,9 @@ class ResMrpBom(models.Model):
|
|||||||
'product_uom_id': 1
|
'product_uom_id': 1
|
||||||
}
|
}
|
||||||
return self.env['mrp.bom.line'].create(vals)
|
return self.env['mrp.bom.line'].create(vals)
|
||||||
|
|
||||||
|
|
||||||
|
class ResProductCategory(models.Model):
|
||||||
|
_inherit = "product.category"
|
||||||
|
|
||||||
|
is_embryo = fields.Boolean('胚料')
|
||||||
101
sf_dlm/views/product_template_view.xml
Normal file
101
sf_dlm/views/product_template_view.xml
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record model="ir.ui.view" id="view_product_template_form_inherit_sf">
|
||||||
|
<field name="name">product.template.form.inherit.sf</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="invoice_policy" position="after">
|
||||||
|
<field name="materials_id" string="材料"/>
|
||||||
|
<field name="materials_type_id" string="型号"
|
||||||
|
domain="[('materials_id', '=', materials_id)]"/>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<xpath expr="//label[@for='volume']" position="before">
|
||||||
|
<label for="long" string="尺寸"
|
||||||
|
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
|
||||||
|
<div class="o_address_format"
|
||||||
|
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}">
|
||||||
|
<label for="long" string="长"/>
|
||||||
|
<field name="long" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="width" string="宽"/>
|
||||||
|
<field name="width" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="height" string="高"/>
|
||||||
|
<field name="height" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//page[last()]" position="after">
|
||||||
|
<page string="加工参数">
|
||||||
|
<group string="模型">
|
||||||
|
<field name="model_long" string="长[mm]"/>
|
||||||
|
<field name="model_width" string="宽[mm]"/>
|
||||||
|
<field name="model_height" string="高[mm]"/>
|
||||||
|
<field name="model_volume" string="体积[mm]"/>
|
||||||
|
<field name="model_type_id" string="模板类型"/>
|
||||||
|
<field name="model_processing_panel" placeholder="例如A,B" string="加工面板"/>
|
||||||
|
<field name="model_precision" string="精度要求"/>
|
||||||
|
<field name="model_surface_process_id" string="表面工艺"/>
|
||||||
|
<field name="model_process_parameters_id" string="工艺参数"
|
||||||
|
domain="[('processing_order_ids', '=', model_surface_process_id)]"/>
|
||||||
|
<field name="model_price" string="单价"/>
|
||||||
|
<field name="model_total_amount" string="金额"/>
|
||||||
|
<field name="model_number" string="数量"/>
|
||||||
|
<field name="model_remark" string="备注说明"/>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_product_category_form_inherit_sf" model="ir.ui.view">
|
||||||
|
<field name="name">product.category.form.inherit.sf</field>
|
||||||
|
<field name="model">product.category</field>
|
||||||
|
<field name="inherit_id" ref="product.product_category_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="parent_id" position="before">
|
||||||
|
<field name="is_embryo"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_template_property_form" model="ir.ui.view">
|
||||||
|
<field name="name">product.template.stock.property.form.inherit</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//group[@name='operations']" position="inside">
|
||||||
|
<group>
|
||||||
|
</group>
|
||||||
|
<group string="订单规则">
|
||||||
|
<field name="single_manufacturing" string="单个制造" widget="checkbox"/>
|
||||||
|
</group>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<page name="inventory" position="inside">
|
||||||
|
<group>
|
||||||
|
<group string="Description for Receipts">
|
||||||
|
<field name="description_pickingin" nolabel="1"
|
||||||
|
placeholder="This note is added to receipt orders (e.g. where to store the product in the warehouse)."/>
|
||||||
|
</group>
|
||||||
|
<group string="Description for Delivery Orders">
|
||||||
|
<field name="description_pickingout" nolabel="1"
|
||||||
|
placeholder="This note is added to delivery orders."/>
|
||||||
|
</group>
|
||||||
|
<group string="Description for Internal Transfers" groups="stock.group_stock_multi_locations">
|
||||||
|
<field name="description_picking"
|
||||||
|
placeholder="This note is added to internal transfer orders (e.g. where to pick the product in the warehouse)."
|
||||||
|
nolabel="1"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
|
<page name="inventory" position="attributes">
|
||||||
|
<attribute name="groups">stock.group_stock_user,product.group_stock_packaging</attribute>
|
||||||
|
</page>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@@ -10,13 +10,17 @@
|
|||||||
""",
|
""",
|
||||||
'category': '',
|
'category': '',
|
||||||
'website': 'https://www.sf.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['mrp', 'sf_base', 'sf_route_workcenter'],
|
'depends': ['mrp', 'sf_base', 'maintenance'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/sf_production.xml',
|
'security/group_security.xml',
|
||||||
'views/mrp_routing_workcenter_view.xml'
|
'security/ir.model.access.csv',
|
||||||
|
'views/mrp_maintenance_views.xml',
|
||||||
|
'views/mrp_routing_workcenter_view.xml',
|
||||||
|
'views/mrp_workcenter_views.xml',
|
||||||
|
'views/mrp_workorder_view.xml',
|
||||||
|
'views/tray_view.xml',
|
||||||
|
'views/model_type_view.xml',
|
||||||
|
'report/tray_report.xml'
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
from . import sf_production
|
from . import tray
|
||||||
|
from . import mrp_production
|
||||||
|
from . import mrp_workcenter
|
||||||
|
from . import mrp_maintenance
|
||||||
|
from . import mrp_routing_workcenter
|
||||||
from . import mrp_workorder
|
from . import mrp_workorder
|
||||||
|
from . import model_type
|
||||||
|
from . import stock
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
33
sf_manufacturing_orders/models/model_type.py
Normal file
33
sf_manufacturing_orders/models/model_type.py
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class ModelType(models.Model):
|
||||||
|
_name = 'sf.model.type'
|
||||||
|
_description = '模型类型'
|
||||||
|
|
||||||
|
name = fields.Char('名称')
|
||||||
|
embryo_tolerance = fields.Integer('胚料的容余量')
|
||||||
|
routing_tmpl_ids = fields.One2many('sf.model.type.routing.sort', 'model_type_id', '工序模板')
|
||||||
|
|
||||||
|
|
||||||
|
class ModelTypeRoutingSort(models.Model):
|
||||||
|
_name = 'sf.model.type.routing.sort'
|
||||||
|
_description = '工序排序'
|
||||||
|
|
||||||
|
sequence = fields.Integer('Sequence')
|
||||||
|
route_workcenter_id = fields.Many2one('mrp.routing.workcenter')
|
||||||
|
is_repeat = fields.Boolean('重复', related='route_workcenter_id.is_repeat')
|
||||||
|
routing_type = fields.Selection([
|
||||||
|
('获取CNC加工程序', '获取CNC加工程序'),
|
||||||
|
('装夹', '装夹'),
|
||||||
|
('前置三元定位检测', '前置三元定位检测'),
|
||||||
|
('CNC加工', 'CNC加工'),
|
||||||
|
('后置三元质量检测', '后置三元质量检测'),
|
||||||
|
('解除装夹', '解除装夹'),
|
||||||
|
], string="工序类型", related='route_workcenter_id.routing_type')
|
||||||
|
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
|
||||||
|
model_type_id = fields.Many2one('sf.model.type')
|
||||||
|
|
||||||
|
_sql_constraints = [
|
||||||
|
('route_model_type_uniq', 'unique (route_workcenter_id,model_type_id)', '工序不能重复!')
|
||||||
|
]
|
||||||
66
sf_manufacturing_orders/models/mrp_maintenance.py
Normal file
66
sf_manufacturing_orders/models/mrp_maintenance.py
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
from odoo import api, fields, models, _
|
||||||
|
from dateutil.relativedelta import relativedelta
|
||||||
|
|
||||||
|
|
||||||
|
class MaintenanceEquipment(models.Model):
|
||||||
|
_inherit = "maintenance.equipment"
|
||||||
|
_check_company_auto = True
|
||||||
|
|
||||||
|
expected_mtbf = fields.Integer(string='Expected MTBF', help='Expected Mean Time Between Failure')
|
||||||
|
mtbf = fields.Integer(compute='_compute_maintenance_request', string='MTBF',
|
||||||
|
help='Mean Time Between Failure, computed based on done corrective maintenances.')
|
||||||
|
mttr = fields.Integer(compute='_compute_maintenance_request', string='MTTR', help='Mean Time To Repair')
|
||||||
|
estimated_next_failure = fields.Date(compute='_compute_maintenance_request',
|
||||||
|
string='Estimated time before next failure (in days)',
|
||||||
|
help='Computed as Latest Failure Date + MTBF')
|
||||||
|
latest_failure_date = fields.Date(compute='_compute_maintenance_request', string='Latest Failure Date')
|
||||||
|
workcenter_id = fields.Many2one(
|
||||||
|
'mrp.workcenter', string='Work Center', check_company=True)
|
||||||
|
|
||||||
|
@api.depends('effective_date', 'maintenance_ids.stage_id', 'maintenance_ids.close_date',
|
||||||
|
'maintenance_ids.request_date')
|
||||||
|
def _compute_maintenance_request(self):
|
||||||
|
for equipment in self:
|
||||||
|
maintenance_requests = equipment.maintenance_ids.filtered(
|
||||||
|
lambda x: x.maintenance_type == 'corrective' and x.stage_id.done)
|
||||||
|
mttr_days = 0
|
||||||
|
for maintenance in maintenance_requests:
|
||||||
|
if maintenance.stage_id.done and maintenance.close_date:
|
||||||
|
mttr_days += (maintenance.close_date - maintenance.request_date).days
|
||||||
|
equipment.mttr = len(maintenance_requests) and (mttr_days / len(maintenance_requests)) or 0
|
||||||
|
maintenance = maintenance_requests.sorted(lambda x: x.request_date)
|
||||||
|
if len(maintenance) >= 1:
|
||||||
|
equipment.mtbf = (maintenance[-1].request_date - equipment.effective_date).days / len(maintenance)
|
||||||
|
equipment.latest_failure_date = maintenance and maintenance[-1].request_date or False
|
||||||
|
if equipment.mtbf:
|
||||||
|
equipment.estimated_next_failure = equipment.latest_failure_date + relativedelta(days=equipment.mtbf)
|
||||||
|
else:
|
||||||
|
equipment.estimated_next_failure = False
|
||||||
|
|
||||||
|
def button_mrp_workcenter(self):
|
||||||
|
self.ensure_one()
|
||||||
|
return {
|
||||||
|
'name': _('work centers'),
|
||||||
|
'view_mode': 'form',
|
||||||
|
'res_model': 'mrp.workcenter',
|
||||||
|
'view_id': self.env.ref('mrp.mrp_workcenter_view').id,
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'res_id': self.workcenter_id.id,
|
||||||
|
'context': {
|
||||||
|
'default_company_id': self.company_id.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class MaintenanceRequest(models.Model):
|
||||||
|
_inherit = "maintenance.request"
|
||||||
|
_check_company_auto = True
|
||||||
|
|
||||||
|
production_id = fields.Many2one(
|
||||||
|
'mrp.production', string='Manufacturing Order', check_company=True)
|
||||||
|
workorder_id = fields.Many2one(
|
||||||
|
'mrp.workorder', string='Work Order', check_company=True)
|
||||||
|
production_company_id = fields.Many2one(string='Production Company', related='production_id.company_id')
|
||||||
|
company_id = fields.Many2one(domain="[('id', '=?', production_company_id)]")
|
||||||
219
sf_manufacturing_orders/models/mrp_production.py
Normal file
219
sf_manufacturing_orders/models/mrp_production.py
Normal file
@@ -0,0 +1,219 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class MrpProduction(models.Model):
|
||||||
|
_inherit = 'mrp.production'
|
||||||
|
_description = "制造订单"
|
||||||
|
|
||||||
|
tray_ids = fields.One2many('sf.tray', 'production_id', string="托盘")
|
||||||
|
maintenance_count = fields.Integer(compute='_compute_maintenance_count', string="Number of maintenance requests")
|
||||||
|
request_ids = fields.One2many('maintenance.request', 'production_id')
|
||||||
|
|
||||||
|
@api.depends('request_ids')
|
||||||
|
def _compute_maintenance_count(self):
|
||||||
|
for production in self:
|
||||||
|
production.maintenance_count = len(production.request_ids)
|
||||||
|
|
||||||
|
def button_maintenance_req(self):
|
||||||
|
self.ensure_one()
|
||||||
|
return {
|
||||||
|
'name': _('New Maintenance Request'),
|
||||||
|
'view_mode': 'form',
|
||||||
|
'res_model': 'maintenance.request',
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'context': {
|
||||||
|
'default_company_id': self.company_id.id,
|
||||||
|
'default_production_id': self.id,
|
||||||
|
},
|
||||||
|
'domain': [('production_id', '=', self.id)],
|
||||||
|
}
|
||||||
|
|
||||||
|
def open_maintenance_request_mo(self):
|
||||||
|
self.ensure_one()
|
||||||
|
action = {
|
||||||
|
'name': _('Maintenance Requests'),
|
||||||
|
'view_mode': 'kanban,tree,form,pivot,graph,calendar',
|
||||||
|
'res_model': 'maintenance.request',
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'context': {
|
||||||
|
'default_company_id': self.company_id.id,
|
||||||
|
'default_production_id': self.id,
|
||||||
|
},
|
||||||
|
'domain': [('production_id', '=', self.id)],
|
||||||
|
}
|
||||||
|
if self.maintenance_count == 1:
|
||||||
|
production = self.env['maintenance.request'].search([('production_id', '=', self.id)])
|
||||||
|
action['view_mode'] = 'form'
|
||||||
|
action['res_id'] = production.id
|
||||||
|
return action
|
||||||
|
|
||||||
|
def action_generate_serial(self):
|
||||||
|
self.ensure_one()
|
||||||
|
self.lot_producing_id = self.env['stock.production.lot'].create({
|
||||||
|
'product_id': self.product_id.id,
|
||||||
|
'company_id': self.company_id.id,
|
||||||
|
'name': self.env['stock.production.lot']._get_next_serial(self.company_id, self.product_id) or self.env[
|
||||||
|
'ir.sequence'].next_by_code('stock.lot.serial'),
|
||||||
|
})
|
||||||
|
if self.move_finished_ids.filtered(lambda m: m.product_id == self.product_id).move_line_ids:
|
||||||
|
self.move_finished_ids.filtered(
|
||||||
|
lambda m: m.product_id == self.product_id).move_line_ids.lot_id = self.lot_producing_id
|
||||||
|
if self.product_id.tracking == 'serial':
|
||||||
|
self._set_qty_producing()
|
||||||
|
|
||||||
|
# 重载根据工序生成工单的程序:如果产品BOM中没有工序时,
|
||||||
|
# 根据产品对应的模板类型中工序,去生成工单;
|
||||||
|
# CNC加工工序的选取规则:
|
||||||
|
# 如果自动报价有带过来预分配的机床,
|
||||||
|
# 则根据设备找到工作中心;否则采用前面描述的工作中心分配机制;
|
||||||
|
# 其他规则限制: 默认只分配给工作中心状态为非故障的工作中心;
|
||||||
|
|
||||||
|
def _create_workorder(self):
|
||||||
|
for production in self:
|
||||||
|
if not production.bom_id or not production.product_id:
|
||||||
|
continue
|
||||||
|
workorders_values = []
|
||||||
|
|
||||||
|
product_qty = production.product_uom_id._compute_quantity(production.product_qty,
|
||||||
|
production.bom_id.product_uom_id)
|
||||||
|
exploded_boms, dummy = production.bom_id.explode(production.product_id,
|
||||||
|
product_qty / production.bom_id.product_qty,
|
||||||
|
picking_type=production.bom_id.picking_type_id)
|
||||||
|
|
||||||
|
for bom, bom_data in exploded_boms:
|
||||||
|
# If the operations of the parent BoM and phantom BoM are the same, don't recreate work orders.
|
||||||
|
if not (bom.operation_ids and (not bom_data['parent_line'] or bom_data[
|
||||||
|
'parent_line'].bom_id.operation_ids != bom.operation_ids)):
|
||||||
|
continue
|
||||||
|
for operation in bom.operation_ids:
|
||||||
|
if operation._skip_operation_line(bom_data['product']):
|
||||||
|
continue
|
||||||
|
workorders_values += [{
|
||||||
|
'name': operation.name,
|
||||||
|
'production_id': production.id,
|
||||||
|
'workcenter_id': operation.workcenter_id.id,
|
||||||
|
'product_uom_id': production.product_uom_id.id,
|
||||||
|
'operation_id': operation.id,
|
||||||
|
'state': 'pending',
|
||||||
|
}]
|
||||||
|
# 根据加工面板的面数及对应的工序模板生成工单
|
||||||
|
i = 0
|
||||||
|
processing_panel_len = len(production.product_id.model_processing_panel.split(','))
|
||||||
|
for k in (production.product_id.model_processing_panel.split(',')):
|
||||||
|
routingworkcenter = self.env['sf.model.type.routing.sort'].search(
|
||||||
|
[('model_type_id', '=', production.product_id.model_type_id.id)],
|
||||||
|
order='sequence asc'
|
||||||
|
)
|
||||||
|
i += 1
|
||||||
|
for route in routingworkcenter:
|
||||||
|
if i == 1 and route.routing_type == '获取CNC加工程序':
|
||||||
|
workorders_values.append(
|
||||||
|
self.env['mrp.workorder'].json_workorder_str('', production, route))
|
||||||
|
if route.is_repeat == True:
|
||||||
|
workorders_values.append(
|
||||||
|
self.env['mrp.workorder'].json_workorder_str(k, production, route))
|
||||||
|
if i == processing_panel_len and route.routing_type == '解除装夹':
|
||||||
|
workorders_values.append(
|
||||||
|
self.env['mrp.workorder'].json_workorder_str(k, production, route))
|
||||||
|
production.workorder_ids = workorders_values
|
||||||
|
for workorder in production.workorder_ids:
|
||||||
|
workorder.duration_expected = workorder._get_duration_expected()
|
||||||
|
|
||||||
|
def create_production1_values(self, production):
|
||||||
|
production_values_str = {'origin': production.origin,
|
||||||
|
'product_id': production.product_id.id,
|
||||||
|
'product_description_variants': production.product_description_variants,
|
||||||
|
'product_qty': production.product_qty,
|
||||||
|
'product_uom_id': production.product_uom_id.id,
|
||||||
|
'location_src_id': production.location_src_id.id,
|
||||||
|
'location_dest_id': production.location_dest_id.id,
|
||||||
|
'bom_id': production.bom_id.id,
|
||||||
|
'date_deadline': production.date_deadline,
|
||||||
|
'date_planned_start': production.date_planned_start,
|
||||||
|
'date_planned_finished': production.date_planned_finished,
|
||||||
|
'procurement_group_id': False,
|
||||||
|
'propagate_cancel': production.propagate_cancel,
|
||||||
|
'orderpoint_id': production.orderpoint_id.id,
|
||||||
|
'picking_type_id': production.picking_type_id.id,
|
||||||
|
'company_id': production.company_id.id,
|
||||||
|
'move_dest_ids': production.move_dest_ids.ids,
|
||||||
|
'user_id': production.user_id.id}
|
||||||
|
return production_values_str
|
||||||
|
|
||||||
|
def _reset_work_order_sequence1(self, k):
|
||||||
|
for rec in self:
|
||||||
|
current_sequence = 1
|
||||||
|
for work in rec.workorder_ids:
|
||||||
|
work.sequence = current_sequence
|
||||||
|
current_sequence += 1
|
||||||
|
|
||||||
|
def _create_workorder1(self, k):
|
||||||
|
for production in self:
|
||||||
|
if not production.bom_id or not production.product_id:
|
||||||
|
continue
|
||||||
|
workorders_values = []
|
||||||
|
|
||||||
|
product_qty = production.product_uom_id._compute_quantity(production.product_qty,
|
||||||
|
production.bom_id.product_uom_id)
|
||||||
|
exploded_boms, dummy = production.bom_id.explode(production.product_id,
|
||||||
|
product_qty / production.bom_id.product_qty,
|
||||||
|
picking_type=production.bom_id.picking_type_id)
|
||||||
|
|
||||||
|
for bom, bom_data in exploded_boms:
|
||||||
|
# If the operations of the parent BoM and phantom BoM are the same, don't recreate work orders.
|
||||||
|
if not (bom.operation_ids and (not bom_data['parent_line'] or bom_data[
|
||||||
|
'parent_line'].bom_id.operation_ids != bom.operation_ids)):
|
||||||
|
continue
|
||||||
|
for operation in bom.operation_ids:
|
||||||
|
if operation._skip_operation_line(bom_data['product']):
|
||||||
|
continue
|
||||||
|
workorders_values += [{
|
||||||
|
'name': operation.name,
|
||||||
|
'production_id': production.id,
|
||||||
|
'workcenter_id': operation.workcenter_id.id,
|
||||||
|
'product_uom_id': production.product_uom_id.id,
|
||||||
|
'operation_id': operation.id,
|
||||||
|
'state': 'pending',
|
||||||
|
}]
|
||||||
|
# 根据加工面板的面数及对应的工序模板生成工单
|
||||||
|
i = 0
|
||||||
|
production.product_id.model_processing_panel = k
|
||||||
|
processing_panel_len = len(k)
|
||||||
|
for k in (production.product_id.model_processing_panel.split(',')):
|
||||||
|
routingworkcenter = self.env['sf.model.type.routing.sort'].search(
|
||||||
|
[('model_type_id', '=', production.product_id.model_type_id.id)],
|
||||||
|
|
||||||
|
order='sequence asc'
|
||||||
|
)
|
||||||
|
i += 1
|
||||||
|
for route in routingworkcenter:
|
||||||
|
|
||||||
|
if route.routing_type == '后置三元质量检测':
|
||||||
|
workorders_values.append(
|
||||||
|
self.env['mrp.workorder'].json_workorder_str1(k, production, route)
|
||||||
|
)
|
||||||
|
if route.routing_type == 'CNC加工':
|
||||||
|
workorders_values.append(
|
||||||
|
self.env['mrp.workorder'].json_workorder_str1(k, production, route))
|
||||||
|
|
||||||
|
production.workorder_ids = workorders_values
|
||||||
|
for workorder in production.workorder_ids:
|
||||||
|
workorder.duration_expected = workorder._get_duration_expected()
|
||||||
|
|
||||||
|
def _create_workorder2(self, k):
|
||||||
|
res = self._create_workorder1(k)
|
||||||
|
self._reset_work_order_sequence1(k)
|
||||||
|
return res
|
||||||
|
|
||||||
|
def _reset_work_order_sequence(self):
|
||||||
|
for rec in self:
|
||||||
|
current_sequence = 1
|
||||||
|
for work in rec.workorder_ids:
|
||||||
|
work.sequence = current_sequence
|
||||||
|
current_sequence += 1
|
||||||
|
|
||||||
|
def _create_workorder(self):
|
||||||
|
res = super()._create_workorder()
|
||||||
|
self._reset_work_order_sequence()
|
||||||
|
return res
|
||||||
@@ -1,15 +1,6 @@
|
|||||||
from odoo import fields, models, api
|
from odoo import fields, models, api
|
||||||
|
|
||||||
|
|
||||||
class ModelType(models.Model):
|
|
||||||
_name = 'sf.model.type'
|
|
||||||
_description = '模型类型'
|
|
||||||
|
|
||||||
name = fields.Char('名称')
|
|
||||||
embryo_tolerance = fields.Integer('胚料的容余量')
|
|
||||||
routing_tmpl_ids = fields.One2many('sf.model.type.routing.sort', 'model_type_id', '工序模板')
|
|
||||||
|
|
||||||
|
|
||||||
class ResMrpRoutingWorkcenter(models.Model):
|
class ResMrpRoutingWorkcenter(models.Model):
|
||||||
_inherit = 'mrp.routing.workcenter'
|
_inherit = 'mrp.routing.workcenter'
|
||||||
|
|
||||||
60
sf_manufacturing_orders/models/mrp_workcenter.py
Normal file
60
sf_manufacturing_orders/models/mrp_workcenter.py
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
from odoo import api, fields, models, _
|
||||||
|
from collections import defaultdict
|
||||||
|
from odoo.addons.resource.models.resource import Intervals
|
||||||
|
|
||||||
|
|
||||||
|
class ResWorkcenter(models.Model):
|
||||||
|
_inherit = "mrp.workcenter"
|
||||||
|
machine_tool_id = fields.Many2one('mrs.machine_tool', '机床')
|
||||||
|
|
||||||
|
equipment_ids = fields.One2many(
|
||||||
|
'maintenance.equipment', 'workcenter_id', string="Maintenance Equipment",
|
||||||
|
check_company=True)
|
||||||
|
|
||||||
|
def action_work_order(self):
|
||||||
|
if not self.env.context.get('desktop_list_view', False):
|
||||||
|
action = self.env["ir.actions.actions"]._for_xml_id("sf_route_workcenter.mrp_workorder_action_tablet")
|
||||||
|
return action
|
||||||
|
else:
|
||||||
|
return super(MrpWorkcenter, self).action_work_order()
|
||||||
|
|
||||||
|
def _get_unavailability_intervals(self, start_datetime, end_datetime):
|
||||||
|
res = super(MrpWorkcenter, self)._get_unavailability_intervals(start_datetime, end_datetime)
|
||||||
|
if not self:
|
||||||
|
return res
|
||||||
|
sql = """
|
||||||
|
SELECT workcenter_id, ARRAY_AGG((schedule_date || '|' || schedule_date + INTERVAL '1h' * duration)) as date_intervals
|
||||||
|
FROM maintenance_request
|
||||||
|
LEFT JOIN maintenance_equipment
|
||||||
|
ON maintenance_request.equipment_id = maintenance_equipment.id
|
||||||
|
WHERE
|
||||||
|
schedule_date IS NOT NULL
|
||||||
|
AND duration IS NOT NULL
|
||||||
|
AND equipment_id IS NOT NULL
|
||||||
|
AND maintenance_equipment.workcenter_id IS NOT NULL
|
||||||
|
AND maintenance_equipment.workcenter_id IN %s
|
||||||
|
AND (schedule_date, schedule_date + INTERVAL '1h' * duration) OVERLAPS (%s, %s)
|
||||||
|
GROUP BY maintenance_equipment.workcenter_id;
|
||||||
|
"""
|
||||||
|
self.env.cr.execute(sql, [tuple(self.ids), fields.Datetime.to_string(start_datetime.astimezone()),
|
||||||
|
fields.Datetime.to_string(end_datetime.astimezone())])
|
||||||
|
res_maintenance = defaultdict(list)
|
||||||
|
for wc_row in self.env.cr.dictfetchall():
|
||||||
|
res_maintenance[wc_row.get('workcenter_id')] = [
|
||||||
|
[fields.Datetime.to_datetime(i) for i in intervals.split('|')]
|
||||||
|
for intervals in wc_row.get('date_intervals')
|
||||||
|
]
|
||||||
|
|
||||||
|
for wc_id in self.ids:
|
||||||
|
intervals_previous_list = [(s.timestamp(), e.timestamp(), self.env['maintenance.request']) for s, e in
|
||||||
|
res[wc_id]]
|
||||||
|
intervals_maintenances_list = [(m[0].timestamp(), m[1].timestamp(), self.env['maintenance.request']) for m
|
||||||
|
in res_maintenance[wc_id]]
|
||||||
|
final_intervals_wc = Intervals(intervals_previous_list + intervals_maintenances_list)
|
||||||
|
res[wc_id] = [(datetime.fromtimestamp(s), datetime.fromtimestamp(e)) for s, e, _ in final_intervals_wc]
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
class ResWorkcenterProductivity(models.Model):
|
||||||
|
_inherit = 'mrp.workcenter.productivity'
|
||||||
|
workcenter_id = fields.Many2one('mrp.workcenter', required=False)
|
||||||
@@ -1,17 +1,13 @@
|
|||||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||||
|
|
||||||
|
|
||||||
class ResWorkcenterProductivity(models.Model):
|
|
||||||
_inherit = 'mrp.workcenter.productivity'
|
|
||||||
workcenter_id = fields.Many2one('mrp.workcenter', required=False)
|
|
||||||
|
|
||||||
|
|
||||||
class ResMrpWorkOrder(models.Model):
|
class ResMrpWorkOrder(models.Model):
|
||||||
_inherit = 'mrp.workorder'
|
_inherit = 'mrp.workorder'
|
||||||
|
_order = 'sequence'
|
||||||
|
|
||||||
workcenter_id = fields.Many2one('mrp.workcenter', required=False)
|
workcenter_id = fields.Many2one('mrp.workcenter', required=False)
|
||||||
processing_panel = fields.Char('加工面')
|
processing_panel = fields.Char('加工面')
|
||||||
|
sequence = fields.Integer(string='工序')
|
||||||
routing_type = fields.Selection([
|
routing_type = fields.Selection([
|
||||||
('获取CNC加工程序', '获取CNC加工程序'),
|
('获取CNC加工程序', '获取CNC加工程序'),
|
||||||
('装夹', '装夹'),
|
('装夹', '装夹'),
|
||||||
@@ -20,6 +16,78 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
('后置三元质量检测', '后置三元质量检测'),
|
('后置三元质量检测', '后置三元质量检测'),
|
||||||
('解除装夹', '解除装夹'),
|
('解除装夹', '解除装夹'),
|
||||||
], string="工序类型")
|
], string="工序类型")
|
||||||
|
material_center_point = fields.Char(string='配料中心点')
|
||||||
|
X1_axis = fields.Float(string='Lx1', default=0)
|
||||||
|
Y1_axis = fields.Float(string='Ly1', default=0)
|
||||||
|
Z1_axis = fields.Float(string='Lz1', default=0)
|
||||||
|
X2_axis = fields.Float(string='Lx2', default=0)
|
||||||
|
Y2_axis = fields.Float(string='Ly2', default=0)
|
||||||
|
Z2_axis = fields.Float(string='Lz2', default=0)
|
||||||
|
X3_axis = fields.Float(string='Fx3', default=0)
|
||||||
|
Y3_axis = fields.Float(string='Fy3', default=0)
|
||||||
|
Z3_axis = fields.Float(string='Fz3', default=0)
|
||||||
|
X4_axis = fields.Float(string='Fx4', default=0)
|
||||||
|
Y4_axis = fields.Float(string='Fy4', default=0)
|
||||||
|
Z4_axis = fields.Float(string='Fz4', default=0)
|
||||||
|
X5_axis = fields.Float(string='Rx5', default=0)
|
||||||
|
Y5_axis = fields.Float(string='Ry5', default=0)
|
||||||
|
Z5_axis = fields.Float(string='Rz5', default=0)
|
||||||
|
X6_axis = fields.Float(string='Rx6', default=0)
|
||||||
|
Y6_axis = fields.Float(string='Ry6', default=0)
|
||||||
|
Z6_axis = fields.Float(string='Rz6', default=0)
|
||||||
|
X7_axis = fields.Float(string='Bx7', default=0)
|
||||||
|
Y7_axis = fields.Float(string='By7', default=0)
|
||||||
|
Z7_axis = fields.Float(string='Bz7', default=0)
|
||||||
|
X8_axis = fields.Float(string='Bx8', default=0)
|
||||||
|
Y8_axis = fields.Float(string='By8', default=0)
|
||||||
|
Z8_axis = fields.Float(string='Bz8', default=0)
|
||||||
|
X9_axis = fields.Float(string='Uz9', default=0)
|
||||||
|
Y9_axis = fields.Float(string='Uz9', default=0)
|
||||||
|
Z9_axis = fields.Float(string='Uz9', default=0)
|
||||||
|
X10_axis = fields.Float(string='Uz10', default=0)
|
||||||
|
Y10_axis = fields.Float(string='Uz10', default=0)
|
||||||
|
Z10_axis = fields.Float(string='Uz10', default=0)
|
||||||
|
X_deviation_angle = fields.Integer(string="X轴偏差度", default=0)
|
||||||
|
test_results = fields.Selection([("合格", "合格"), ("返工", "返工"), ("报废", "报废")], string="检测结果")
|
||||||
|
cnc_ids = fields.One2many("sf.cnc.processing", 'workorder_id', string="CNC加工")
|
||||||
|
tray_code = fields.Char(string="托盘")
|
||||||
|
|
||||||
|
# 计算配料中心点和与x轴倾斜度方法
|
||||||
|
def getcenter(self):
|
||||||
|
x1 = self.X1_axis
|
||||||
|
x2 = self.X2_axis
|
||||||
|
x3 = self.X3_axis
|
||||||
|
x4 = self.X4_axis
|
||||||
|
x5 = self.X5_axis
|
||||||
|
x6 = self.X6_axis
|
||||||
|
x7 = self.X7_axis
|
||||||
|
x8 = self.X8_axis
|
||||||
|
y1 = self.Y1_axis
|
||||||
|
y2 = self.Y2_axis
|
||||||
|
y3 = self.Y3_axis
|
||||||
|
y4 = self.Y4_axis
|
||||||
|
y5 = self.Y5_axis
|
||||||
|
y6 = self.Y6_axis
|
||||||
|
y7 = self.Y7_axis
|
||||||
|
y8 = self.Y8_axis
|
||||||
|
z1 = self.Z9_axis
|
||||||
|
x0 = ((x3 - x4) * (x2 * y1 - x1 * y2) - (x1 - x2) * (x4 * y3 - x3 * y4)) / (
|
||||||
|
(x3 - x4) * (y1 - y2) - (x1 - x2) * (y3 - y4))
|
||||||
|
y0 = ((y3 - y4) * (y2 * x1 - y1 * x2) - (y1 - y2) * (y4 * x3 - y3 * x4)) / (
|
||||||
|
(y3 - y4) * (x1 - x2) - (y1 - y2) * (x3 - x4))
|
||||||
|
x1 = ((x7 - x8) * (x6 * y5 - x5 * y6) - (x5 - x6) * (x8 * y7 - x7 * y8)) / (
|
||||||
|
(x7 - x8) * (y5 - y6) - (x5 - x6) * (y7 - y8));
|
||||||
|
y1 = ((y7 - y8) * (y6 * x5 - y5 * x6) - (y5 - y6) * (y8 * x7 - y7 * x8)) / (
|
||||||
|
(y7 - y8) * (x5 - x6) - (y5 - y6) * (x7 - x8))
|
||||||
|
x = (x0 + x1) / 2
|
||||||
|
y = (y0 + y1) / 2
|
||||||
|
z = z1 / 2
|
||||||
|
|
||||||
|
jd = math.atan2((x5 - x6), (y5 - y6))
|
||||||
|
jdz = jd * 180 / math.pi
|
||||||
|
print("(%.2f,%.2f)" % (x, y))
|
||||||
|
self.material_center_point = ("(%.2f,%.2f,%.2f)" % (x, y, z))
|
||||||
|
self.X_deviation_angle = jdz
|
||||||
|
|
||||||
def json_workorder_str(self, k, production, route):
|
def json_workorder_str(self, k, production, route):
|
||||||
workorders_values_str = [0, '', {
|
workorders_values_str = [0, '', {
|
||||||
@@ -37,4 +105,221 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
}]
|
}]
|
||||||
return workorders_values_str
|
return workorders_values_str
|
||||||
|
|
||||||
|
# 工作中心看板按钮
|
||||||
|
def button_maintenance_req(self):
|
||||||
|
self.ensure_one()
|
||||||
|
return {
|
||||||
|
'name': _('New Maintenance Request'),
|
||||||
|
'view_mode': 'form',
|
||||||
|
'views': [(self.env.ref('mrp_maintenance.maintenance_request_view_form_inherit_mrp').id, 'form')],
|
||||||
|
'res_model': 'maintenance.request',
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'context': {
|
||||||
|
'default_company_id': self.company_id.id,
|
||||||
|
'default_workorder_id': self.id,
|
||||||
|
'default_production_id': self.production_id.id,
|
||||||
|
'discard_on_footer_button': True,
|
||||||
|
},
|
||||||
|
'target': 'new',
|
||||||
|
'domain': [('workorder_id', '=', self.id)]
|
||||||
|
}
|
||||||
|
|
||||||
|
# 扫码绑定托盘方法
|
||||||
|
def gettray(self):
|
||||||
|
if self.tray_code != False:
|
||||||
|
values = self.env['sf.tray'].search([("code", "=", self.tray_code)])
|
||||||
|
if values:
|
||||||
|
if values.state == "占用":
|
||||||
|
raise ValidationError('该托盘已占用')
|
||||||
|
if values.state == "报损":
|
||||||
|
raise ValidationError('该托盘已损坏')
|
||||||
|
else:
|
||||||
|
values.update({
|
||||||
|
'workorder_id': self,
|
||||||
|
'production_id': self.production_id,
|
||||||
|
'state': '占用',
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
raise ValidationError('该托盘编码已失效')
|
||||||
|
else:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
# 解除托盘绑定
|
||||||
|
def unbindtray(self):
|
||||||
|
tray = self.env['sf.tray'].search([("production_id", "=", self.production_id.id)])
|
||||||
|
if tray:
|
||||||
|
tray.unclamp()
|
||||||
|
|
||||||
|
return ""
|
||||||
|
|
||||||
|
def recreateManufacturingOrWorkerOrder(self):
|
||||||
|
"""
|
||||||
|
重新生成制造订单或者重新生成工单
|
||||||
|
"""
|
||||||
|
if self.test_results == '报废':
|
||||||
|
values = self.env['mrp.production'].create_production1_values(self.production_id)
|
||||||
|
productions = self.env['mrp.production'].with_user(SUPERUSER_ID).sudo().with_company(
|
||||||
|
self.production_id.company_id).create(
|
||||||
|
values)
|
||||||
|
self.env['stock.move'].sudo().create(productions._get_moves_raw_values())
|
||||||
|
self.env['stock.move'].sudo().create(productions._get_moves_finished_values())
|
||||||
|
productions._create_workorder()
|
||||||
|
productions.filtered(lambda p: (not p.orderpoint_id and p.move_raw_ids) or \
|
||||||
|
(
|
||||||
|
p.move_dest_ids.procure_method != 'make_to_order' and not p.move_raw_ids and not p.workorder_ids)).action_confirm()
|
||||||
|
|
||||||
|
for production in productions:
|
||||||
|
origin_production = production.move_dest_ids and production.move_dest_ids[
|
||||||
|
0].raw_material_production_id or False
|
||||||
|
orderpoint = production.orderpoint_id
|
||||||
|
if orderpoint and orderpoint.create_uid.id == SUPERUSER_ID and orderpoint.trigger == 'manual':
|
||||||
|
production.message_post(
|
||||||
|
body=_('This production order has been created from Replenishment Report.'),
|
||||||
|
message_type='comment',
|
||||||
|
subtype_xmlid='mail.mt_note')
|
||||||
|
elif orderpoint:
|
||||||
|
production.message_post_with_view(
|
||||||
|
'mail.message_origin_link',
|
||||||
|
values={'self': production, 'origin': orderpoint},
|
||||||
|
subtype_id=self.env.ref('mail.mt_note').id)
|
||||||
|
elif origin_production:
|
||||||
|
production.message_post_with_view(
|
||||||
|
'mail.message_origin_link',
|
||||||
|
values={'self': production, 'origin': origin_production},
|
||||||
|
subtype_id=self.env.ref('mail.mt_note').id)
|
||||||
|
if self.test_results == '返工':
|
||||||
|
productions = self.production_id
|
||||||
|
self.env['stock.move'].sudo().create(productions._get_moves_raw_values())
|
||||||
|
self.env['stock.move'].sudo().create(productions._get_moves_finished_values())
|
||||||
|
productions._create_workorder2(self.processing_panel)
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
|
||||||
|
# cnc程序获取
|
||||||
|
def fetchCNC(self):
|
||||||
|
res = [{'model_code': self.product_id.barcode, 'production_no': self.production_id.name,
|
||||||
|
'machine_tool_code': self.workcenter_id.machine_tool_id.code,
|
||||||
|
'material_code': self.env['mrs.production.materials'].search(
|
||||||
|
[('id', '=', self.product_id.materials_id.id)]).materials_no,
|
||||||
|
'material_type_code': self.env['mrs.materials.model'].search(
|
||||||
|
[('id', '=', self.product_id.materials_type_id.id)]).materials_no,
|
||||||
|
'embryo_long': self.product_id.bom_ids.bom_line_ids.product_id.long,
|
||||||
|
'embryo_height': self.product_id.bom_ids.bom_line_ids.product_id.height,
|
||||||
|
'embryo_width': self.product_id.bom_ids.bom_line_ids.product_id.width
|
||||||
|
# 'factory_code': self.env.user.company_id.partner_id.
|
||||||
|
}]
|
||||||
|
configsettings = self.env['res.config.settings'].get_values()
|
||||||
|
config_header = Common.get_headers(self, configsettings['token'], configsettings['mrs_secret_key'])
|
||||||
|
url = '/api/intelligent_programming/create'
|
||||||
|
config_url = configsettings['mrs_url'] + url
|
||||||
|
res_str = json.dumps(res)
|
||||||
|
ret = requests.post(config_url, json={"result": res_str}, data=None, headers=config_header)
|
||||||
|
ret = ret.json()
|
||||||
|
result = json.loads(ret['result'])
|
||||||
|
if result['status'] == 1:
|
||||||
|
return self.write({'state': 'progress'})
|
||||||
|
|
||||||
|
def json_workorder_str1(self, k, production, route):
|
||||||
|
workorders_values_str = [0, '', {
|
||||||
|
'product_uom_id': production.product_uom_id.id,
|
||||||
|
'qty_producing': 0,
|
||||||
|
'operation_id': False,
|
||||||
|
'name': route.route_workcenter_id.name,
|
||||||
|
'processing_panel': k,
|
||||||
|
'routing_type': route.routing_type,
|
||||||
|
'workcenter_id': self.env['mrp.routing.workcenter'].get_workcenter(route.workcenter_ids.ids),
|
||||||
|
'date_planned_start': False,
|
||||||
|
'date_planned_finished': False,
|
||||||
|
'duration_expected': 60,
|
||||||
|
'duration': 0
|
||||||
|
}]
|
||||||
|
return workorders_values_str
|
||||||
|
|
||||||
|
# 重写工单开始按钮方法
|
||||||
|
def button_start(self):
|
||||||
|
if self.state == 'waiting':
|
||||||
|
self.ensure_one()
|
||||||
|
if any(not time.date_end for time in self.time_ids.filtered(lambda t: t.user_id.id == self.env.user.id)):
|
||||||
|
return True
|
||||||
|
# As button_start is automatically called in the new view
|
||||||
|
if self.state in ('done', 'cancel'):
|
||||||
|
return True
|
||||||
|
|
||||||
|
if self.product_tracking == 'serial':
|
||||||
|
self.qty_producing = 1.0
|
||||||
|
else:
|
||||||
|
self.qty_producing = self.qty_remaining
|
||||||
|
|
||||||
|
self.env['mrp.workcenter.productivity'].create(
|
||||||
|
self._prepare_timeline_vals(self.duration, datetime.now())
|
||||||
|
)
|
||||||
|
if self.production_id.state != 'progress':
|
||||||
|
self.production_id.write({
|
||||||
|
'date_start': datetime.now(),
|
||||||
|
})
|
||||||
|
if self.state == 'progress':
|
||||||
|
return True
|
||||||
|
start_date = datetime.now()
|
||||||
|
vals = {
|
||||||
|
'state': 'progress',
|
||||||
|
'date_start': start_date,
|
||||||
|
}
|
||||||
|
if not self.leave_id:
|
||||||
|
leave = self.env['resource.calendar.leaves'].create({
|
||||||
|
'name': self.display_name,
|
||||||
|
'calendar_id': self.workcenter_id.resource_calendar_id.id,
|
||||||
|
'date_from': start_date,
|
||||||
|
'date_to': start_date + relativedelta(minutes=self.duration_expected),
|
||||||
|
'resource_id': self.workcenter_id.resource_id.id,
|
||||||
|
'time_type': 'other'
|
||||||
|
})
|
||||||
|
vals['leave_id'] = leave.id
|
||||||
|
return self.write(vals)
|
||||||
|
else:
|
||||||
|
if self.date_planned_start > start_date:
|
||||||
|
vals['date_planned_start'] = start_date
|
||||||
|
if self.date_planned_finished and self.date_planned_finished < start_date:
|
||||||
|
vals['date_planned_finished'] = start_date
|
||||||
|
return self.write(vals)
|
||||||
|
else:
|
||||||
|
raise ValidationError(_('请先完成上一步工单'))
|
||||||
|
|
||||||
|
|
||||||
|
class CNCprocessing(models.Model):
|
||||||
|
_name = 'sf.cnc.processing'
|
||||||
|
_description = "CNC加工"
|
||||||
|
|
||||||
|
cnc_id = fields.Many2one('ir.attachment')
|
||||||
|
FNo = fields.Char(string="序号")
|
||||||
|
FPGName = fields.Char(string="程序名")
|
||||||
|
FKnifeName = fields.Char(string="刀具名称")
|
||||||
|
FDNo = fields.Char(string="刀号")
|
||||||
|
FWorkType = fields.Char(string="加工类型")
|
||||||
|
FXY = fields.Char(string="余量_X/Y")
|
||||||
|
FZ = fields.Char(string="余量_Z")
|
||||||
|
FJGSD = fields.Char(string="加工深度(Z)")
|
||||||
|
FSCCD = fields.Char(string="刀具伸出长度")
|
||||||
|
FDJSpec = fields.Char(string="刀柄型号")
|
||||||
|
FJGDate = fields.Datetime(string="预计加工时间")
|
||||||
|
FComment = fields.Char(string="备注")
|
||||||
|
workorder_id = fields.Many2one('mrp.workorder', string="工单")
|
||||||
|
|
||||||
|
# mrs下发编程单创建CNC加工
|
||||||
|
def CNCprocessing_create(self, obj):
|
||||||
|
workorder = self.env['mrp.workorder'].search([('production_id', '=', obj['manufacturing_order_no']),
|
||||||
|
('processing_panel', '=', obj['processing_panel']),
|
||||||
|
('routing_type', '=', 'CNC加工')])
|
||||||
|
self.env['sf.cnc.processing'].create({
|
||||||
|
'workorder_id': workorder.id,
|
||||||
|
'FNo': obj['sequence_number'],
|
||||||
|
'FPGName': obj['program_name'],
|
||||||
|
'FKnifeName': obj['cutting_tool_name'],
|
||||||
|
'FDNo': obj['cutting_tool_no'],
|
||||||
|
'FWorkType': obj['processing_type'],
|
||||||
|
'FXY': obj['margin_x_y'],
|
||||||
|
'FZ': obj['margin_z'],
|
||||||
|
'FJGSD': obj['depth_of_processing_z'],
|
||||||
|
'FSCCD': obj['cutting_tool_extension_length'],
|
||||||
|
'FDJSpec': obj['cutting_tool_handle_type'],
|
||||||
|
# 'FJGDate': obj['']
|
||||||
|
})
|
||||||
|
|||||||
@@ -7,96 +7,6 @@ from re import split as regex_split
|
|||||||
from odoo import SUPERUSER_ID, _, api, fields, models, registry
|
from odoo import SUPERUSER_ID, _, api, fields, models, registry
|
||||||
from odoo.tools import float_compare, float_is_zero, html_escape
|
from odoo.tools import float_compare, float_is_zero, html_escape
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class ProductTemplate(models.Model):
|
|
||||||
_inherit = 'product.template'
|
|
||||||
_description = '产品模板'
|
|
||||||
|
|
||||||
single_manufacturing = fields.Boolean(string="单个制造")
|
|
||||||
|
|
||||||
|
|
||||||
class ProcurementGroup(models.Model):
|
|
||||||
_inherit = 'procurement.group'
|
|
||||||
|
|
||||||
|
|
||||||
class MrpProduction(models.Model):
|
|
||||||
_inherit = 'mrp.production'
|
|
||||||
_description = "制造订单"
|
|
||||||
|
|
||||||
def action_generate_serial(self):
|
|
||||||
self.ensure_one()
|
|
||||||
self.lot_producing_id = self.env['stock.production.lot'].create({
|
|
||||||
'product_id': self.product_id.id,
|
|
||||||
'company_id': self.company_id.id,
|
|
||||||
'name': self.env['stock.production.lot']._get_next_serial(self.company_id, self.product_id) or self.env[
|
|
||||||
'ir.sequence'].next_by_code('stock.lot.serial'),
|
|
||||||
})
|
|
||||||
if self.move_finished_ids.filtered(lambda m: m.product_id == self.product_id).move_line_ids:
|
|
||||||
self.move_finished_ids.filtered(
|
|
||||||
lambda m: m.product_id == self.product_id).move_line_ids.lot_id = self.lot_producing_id
|
|
||||||
if self.product_id.tracking == 'serial':
|
|
||||||
self._set_qty_producing()
|
|
||||||
|
|
||||||
# 重载根据工序生成工单的程序:如果产品BOM中没有工序时,
|
|
||||||
# 根据产品对应的模板类型中工序,去生成工单;
|
|
||||||
# CNC加工工序的选取规则:
|
|
||||||
# 如果自动报价有带过来预分配的机床,
|
|
||||||
# 则根据设备找到工作中心;否则采用前面描述的工作中心分配机制;
|
|
||||||
# 其他规则限制: 默认只分配给工作中心状态为非故障的工作中心;
|
|
||||||
|
|
||||||
def _create_workorder(self):
|
|
||||||
for production in self:
|
|
||||||
if not production.bom_id or not production.product_id:
|
|
||||||
continue
|
|
||||||
workorders_values = []
|
|
||||||
|
|
||||||
product_qty = production.product_uom_id._compute_quantity(production.product_qty,
|
|
||||||
production.bom_id.product_uom_id)
|
|
||||||
exploded_boms, dummy = production.bom_id.explode(production.product_id,
|
|
||||||
product_qty / production.bom_id.product_qty,
|
|
||||||
picking_type=production.bom_id.picking_type_id)
|
|
||||||
|
|
||||||
for bom, bom_data in exploded_boms:
|
|
||||||
# If the operations of the parent BoM and phantom BoM are the same, don't recreate work orders.
|
|
||||||
if not (bom.operation_ids and (not bom_data['parent_line'] or bom_data[
|
|
||||||
'parent_line'].bom_id.operation_ids != bom.operation_ids)):
|
|
||||||
continue
|
|
||||||
for operation in bom.operation_ids:
|
|
||||||
if operation._skip_operation_line(bom_data['product']):
|
|
||||||
continue
|
|
||||||
workorders_values += [{
|
|
||||||
'name': operation.name,
|
|
||||||
'production_id': production.id,
|
|
||||||
'workcenter_id': operation.workcenter_id.id,
|
|
||||||
'product_uom_id': production.product_uom_id.id,
|
|
||||||
'operation_id': operation.id,
|
|
||||||
'state': 'pending',
|
|
||||||
}]
|
|
||||||
# 根据加工面板的面数及对应的工序模板生成工单
|
|
||||||
i = 0
|
|
||||||
processing_panel_len = len(production.product_id.model_processing_panel.split(','))
|
|
||||||
for k in (production.product_id.model_processing_panel.split(',')):
|
|
||||||
routingworkcenter = self.env['sf.model.type.routing.sort'].search(
|
|
||||||
[('model_type_id', '=', production.product_id.model_type_id.id)],
|
|
||||||
order='sequence asc'
|
|
||||||
)
|
|
||||||
i += 1
|
|
||||||
for route in routingworkcenter:
|
|
||||||
if i == 1 and route.routing_type == '获取CNC加工程序':
|
|
||||||
workorders_values.append(
|
|
||||||
self.env['mrp.workorder'].json_workorder_str('', production, route))
|
|
||||||
if route.is_repeat == True:
|
|
||||||
workorders_values.append(
|
|
||||||
self.env['mrp.workorder'].json_workorder_str(k, production, route))
|
|
||||||
if i == processing_panel_len and route.routing_type == '解除装夹':
|
|
||||||
workorders_values.append(
|
|
||||||
self.env['mrp.workorder'].json_workorder_str(k, production, route))
|
|
||||||
production.workorder_ids = workorders_values
|
|
||||||
for workorder in production.workorder_ids:
|
|
||||||
workorder.duration_expected = workorder._get_duration_expected()
|
|
||||||
|
|
||||||
|
|
||||||
class StockRule(models.Model):
|
class StockRule(models.Model):
|
||||||
_inherit = 'stock.rule'
|
_inherit = 'stock.rule'
|
||||||
@@ -277,7 +187,7 @@ class ProductionLot(models.Model):
|
|||||||
def generate_lot_names1(self, display_name, first_lot, count):
|
def generate_lot_names1(self, display_name, first_lot, count):
|
||||||
"""Generate `lot_names` from a string."""
|
"""Generate `lot_names` from a string."""
|
||||||
if first_lot.__contains__(display_name):
|
if first_lot.__contains__(display_name):
|
||||||
first_lot = first_lot[(len(display_name)+1):]
|
first_lot = first_lot[(len(display_name) + 1):]
|
||||||
|
|
||||||
# We look if the first lot contains at least one digit.
|
# We look if the first lot contains at least one digit.
|
||||||
caught_initial_number = regex_findall(r"\d+", first_lot)
|
caught_initial_number = regex_findall(r"\d+", first_lot)
|
||||||
@@ -313,4 +223,4 @@ class ProductionLot(models.Model):
|
|||||||
if last_serial:
|
if last_serial:
|
||||||
return self.env['stock.production.lot'].generate_lot_names1(product.display_name, last_serial.name, 2)[
|
return self.env['stock.production.lot'].generate_lot_names1(product.display_name, last_serial.name, 2)[
|
||||||
1]
|
1]
|
||||||
return "%s-%03d" %(product.display_name,1)
|
return "%s-%03d" % (product.display_name, 1)
|
||||||
59
sf_manufacturing_orders/models/tray.py
Normal file
59
sf_manufacturing_orders/models/tray.py
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of SmartGo. See LICENSE file for full copyright and licensing details.
|
||||||
|
import base64
|
||||||
|
from io import BytesIO
|
||||||
|
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||||
|
from pystrich.code128 import Code128Encoder
|
||||||
|
|
||||||
|
|
||||||
|
class Tray(models.Model):
|
||||||
|
_inherit = 'sf.tray'
|
||||||
|
_description = '托盘'
|
||||||
|
qr_image = fields.Binary(string="托盘二维码", compute='compute_qr_image')
|
||||||
|
production_id = fields.Many2one('mrp.production', string='制造订单',
|
||||||
|
related='workorder_id.production_id'
|
||||||
|
)
|
||||||
|
workorder_id = fields.Many2one('mrp.workorder', string="工单"
|
||||||
|
)
|
||||||
|
|
||||||
|
@api.onchange('production_id')
|
||||||
|
def updateTrayState(self):
|
||||||
|
|
||||||
|
if self.workorder_id != False:
|
||||||
|
self.state = '占用'
|
||||||
|
else:
|
||||||
|
self.state = '空闲'
|
||||||
|
|
||||||
|
def unclamp(self):
|
||||||
|
self.workorder_id = False
|
||||||
|
self.production_id = False
|
||||||
|
self.state = '空闲'
|
||||||
|
|
||||||
|
@api.depends('code')
|
||||||
|
def compute_qr_image(self):
|
||||||
|
for item in self:
|
||||||
|
if not item.code:
|
||||||
|
item.qr_image = False
|
||||||
|
continue
|
||||||
|
# 根据code动态生成二维码图片
|
||||||
|
# qr = qrcode.QRCode(
|
||||||
|
# version=1,
|
||||||
|
# error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||||||
|
# box_size=10,
|
||||||
|
# border=4,
|
||||||
|
# )
|
||||||
|
# qr.add_data(item.code)
|
||||||
|
# qr.make(fit=True)
|
||||||
|
# img = qr.make_image()
|
||||||
|
# 生成条形码文件
|
||||||
|
# bar = barcode.get("ean13", "123456789102", writer=ImageWriter())
|
||||||
|
# a = bar.get_fullcode()
|
||||||
|
# b = bar.save('occ')
|
||||||
|
# 生成条形码图片
|
||||||
|
partner_encoder = Code128Encoder(item.code)
|
||||||
|
# 转换bytes流
|
||||||
|
temp = BytesIO()
|
||||||
|
partner_encoder.save(temp)
|
||||||
|
# img.save(temp, format='PNG')
|
||||||
|
qr_image = base64.b64encode(temp.getvalue())
|
||||||
|
item.qr_image = qr_image
|
||||||
@@ -21,11 +21,11 @@
|
|||||||
<field name="name">打印条形码</field>
|
<field name="name">打印条形码</field>
|
||||||
<field name="model">sf.tray</field>
|
<field name="model">sf.tray</field>
|
||||||
<field name="report_type">qweb-pdf</field>
|
<field name="report_type">qweb-pdf</field>
|
||||||
<field name="report_name">sf_route_workcenter.sf_tray_template</field>
|
<field name="report_name">sf_manufacturing_orders.sf_tray_template</field>
|
||||||
<field name="report_file">sf_route_workcenter.sf_tray_template</field>
|
<field name="report_file">sf_manufacturing_orders.sf_tray_template</field>
|
||||||
<field name="binding_model_id" ref="model_sf_tray"/>
|
<field name="binding_model_id" ref="model_sf_tray"/>
|
||||||
<field name="binding_type">report</field>
|
<field name="binding_type">report</field>
|
||||||
<field name="paperformat_id" ref="sf_route_workcenter.sf_tray1"/>
|
<field name="paperformat_id" ref="sf_manufacturing_orders.sf_tray1"/>
|
||||||
|
|
||||||
</record>
|
</record>
|
||||||
<!-- 托盘码打印模板-->
|
<!-- 托盘码打印模板-->
|
||||||
@@ -39,7 +39,6 @@
|
|||||||
t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
|
t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
|
||||||
<div t-field="o.code" style="text-align: center"/>
|
<div t-field="o.code" style="text-align: center"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
@@ -51,12 +50,11 @@
|
|||||||
<field name="name">打印产品信息</field>
|
<field name="name">打印产品信息</field>
|
||||||
<field name="model">mrp.workorder</field>
|
<field name="model">mrp.workorder</field>
|
||||||
<field name="report_type">qweb-pdf</field>
|
<field name="report_type">qweb-pdf</field>
|
||||||
<field name="report_name">sf_route_workcenter.sf_tray_template1</field>
|
<field name="report_name">sf_manufacturing_orders.sf_tray_template1</field>
|
||||||
<field name="report_file">sf_route_workcenter.sf_tray_template1</field>
|
<field name="report_file">sf_manufacturing_orders.sf_tray_template1</field>
|
||||||
<field name="binding_model_id" ref="model_mrp_workorder"/>
|
<field name="binding_model_id" ref="model_mrp_workorder"/>
|
||||||
<field name="binding_type">report</field>
|
<field name="binding_type">report</field>
|
||||||
<field name="paperformat_id" ref="sf_route_workcenter.sf_tray1"/>
|
<field name="paperformat_id" ref="sf_manufacturing_orders.sf_tray1"/>
|
||||||
|
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 产品信息打印模板-->
|
<!-- 产品信息打印模板-->
|
||||||
@@ -68,16 +66,10 @@
|
|||||||
<div t-field="o.production_id.name"
|
<div t-field="o.production_id.name"
|
||||||
t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
|
t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
|
||||||
<div t-field="o.production_id" style="text-align: center"/>
|
<div t-field="o.production_id" style="text-align: center"/>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
27
sf_manufacturing_orders/security/group_security.xml
Normal file
27
sf_manufacturing_orders/security/group_security.xml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record model="ir.module.category" id="module_category_employee">
|
||||||
|
<field name="name">员工</field>
|
||||||
|
<field name="sequence">1</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.module.category" id="module_category_manage">
|
||||||
|
<field name="name">管理</field>
|
||||||
|
<field name="sequence">2</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <!– 系统管理相关 –>-->
|
||||||
|
<!-- <record id="group_master_data_manager" model="res.groups">-->
|
||||||
|
<!-- <field name="name">基础设置</field>-->
|
||||||
|
<!-- <field name="category_id" ref="base.module_category_employee"/>-->
|
||||||
|
<!-- <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>-->
|
||||||
|
<!-- </record>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
9
sf_manufacturing_orders/security/ir.model.access.csv
Normal file
9
sf_manufacturing_orders/security/ir.model.access.csv
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
|
access_sf_cnc_processing,sf_cnc_processing,model_sf_cnc_processing,base.group_user,1,1,1,1
|
||||||
|
access_sf_model_type,sf_model_type,model_sf_model_type,base.group_user,1,1,1,1
|
||||||
|
access_sf_model_type_routing_sort,sf_model_type_routing_sort,model_sf_model_type_routing_sort,base.group_user,1,1,1,1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
73
sf_manufacturing_orders/views/model_type_view.xml
Normal file
73
sf_manufacturing_orders/views/model_type_view.xml
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
#------------------模型类型------------------
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="search_sf_model_type_view">
|
||||||
|
<field name="name">search.sf.model.type</field>
|
||||||
|
<field name="model">sf.model.type</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<search string="模型类型">
|
||||||
|
<field name="name" string="模糊搜索"
|
||||||
|
filter_domain="[('name', 'ilike', self)]"/>
|
||||||
|
</search>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="tree_sf_model_type_view">
|
||||||
|
<field name="name">tree.sf.model.type</field>
|
||||||
|
<field name="model">sf.model.type</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="模型类型">
|
||||||
|
<field name="name"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="form_sf_model_type">
|
||||||
|
<field name="name">form.sf.model.type</field>
|
||||||
|
<field name="model">sf.model.type</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="模型类型">
|
||||||
|
<group>
|
||||||
|
<field name="name" required="1"/>
|
||||||
|
<field name="embryo_tolerance" required="1"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name='routing_tmpl_ids'>
|
||||||
|
<tree editable='bottom'>
|
||||||
|
<field name="sequence" widget="handle" string="序号"/>
|
||||||
|
<field name="route_workcenter_id" string="工序"/>
|
||||||
|
<field name="routing_type" string="类型"/>
|
||||||
|
<field name="is_repeat" string="重复"/>
|
||||||
|
<field name="workcenter_ids" string="工作中心" widget="many2many_tags"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</group>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_sf_model_type" model="ir.actions.act_window">
|
||||||
|
<field name="name">模型类型</field>
|
||||||
|
<field name="type">ir.actions.act_window</field>
|
||||||
|
<field name="res_model">sf.model.type</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_smiling_face">
|
||||||
|
[模型类型] 还没有哦!点左上角的[创建]按钮,沙发归你了!
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem
|
||||||
|
id="menu_sf_model_type"
|
||||||
|
name="模型类型"
|
||||||
|
parent="mrp.menu_mrp_configuration"
|
||||||
|
sequence="10"
|
||||||
|
action="action_sf_model_type"
|
||||||
|
/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@@ -7,30 +7,35 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//div[@name='button_box']" position="inside">
|
<xpath expr="//div[@name='button_box']" position="inside">
|
||||||
<button name="button_mrp_workcenter" type="object" class="oe_stat_button"
|
<button name="button_mrp_workcenter" type="object" class="oe_stat_button"
|
||||||
icon="fa-cogs" string="Work Center" attrs="{'invisible': [('workcenter_id', '=', False)]}" groups="mrp.group_mrp_routings">
|
icon="fa-cogs" string="Work Center" attrs="{'invisible': [('workcenter_id', '=', False)]}"
|
||||||
|
groups="mrp.group_mrp_routings">
|
||||||
</button>
|
</button>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='location']" position="after">
|
<xpath expr="//field[@name='location']" position="after">
|
||||||
<field name="workcenter_id" context="{'default_company_id':company_id}" groups="mrp.group_mrp_routings"/>
|
<field name="workcenter_id" context="{'default_company_id':company_id}"
|
||||||
|
groups="mrp.group_mrp_routings"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//group[@name='maintenance']" position="after">
|
<xpath expr="//group[@name='maintenance']" position="after">
|
||||||
<group name="statistics">
|
<group name="statistics">
|
||||||
<label for="expected_mtbf" string="Expected Mean Time Between Failure"/>
|
<label for="expected_mtbf" string="Expected Mean Time Between Failure"/>
|
||||||
<div class="o_row">
|
<div class="o_row">
|
||||||
<field name="expected_mtbf"/> days
|
<field name="expected_mtbf"/>
|
||||||
|
days
|
||||||
</div>
|
</div>
|
||||||
<label for="mtbf" string="Mean Time Between Failure"/>
|
<label for="mtbf" string="Mean Time Between Failure"/>
|
||||||
<div class="o_row">
|
<div class="o_row">
|
||||||
<field name="mtbf" /> days
|
<field name="mtbf"/>
|
||||||
|
days
|
||||||
</div>
|
</div>
|
||||||
<label for="estimated_next_failure" string="Estimated Next Failure"/>
|
<label for="estimated_next_failure" string="Estimated Next Failure"/>
|
||||||
<div class="o_row">
|
<div class="o_row">
|
||||||
<field name="estimated_next_failure" />
|
<field name="estimated_next_failure"/>
|
||||||
</div>
|
</div>
|
||||||
<field name="latest_failure_date" string="Latest Failure" />
|
<field name="latest_failure_date" string="Latest Failure"/>
|
||||||
<label for="mttr" string="Mean Time To Repair"/>
|
<label for="mttr" string="Mean Time To Repair"/>
|
||||||
<div class="o_row">
|
<div class="o_row">
|
||||||
<field name="mttr" /> days
|
<field name="mttr"/>
|
||||||
|
days
|
||||||
</div>
|
</div>
|
||||||
</group>
|
</group>
|
||||||
</xpath>
|
</xpath>
|
||||||
@@ -46,7 +51,9 @@
|
|||||||
<field name="production_company_id" invisible="1"/>
|
<field name="production_company_id" invisible="1"/>
|
||||||
<field name="workorder_id" invisible="1"/>
|
<field name="workorder_id" invisible="1"/>
|
||||||
<field name="production_id" options="{'no_create': True, 'no_open': True}"/>
|
<field name="production_id" options="{'no_create': True, 'no_open': True}"/>
|
||||||
<field name="workorder_id" attrs="{'invisible': [('production_id', '=', False)]}" options="{'no_create': True, 'no_open': True}" domain="[('production_id', '=', production_id)]" groups="mrp.group_mrp_routings"/>
|
<field name="workorder_id" attrs="{'invisible': [('production_id', '=', False)]}"
|
||||||
|
options="{'no_create': True, 'no_open': True}" domain="[('production_id', '=', production_id)]"
|
||||||
|
groups="mrp.group_mrp_routings"/>
|
||||||
<!-- <field name="repair_id"/> -->
|
<!-- <field name="repair_id"/> -->
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//div[hasclass('oe_chatter')]" position="after">
|
<xpath expr="//div[hasclass('oe_chatter')]" position="after">
|
||||||
@@ -58,7 +65,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
<field name="equipment_id" position="attributes">
|
<field name="equipment_id" position="attributes">
|
||||||
<attribute name="domain">['|', (not workorder_id and 1 or 0, '=', 1), '|', ('workcenter_id', '=', False), ('workcenter_id.order_ids', 'in', workorder_id)]</attribute>
|
<attribute name="domain">['|', (not workorder_id and 1 or 0, '=', 1), '|', ('workcenter_id', '=',
|
||||||
|
False), ('workcenter_id.order_ids', 'in', workorder_id)]
|
||||||
|
</attribute>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -69,27 +78,28 @@
|
|||||||
<field name="inherit_id" ref="maintenance.hr_equipment_request_view_search"/>
|
<field name="inherit_id" ref="maintenance.hr_equipment_request_view_search"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='maintenance_team_id']" position="after">
|
<xpath expr="//field[@name='maintenance_team_id']" position="after">
|
||||||
<field name="production_id" string="Operation" filter_domain="['|', ('production_id', 'ilike', self), ('workorder_id', 'ilike', self)]"/>
|
<field name="production_id" string="Operation"
|
||||||
|
filter_domain="['|', ('production_id', 'ilike', self), ('workorder_id', 'ilike', self)]"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="maintenance.menu_equipment_form"
|
id="maintenance.menu_equipment_form"
|
||||||
name="Equipments"
|
name="Equipments"
|
||||||
parent="maintenance.menu_maintenance_title"
|
parent="maintenance.menu_maintenance_title"
|
||||||
groups="maintenance.group_equipment_manager,base.group_user"
|
groups="maintenance.group_equipment_manager,base.group_user"
|
||||||
sequence="2"/>
|
sequence="2"/>
|
||||||
<menuitem id="menu_workcenter_tree"
|
<menuitem id="menu_workcenter_tree"
|
||||||
action="mrp.mrp_workcenter_action"
|
action="mrp.mrp_workcenter_action"
|
||||||
groups="mrp.group_mrp_routings"
|
groups="mrp.group_mrp_routings"
|
||||||
parent="maintenance.menu_equipment_form"
|
parent="maintenance.menu_equipment_form"
|
||||||
sequence="1"/>
|
sequence="1"/>
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_equipment_dashboard"
|
id="menu_equipment_dashboard"
|
||||||
name="Machines & Tools"
|
name="Machines & Tools"
|
||||||
parent="maintenance.menu_equipment_form"
|
parent="maintenance.menu_equipment_form"
|
||||||
action="maintenance.hr_equipment_action"
|
action="maintenance.hr_equipment_action"
|
||||||
sequence="2"/>
|
sequence="2"/>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
#-----------------作业-------------------
|
|
||||||
<record model="ir.ui.view" id="view_mrp_routing_workcenter_form_inherit_sf">
|
<record model="ir.ui.view" id="view_mrp_routing_workcenter_form_inherit_sf">
|
||||||
<field name="name">mrp.routing.workcenter.form.inherit.sf</field>
|
<field name="name">mrp.routing.workcenter.form.inherit.sf</field>
|
||||||
<field name="model">mrp.routing.workcenter</field>
|
<field name="model">mrp.routing.workcenter</field>
|
||||||
@@ -16,63 +15,5 @@
|
|||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
#-----------------工单-------------------
|
|
||||||
<record model="ir.ui.view" id="view_mrp_production_workorder_form_inherit_sf">
|
|
||||||
<field name="name">mrp.production.workorder.form.inherit.sf</field>
|
|
||||||
<field name="model">mrp.workorder</field>
|
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="production_id" position="after">
|
|
||||||
<field name="processing_panel" readonly="1"/>
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<!-- <record model="ir.ui.view" id="view_mrp_production_workorder_tree_inherit_sf">-->
|
|
||||||
<!-- <field name="name">mrp.production.workorder.tree.inherit.sf</field>-->
|
|
||||||
<!-- <field name="model">mrp.workorder</field>-->
|
|
||||||
<!-- <field name="inherit_id" ref="mrp.mrp_production_workorder_tree_view"/>-->
|
|
||||||
<!-- <field name="arch" type="xml">-->
|
|
||||||
<!-- <field name="workcenter_id" position="replace">-->
|
|
||||||
<!-- <filter name="workcenter_ids" string="工作中心" />-->
|
|
||||||
<!-- </field>-->
|
|
||||||
<!-- </field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
|
|
||||||
<!-- <record model="ir.ui.view" id="view_mrp_production_workorder_filter_inherit_sf">-->
|
|
||||||
<!-- <field name="name">mrp.production.workorder.filter.inherit.sf</field>-->
|
|
||||||
<!-- <field name="model">mrp.workorder</field>-->
|
|
||||||
<!-- <field name="inherit_id" ref="mrp.view_mrp_production_workorder_form_view_filter"/>-->
|
|
||||||
<!-- <field name="arch" type="xml">-->
|
|
||||||
<!-- <xpath expr="//filter[@name='work_center']" position="replace">-->
|
|
||||||
<!-- <filter name="work_center" string="工作中心" context="{'group_by': 'workcenter_ids'}"/>-->
|
|
||||||
<!-- </xpath>-->
|
|
||||||
<!-- </field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
|
|
||||||
#-----------------制造订单里的工单-------------------
|
|
||||||
<record model="ir.ui.view" id="view_mrp_production_workorder_tree_editable_inherit_sf">
|
|
||||||
<field name="name">mrp.production.workorder.tree.editable.inherit.sf</field>
|
|
||||||
<field name="model">mrp.workorder</field>
|
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_tree_editable_view"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="name" position="after">
|
|
||||||
<field name="processing_panel"/>
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
#-----------------工作中心-------------------
|
|
||||||
<record model="ir.ui.view" id="view_mrp_workcenter_form_inherit_sf">
|
|
||||||
<field name="name">mrp.workcenter.form.inherit.sf</field>
|
|
||||||
<field name="model">mrp.workcenter</field>
|
|
||||||
<field name="inherit_id" ref="mrp.mrp_workcenter_view"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<xpath expr="//field[@name='alternative_workcenter_ids']" position="after">
|
|
||||||
<field name="machine_tool_id"/>
|
|
||||||
</xpath>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<!-- MRP.WORKCENTER -->
|
<!-- MRP.WORKCENTER -->
|
||||||
<record id="mrp_workcenter_view_form_inherit_maintenance" model="ir.ui.view">
|
<record model="ir.ui.view" id="view_mrp_workcenter_form_inherit_sf">
|
||||||
<field name="name">mrp.workcenter.form.inherit.maintenance</field>
|
<field name="name">mrp.workcenter.form.inherit.sf</field>
|
||||||
<field name="model">mrp.workcenter</field>
|
<field name="model">mrp.workcenter</field>
|
||||||
<field name="inherit_id" ref="mrp.mrp_workcenter_view"/>
|
<field name="inherit_id" ref="mrp.mrp_workcenter_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
@@ -20,6 +20,10 @@
|
|||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//field[@name='alternative_workcenter_ids']" position="after">
|
||||||
|
<field name="machine_tool_id"/>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@@ -46,9 +50,13 @@
|
|||||||
<button name="button_maintenance_req" type="object" string="Maintenance Request"/>
|
<button name="button_maintenance_req" type="object" string="Maintenance Request"/>
|
||||||
</button>
|
</button>
|
||||||
<div name="button_box" position="inside">
|
<div name="button_box" position="inside">
|
||||||
<button name="open_maintenance_request_mo" type="object" class="oe_stat_button" icon="fa-wrench" attrs="{'invisible': [('maintenance_count', '=', 0)]}" context="{'search_default_production_id': active_id}">
|
<button name="open_maintenance_request_mo" type="object" class="oe_stat_button" icon="fa-wrench"
|
||||||
|
attrs="{'invisible': [('maintenance_count', '=', 0)]}"
|
||||||
|
context="{'search_default_production_id': active_id}">
|
||||||
<div class="o_field_widget o_stat_info">
|
<div class="o_field_widget o_stat_info">
|
||||||
<span class="o_stat_value"><field name="maintenance_count"/></span>
|
<span class="o_stat_value">
|
||||||
|
<field name="maintenance_count"/>
|
||||||
|
</span>
|
||||||
<span class="o_stat_text">Maintenance</span>
|
<span class="o_stat_text">Maintenance</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
258
sf_manufacturing_orders/views/mrp_workorder_view.xml
Normal file
258
sf_manufacturing_orders/views/mrp_workorder_view.xml
Normal file
@@ -0,0 +1,258 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<record model="ir.ui.view" id="view_mrp_production_workorder_tree_editable_inherit_sf">
|
||||||
|
<field name="name">mrp.production.workorder.tree.editable.inherit.sf</field>
|
||||||
|
<field name="model">mrp.workorder</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_production_workorder_tree_editable_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="name" position="before">
|
||||||
|
<field name="sequence"/>
|
||||||
|
</field>
|
||||||
|
<field name="name" position="after">
|
||||||
|
<field name="processing_panel"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.actions.act_window" id="mrp_workorder_action_tablet">
|
||||||
|
<field name="name">Work Orders</field>
|
||||||
|
<field name="type">ir.actions.act_window</field>
|
||||||
|
<field name="res_model">mrp.workorder</field>
|
||||||
|
<field name="view_mode">kanban,tree,form</field>
|
||||||
|
<field name="view_ids" eval="[(5, 0, 0),
|
||||||
|
(0, 0, {'view_mode': 'kanban', 'view_id': ref('mrp.workcenter_line_kanban')}),
|
||||||
|
(0, 0, {'view_mode': 'tree', 'view_id': ref('mrp.mrp_production_workorder_tree_editable_view')}) ]"/>
|
||||||
|
<field name="target">fullscreen</field>
|
||||||
|
<field name="domain">[('state', 'not in', ['done', 'cancel'])]</field>
|
||||||
|
<field name="context">{'search_default_workcenter_id': active_id}</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_workorder">
|
||||||
|
No work orders to do!
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Work orders are operations to do as part of a manufacturing order.
|
||||||
|
Operations are defined in the bill of materials or added in the manufacturing order directly.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Use the table work center control panel to register operations in the shop floor directly.
|
||||||
|
The tablet provides worksheets for your workers and allow them to scrap products, track time,
|
||||||
|
launch a maintenance request, perform quality tests, etc.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="view_mrp_production_workorder_form_inherit_sf">
|
||||||
|
<field name="name">mrp.production.workorder.form.inherit.sf</field>
|
||||||
|
<field name="model">mrp.workorder</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="production_id" position="after">
|
||||||
|
<field name="processing_panel" readonly="1"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_mrp_production_workorder_tray_form_inherit_sf" model="ir.ui.view">
|
||||||
|
<field name="name">mrp.production.workorder.tray.form.inherit.sf</field>
|
||||||
|
<field name="model">mrp.workorder</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//page[last()]" position="after">
|
||||||
|
<page string="获取CNC加工程序" attrs='{"invisible": [("routing_type","!=","获取CNC加工程序")]}'>
|
||||||
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
|
<button type="object" class="oe_highlight" name="fetchCNC" string="获取CNC程序代码"/>
|
||||||
|
</div>
|
||||||
|
</page>
|
||||||
|
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//page[last()]" position="after">
|
||||||
|
<page string="装夹托盘" attrs='{"invisible": [("routing_type","!=","装夹")]}'>
|
||||||
|
<group>
|
||||||
|
<field name="routing_type" invisible="1"/>
|
||||||
|
<field name="processing_panel" readonly="1"/>
|
||||||
|
<field name="tray_code"/>
|
||||||
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
|
<button type="object" class="oe_highlight" name="gettray" string="绑定托盘"
|
||||||
|
attrs='{"invisible": [("production_id","=",False)]}'/>
|
||||||
|
</div>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
|
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//page[last()]" position="after">
|
||||||
|
<page string="三元前置检测定位参数" attrs='{"invisible": [("routing_type","!=","前置三元定位检测")]}'>
|
||||||
|
<group>
|
||||||
|
<group>
|
||||||
|
<field name="processing_panel" readonly="1"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<div>左面:</div>
|
||||||
|
<div></div>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<label for="X1_axis" string="x1"/>
|
||||||
|
<field name="X1_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Y1_axis" string="y1"/>
|
||||||
|
<field name="Y1_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Z1_axis" string="z1"/>
|
||||||
|
<field name="Z1_axis" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<label for="X2_axis" string="x2"/>
|
||||||
|
<field name="X2_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Y2_axis" string="y2"/>
|
||||||
|
<field name="Y2_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Z2_axis" string="z2"/>
|
||||||
|
<field name="Z2_axis" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<div>前面:</div>
|
||||||
|
<div></div>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<label for="X3_axis" string="x1"/>
|
||||||
|
<field name="X3_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Y3_axis" string="y1"/>
|
||||||
|
<field name="Y3_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Z3_axis" string="z1"/>
|
||||||
|
<field name="Z3_axis" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<label for="X4_axis" string="x2"/>
|
||||||
|
<field name="X4_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Y4_axis" string="y2"/>
|
||||||
|
<field name="Y4_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Z4_axis" string="z2"/>
|
||||||
|
<field name="Z4_axis" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<div>右面:</div>
|
||||||
|
<div></div>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<label for="X5_axis" string="x1"/>
|
||||||
|
<field name="X5_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Y5_axis" string="y1"/>
|
||||||
|
<field name="Y5_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Z5_axis" string="z1"/>
|
||||||
|
<field name="Z5_axis" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<label for="X6_axis" string="x2"/>
|
||||||
|
<field name="X6_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Y6_axis" string="y2"/>
|
||||||
|
<field name="Y6_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Z6_axis" string="z2"/>
|
||||||
|
<field name="Z6_axis" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<div>后面:</div>
|
||||||
|
<div></div>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<label for="X7_axis" string="x1"/>
|
||||||
|
<field name="X7_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Y7_axis" string="y1"/>
|
||||||
|
<field name="Y7_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Z7_axis" string="z1"/>
|
||||||
|
<field name="Z7_axis" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<label for="X8_axis" string="x2"/>
|
||||||
|
<field name="X8_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Y8_axis" string="y2"/>
|
||||||
|
<field name="Y8_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Z8_axis" string="z2"/>
|
||||||
|
<field name="Z8_axis" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<div>上面:</div>
|
||||||
|
<div></div>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<label for="X9_axis" string="x1"/>
|
||||||
|
<field name="X9_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Y9_axis" string="y1"/>
|
||||||
|
<field name="Y9_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Z9_axis" string="z1"/>
|
||||||
|
<field name="Z9_axis" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<label for="X10_axis" string="x2"/>
|
||||||
|
<field name="X10_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Y10_axis" string="y2"/>
|
||||||
|
<field name="Y10_axis" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="Z10_axis" string="z2"/>
|
||||||
|
<field name="Z10_axis" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
|
<button type="object" class="oe_highlight" name="getcenter" string="计算定位"/>
|
||||||
|
</div>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="material_center_point"/>
|
||||||
|
<field name='X_deviation_angle'/>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//page[last()]" position="after">
|
||||||
|
<page string="CNC程序" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||||
|
<field name="cnc_ids" widget="one2many">
|
||||||
|
<tree>
|
||||||
|
<field name="cnc_id"/>
|
||||||
|
<field name="FNo"/>
|
||||||
|
<field name="FPGName"/>
|
||||||
|
<field name="FKnifeName"/>
|
||||||
|
<field name="FDNo"/>
|
||||||
|
<field name="FWorkType"/>
|
||||||
|
<field name="FXY"/>
|
||||||
|
<field name="FZ"/>
|
||||||
|
<field name="FJGSD"/>
|
||||||
|
<field name="FSCCD"/>
|
||||||
|
<field name="FDJSpec"/>
|
||||||
|
<field name="FJGDate"/>
|
||||||
|
<field name="FComment"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</page>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//page[last()]" position="after">
|
||||||
|
<page string="后置三元检测" attrs='{"invisible": [("routing_type","!=","后置三元质量检测")]}'>
|
||||||
|
<group>
|
||||||
|
<field name="test_results" widget="selection"/>
|
||||||
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
|
<button type="object" class="oe_highlight" name="recreateManufacturingOrWorkerOrder"
|
||||||
|
string="检测确认"/>
|
||||||
|
</div>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//page[last()]" position="after">
|
||||||
|
<page string="解除装夹" attrs='{"invisible": [("routing_type","!=","解除装夹")]}'>
|
||||||
|
<group>
|
||||||
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
|
<button type="object" class="oe_highlight" name="unbindtray" string="解除装夹"/>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
|
<!-- <button type="action" class="oe_highlight" name="sf_manufacturing_orders.label_sf_tray_code1"-->
|
||||||
|
<!-- string="打印标签"/>-->
|
||||||
|
</div>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<!-- view common to both template and product -->
|
|
||||||
<record id="view_template_property_form" model="ir.ui.view">
|
|
||||||
<field name="name">product.template.stock.property.form.inherit</field>
|
|
||||||
<field name="model">product.template</field>
|
|
||||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<xpath expr="//group[@name='operations']" position="inside">
|
|
||||||
<group>
|
|
||||||
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<group string="订单规则">
|
|
||||||
<field name="single_manufacturing" string="单个制造" widget="checkbox"/>
|
|
||||||
|
|
||||||
</group>
|
|
||||||
</xpath>
|
|
||||||
|
|
||||||
<page name="inventory" position="inside">
|
|
||||||
<group>
|
|
||||||
<group string="Description for Receipts">
|
|
||||||
<field name="description_pickingin" nolabel="1" placeholder="This note is added to receipt orders (e.g. where to store the product in the warehouse)."/>
|
|
||||||
</group>
|
|
||||||
<group string="Description for Delivery Orders">
|
|
||||||
<field name="description_pickingout" nolabel="1" placeholder="This note is added to delivery orders."/>
|
|
||||||
</group>
|
|
||||||
<group string="Description for Internal Transfers" groups="stock.group_stock_multi_locations">
|
|
||||||
<field name="description_picking" placeholder="This note is added to internal transfer orders (e.g. where to pick the product in the warehouse)." nolabel="1"/>
|
|
||||||
</group>
|
|
||||||
</group>
|
|
||||||
</page>
|
|
||||||
<page name="inventory" position="attributes">
|
|
||||||
<attribute name="groups">stock.group_stock_user,product.group_stock_packaging</attribute>
|
|
||||||
</page>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
=======================
|
|
||||||
MRP Work Order Sequence
|
|
||||||
=======================
|
|
||||||
|
|
||||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
!! This file is generated by oca-gen-addon-readme !!
|
|
||||||
!! changes will be overwritten. !!
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
|
|
||||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
||||||
:target: https://odoo-community.org/page/development-status
|
|
||||||
:alt: Beta
|
|
||||||
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
|
|
||||||
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
|
|
||||||
:alt: License: LGPL-3
|
|
||||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
|
|
||||||
:target: https://github.com/OCA/manufacture/tree/15.0/mrp_workorder_sequence
|
|
||||||
:alt: OCA/manufacture
|
|
||||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
||||||
:target: https://translation.odoo-community.org/projects/manufacture-15-0/manufacture-15-0-mrp_workorder_sequence
|
|
||||||
:alt: Translate me on Weblate
|
|
||||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
|
||||||
:target: https://runbot.odoo-community.org/runbot/129/15.0
|
|
||||||
:alt: Try me on Runbot
|
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
||||||
|
|
||||||
Provide a new field sequence on production orders's work orders, that provides
|
|
||||||
clear information on the process order of those.
|
|
||||||
|
|
||||||
**Table of contents**
|
|
||||||
|
|
||||||
.. contents::
|
|
||||||
:local:
|
|
||||||
|
|
||||||
Usage
|
|
||||||
=====
|
|
||||||
|
|
||||||
Go to any production order with a routing set and check its work orders.
|
|
||||||
|
|
||||||
Bug Tracker
|
|
||||||
===========
|
|
||||||
|
|
||||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/issues>`_.
|
|
||||||
In case of trouble, please check there if your issue has already been reported.
|
|
||||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
|
||||||
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_workorder_sequence%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
||||||
|
|
||||||
Do not contact contributors directly about support or help with technical issues.
|
|
||||||
|
|
||||||
Credits
|
|
||||||
=======
|
|
||||||
|
|
||||||
Authors
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
* ForgeFlow
|
|
||||||
|
|
||||||
Contributors
|
|
||||||
~~~~~~~~~~~~
|
|
||||||
|
|
||||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
|
||||||
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
|
|
||||||
* Christopher Ormaza <chris.ormaza@forgeflow.com>
|
|
||||||
|
|
||||||
Maintainers
|
|
||||||
~~~~~~~~~~~
|
|
||||||
|
|
||||||
This module is maintained by the OCA.
|
|
||||||
|
|
||||||
.. image:: https://odoo-community.org/logo.png
|
|
||||||
:alt: Odoo Community Association
|
|
||||||
:target: https://odoo-community.org
|
|
||||||
|
|
||||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
||||||
mission is to support the collaborative development of Odoo features and
|
|
||||||
promote its widespread use.
|
|
||||||
|
|
||||||
.. |maintainer-LoisRForgeFlow| image:: https://github.com/LoisRForgeFlow.png?size=40px
|
|
||||||
:target: https://github.com/LoisRForgeFlow
|
|
||||||
:alt: LoisRForgeFlow
|
|
||||||
|
|
||||||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|
||||||
|
|
||||||
|maintainer-LoisRForgeFlow|
|
|
||||||
|
|
||||||
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/15.0/mrp_workorder_sequence>`_ project on GitHub.
|
|
||||||
|
|
||||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
|
||||||
|
|
||||||
from . import models
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
from . import mrp_production
|
|
||||||
from . import mrp_workorder
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from odoo import models
|
|
||||||
|
|
||||||
|
|
||||||
class MrpProduction(models.Model):
|
|
||||||
_inherit = "mrp.production"
|
|
||||||
|
|
||||||
def _reset_work_order_sequence(self):
|
|
||||||
for rec in self:
|
|
||||||
current_sequence = 1
|
|
||||||
for work in rec.workorder_ids:
|
|
||||||
work.sequence = current_sequence
|
|
||||||
current_sequence += 1
|
|
||||||
|
|
||||||
def _create_workorder(self):
|
|
||||||
res = super()._create_workorder()
|
|
||||||
self._reset_work_order_sequence()
|
|
||||||
return res
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from odoo import fields, models
|
|
||||||
|
|
||||||
|
|
||||||
class MrpWorkOrder(models.Model):
|
|
||||||
_inherit = "mrp.workorder"
|
|
||||||
_order = 'sequence'
|
|
||||||
|
|
||||||
sequence = fields.Integer(string='工序')
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.2 KiB |
@@ -1,429 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
|
||||||
<title>MRP Work Order Sequence</title>
|
|
||||||
<style type="text/css">
|
|
||||||
|
|
||||||
/*
|
|
||||||
:Author: David Goodger (goodger@python.org)
|
|
||||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
|
||||||
:Copyright: This stylesheet has been placed in the public domain.
|
|
||||||
|
|
||||||
Default cascading style sheet for the HTML output of Docutils.
|
|
||||||
|
|
||||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
|
||||||
customize this style sheet.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* used to remove borders from tables and images */
|
|
||||||
.borderless, table.borderless td, table.borderless th {
|
|
||||||
border: 0 }
|
|
||||||
|
|
||||||
table.borderless td, table.borderless th {
|
|
||||||
/* Override padding for "table.docutils td" with "! important".
|
|
||||||
The right padding separates the table cells. */
|
|
||||||
padding: 0 0.5em 0 0 ! important }
|
|
||||||
|
|
||||||
.first {
|
|
||||||
/* Override more specific margin styles with "! important". */
|
|
||||||
margin-top: 0 ! important }
|
|
||||||
|
|
||||||
.last, .with-subtitle {
|
|
||||||
margin-bottom: 0 ! important }
|
|
||||||
|
|
||||||
.hidden {
|
|
||||||
display: none }
|
|
||||||
|
|
||||||
.subscript {
|
|
||||||
vertical-align: sub;
|
|
||||||
font-size: smaller }
|
|
||||||
|
|
||||||
.superscript {
|
|
||||||
vertical-align: super;
|
|
||||||
font-size: smaller }
|
|
||||||
|
|
||||||
a.toc-backref {
|
|
||||||
text-decoration: none ;
|
|
||||||
color: black }
|
|
||||||
|
|
||||||
blockquote.epigraph {
|
|
||||||
margin: 2em 5em ; }
|
|
||||||
|
|
||||||
dl.docutils dd {
|
|
||||||
margin-bottom: 0.5em }
|
|
||||||
|
|
||||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
|
||||||
dl.docutils dt {
|
|
||||||
font-weight: bold }
|
|
||||||
*/
|
|
||||||
|
|
||||||
div.abstract {
|
|
||||||
margin: 2em 5em }
|
|
||||||
|
|
||||||
div.abstract p.topic-title {
|
|
||||||
font-weight: bold ;
|
|
||||||
text-align: center }
|
|
||||||
|
|
||||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
|
||||||
div.hint, div.important, div.note, div.tip, div.warning {
|
|
||||||
margin: 2em ;
|
|
||||||
border: medium outset ;
|
|
||||||
padding: 1em }
|
|
||||||
|
|
||||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
|
||||||
div.important p.admonition-title, div.note p.admonition-title,
|
|
||||||
div.tip p.admonition-title {
|
|
||||||
font-weight: bold ;
|
|
||||||
font-family: sans-serif }
|
|
||||||
|
|
||||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
|
||||||
div.danger p.admonition-title, div.error p.admonition-title,
|
|
||||||
div.warning p.admonition-title, .code .error {
|
|
||||||
color: red ;
|
|
||||||
font-weight: bold ;
|
|
||||||
font-family: sans-serif }
|
|
||||||
|
|
||||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
|
||||||
compound paragraphs.
|
|
||||||
div.compound .compound-first, div.compound .compound-middle {
|
|
||||||
margin-bottom: 0.5em }
|
|
||||||
|
|
||||||
div.compound .compound-last, div.compound .compound-middle {
|
|
||||||
margin-top: 0.5em }
|
|
||||||
*/
|
|
||||||
|
|
||||||
div.dedication {
|
|
||||||
margin: 2em 5em ;
|
|
||||||
text-align: center ;
|
|
||||||
font-style: italic }
|
|
||||||
|
|
||||||
div.dedication p.topic-title {
|
|
||||||
font-weight: bold ;
|
|
||||||
font-style: normal }
|
|
||||||
|
|
||||||
div.figure {
|
|
||||||
margin-left: 2em ;
|
|
||||||
margin-right: 2em }
|
|
||||||
|
|
||||||
div.footer, div.header {
|
|
||||||
clear: both;
|
|
||||||
font-size: smaller }
|
|
||||||
|
|
||||||
div.line-block {
|
|
||||||
display: block ;
|
|
||||||
margin-top: 1em ;
|
|
||||||
margin-bottom: 1em }
|
|
||||||
|
|
||||||
div.line-block div.line-block {
|
|
||||||
margin-top: 0 ;
|
|
||||||
margin-bottom: 0 ;
|
|
||||||
margin-left: 1.5em }
|
|
||||||
|
|
||||||
div.sidebar {
|
|
||||||
margin: 0 0 0.5em 1em ;
|
|
||||||
border: medium outset ;
|
|
||||||
padding: 1em ;
|
|
||||||
background-color: #ffffee ;
|
|
||||||
width: 40% ;
|
|
||||||
float: right ;
|
|
||||||
clear: right }
|
|
||||||
|
|
||||||
div.sidebar p.rubric {
|
|
||||||
font-family: sans-serif ;
|
|
||||||
font-size: medium }
|
|
||||||
|
|
||||||
div.system-messages {
|
|
||||||
margin: 5em }
|
|
||||||
|
|
||||||
div.system-messages h1 {
|
|
||||||
color: red }
|
|
||||||
|
|
||||||
div.system-message {
|
|
||||||
border: medium outset ;
|
|
||||||
padding: 1em }
|
|
||||||
|
|
||||||
div.system-message p.system-message-title {
|
|
||||||
color: red ;
|
|
||||||
font-weight: bold }
|
|
||||||
|
|
||||||
div.topic {
|
|
||||||
margin: 2em }
|
|
||||||
|
|
||||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
|
||||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
|
||||||
margin-top: 0.4em }
|
|
||||||
|
|
||||||
h1.title {
|
|
||||||
text-align: center }
|
|
||||||
|
|
||||||
h2.subtitle {
|
|
||||||
text-align: center }
|
|
||||||
|
|
||||||
hr.docutils {
|
|
||||||
width: 75% }
|
|
||||||
|
|
||||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
|
||||||
clear: left ;
|
|
||||||
float: left ;
|
|
||||||
margin-right: 1em }
|
|
||||||
|
|
||||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
|
||||||
clear: right ;
|
|
||||||
float: right ;
|
|
||||||
margin-left: 1em }
|
|
||||||
|
|
||||||
img.align-center, .figure.align-center, object.align-center {
|
|
||||||
display: block;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.align-center {
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-left {
|
|
||||||
text-align: left }
|
|
||||||
|
|
||||||
.align-center {
|
|
||||||
clear: both ;
|
|
||||||
text-align: center }
|
|
||||||
|
|
||||||
.align-right {
|
|
||||||
text-align: right }
|
|
||||||
|
|
||||||
/* reset inner alignment in figures */
|
|
||||||
div.align-right {
|
|
||||||
text-align: inherit }
|
|
||||||
|
|
||||||
/* div.align-center * { */
|
|
||||||
/* text-align: left } */
|
|
||||||
|
|
||||||
.align-top {
|
|
||||||
vertical-align: top }
|
|
||||||
|
|
||||||
.align-middle {
|
|
||||||
vertical-align: middle }
|
|
||||||
|
|
||||||
.align-bottom {
|
|
||||||
vertical-align: bottom }
|
|
||||||
|
|
||||||
ol.simple, ul.simple {
|
|
||||||
margin-bottom: 1em }
|
|
||||||
|
|
||||||
ol.arabic {
|
|
||||||
list-style: decimal }
|
|
||||||
|
|
||||||
ol.loweralpha {
|
|
||||||
list-style: lower-alpha }
|
|
||||||
|
|
||||||
ol.upperalpha {
|
|
||||||
list-style: upper-alpha }
|
|
||||||
|
|
||||||
ol.lowerroman {
|
|
||||||
list-style: lower-roman }
|
|
||||||
|
|
||||||
ol.upperroman {
|
|
||||||
list-style: upper-roman }
|
|
||||||
|
|
||||||
p.attribution {
|
|
||||||
text-align: right ;
|
|
||||||
margin-left: 50% }
|
|
||||||
|
|
||||||
p.caption {
|
|
||||||
font-style: italic }
|
|
||||||
|
|
||||||
p.credits {
|
|
||||||
font-style: italic ;
|
|
||||||
font-size: smaller }
|
|
||||||
|
|
||||||
p.label {
|
|
||||||
white-space: nowrap }
|
|
||||||
|
|
||||||
p.rubric {
|
|
||||||
font-weight: bold ;
|
|
||||||
font-size: larger ;
|
|
||||||
color: maroon ;
|
|
||||||
text-align: center }
|
|
||||||
|
|
||||||
p.sidebar-title {
|
|
||||||
font-family: sans-serif ;
|
|
||||||
font-weight: bold ;
|
|
||||||
font-size: larger }
|
|
||||||
|
|
||||||
p.sidebar-subtitle {
|
|
||||||
font-family: sans-serif ;
|
|
||||||
font-weight: bold }
|
|
||||||
|
|
||||||
p.topic-title {
|
|
||||||
font-weight: bold }
|
|
||||||
|
|
||||||
pre.address {
|
|
||||||
margin-bottom: 0 ;
|
|
||||||
margin-top: 0 ;
|
|
||||||
font: inherit }
|
|
||||||
|
|
||||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|
||||||
margin-left: 2em ;
|
|
||||||
margin-right: 2em }
|
|
||||||
|
|
||||||
pre.code .ln { color: grey; } /* line numbers */
|
|
||||||
pre.code, code { background-color: #eeeeee }
|
|
||||||
pre.code .comment, code .comment { color: #5C6576 }
|
|
||||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
||||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
|
||||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
|
||||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
|
||||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
|
||||||
|
|
||||||
span.classifier {
|
|
||||||
font-family: sans-serif ;
|
|
||||||
font-style: oblique }
|
|
||||||
|
|
||||||
span.classifier-delimiter {
|
|
||||||
font-family: sans-serif ;
|
|
||||||
font-weight: bold }
|
|
||||||
|
|
||||||
span.interpreted {
|
|
||||||
font-family: sans-serif }
|
|
||||||
|
|
||||||
span.option {
|
|
||||||
white-space: nowrap }
|
|
||||||
|
|
||||||
span.pre {
|
|
||||||
white-space: pre }
|
|
||||||
|
|
||||||
span.problematic {
|
|
||||||
color: red }
|
|
||||||
|
|
||||||
span.section-subtitle {
|
|
||||||
/* font-size relative to parent (h1..h6 element) */
|
|
||||||
font-size: 80% }
|
|
||||||
|
|
||||||
table.citation {
|
|
||||||
border-left: solid 1px gray;
|
|
||||||
margin-left: 1px }
|
|
||||||
|
|
||||||
table.docinfo {
|
|
||||||
margin: 2em 4em }
|
|
||||||
|
|
||||||
table.docutils {
|
|
||||||
margin-top: 0.5em ;
|
|
||||||
margin-bottom: 0.5em }
|
|
||||||
|
|
||||||
table.footnote {
|
|
||||||
border-left: solid 1px black;
|
|
||||||
margin-left: 1px }
|
|
||||||
|
|
||||||
table.docutils td, table.docutils th,
|
|
||||||
table.docinfo td, table.docinfo th {
|
|
||||||
padding-left: 0.5em ;
|
|
||||||
padding-right: 0.5em ;
|
|
||||||
vertical-align: top }
|
|
||||||
|
|
||||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
|
||||||
font-weight: bold ;
|
|
||||||
text-align: left ;
|
|
||||||
white-space: nowrap ;
|
|
||||||
padding-left: 0 }
|
|
||||||
|
|
||||||
/* "booktabs" style (no vertical lines) */
|
|
||||||
table.docutils.booktabs {
|
|
||||||
border: 0px;
|
|
||||||
border-top: 2px solid;
|
|
||||||
border-bottom: 2px solid;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
table.docutils.booktabs * {
|
|
||||||
border: 0px;
|
|
||||||
}
|
|
||||||
table.docutils.booktabs th {
|
|
||||||
border-bottom: thin solid;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
|
||||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
|
||||||
font-size: 100% }
|
|
||||||
|
|
||||||
ul.auto-toc {
|
|
||||||
list-style-type: none }
|
|
||||||
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="document" id="mrp-work-order-sequence">
|
|
||||||
<h1 class="title">MRP Work Order Sequence</h1>
|
|
||||||
|
|
||||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
!! This file is generated by oca-gen-addon-readme !!
|
|
||||||
!! changes will be overwritten. !!
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
||||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/manufacture/tree/15.0/mrp_workorder_sequence"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/manufacture-15-0/manufacture-15-0-mrp_workorder_sequence"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/129/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
|
||||||
<p>Provide a new field sequence on production orders’s work orders, that provides
|
|
||||||
clear information on the process order of those.</p>
|
|
||||||
<p><strong>Table of contents</strong></p>
|
|
||||||
<div class="contents local topic" id="contents">
|
|
||||||
<ul class="simple">
|
|
||||||
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
|
|
||||||
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
|
|
||||||
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
|
|
||||||
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
|
|
||||||
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
|
|
||||||
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="section" id="usage">
|
|
||||||
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
|
|
||||||
<p>Go to any production order with a routing set and check its work orders.</p>
|
|
||||||
</div>
|
|
||||||
<div class="section" id="bug-tracker">
|
|
||||||
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
|
|
||||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/manufacture/issues">GitHub Issues</a>.
|
|
||||||
In case of trouble, please check there if your issue has already been reported.
|
|
||||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
|
||||||
<a class="reference external" href="https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_workorder_sequence%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
|
||||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
|
||||||
</div>
|
|
||||||
<div class="section" id="credits">
|
|
||||||
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
|
|
||||||
<div class="section" id="authors">
|
|
||||||
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
|
|
||||||
<ul class="simple">
|
|
||||||
<li>ForgeFlow</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="section" id="contributors">
|
|
||||||
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
|
|
||||||
<ul class="simple">
|
|
||||||
<li>Lois Rilo <<a class="reference external" href="mailto:lois.rilo@forgeflow.com">lois.rilo@forgeflow.com</a>></li>
|
|
||||||
<li>Pimolnat Suntian <<a class="reference external" href="mailto:pimolnats@ecosoft.co.th">pimolnats@ecosoft.co.th</a>></li>
|
|
||||||
<li>Christopher Ormaza <<a class="reference external" href="mailto:chris.ormaza@forgeflow.com">chris.ormaza@forgeflow.com</a>></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="section" id="maintainers">
|
|
||||||
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
|
|
||||||
<p>This module is maintained by the OCA.</p>
|
|
||||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
|
||||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
||||||
mission is to support the collaborative development of Odoo features and
|
|
||||||
promote its widespread use.</p>
|
|
||||||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
|
||||||
<p><a class="reference external" href="https://github.com/LoisRForgeFlow"><img alt="LoisRForgeFlow" src="https://github.com/LoisRForgeFlow.png?size=40px" /></a></p>
|
|
||||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/15.0/mrp_workorder_sequence">OCA/manufacture</a> project on GitHub.</p>
|
|
||||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<odoo>
|
|
||||||
<record id="mrp_production_workorder_tree_view_inherit" model="ir.ui.view">
|
|
||||||
<field name="name">mrp.workorder.tree</field>
|
|
||||||
<field name="model">mrp.workorder</field>
|
|
||||||
<field
|
|
||||||
name="inherit_id"
|
|
||||||
ref="mrp.mrp_production_workorder_tree_editable_view"
|
|
||||||
/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="name" position="before">
|
|
||||||
<field name="sequence" />
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
</odoo>
|
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
from . import controllers
|
from . import controllers
|
||||||
from . import models
|
from . import models
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
'website': 'https://www.sf.cs.jikimo.com',
|
'website': 'https://www.sf.cs.jikimo.com',
|
||||||
'depends': ['sf_base'],
|
'depends': ['sf_base'],
|
||||||
'data': [
|
'data': [
|
||||||
# 'views/sale_process_order_view.xml'
|
# 'data/ir_cron_data.xml',
|
||||||
|
'views/res_config_settings_views.xml'
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
<record model="ir.cron" id="sf_cron1">
|
<record model="ir.cron" id="sf_cron1">
|
||||||
<field name="name">同步资源库材料</field>
|
<field name="name">同步资源库材料</field>
|
||||||
<field name="model_id" ref="model_mrs_production_materials"/>
|
<field name="model_id" ref="model_sf_production_materials"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_production_materials()</field>
|
<field name="code">model.sync_production_materials()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -11,10 +11,9 @@
|
|||||||
<field name="doall" eval="False"/>
|
<field name="doall" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<record model="ir.cron" id="sf_cron2">
|
<record model="ir.cron" id="sf_cron2">
|
||||||
<field name="name">同步资源库材料型号</field>
|
<field name="name">同步资源库材料型号</field>
|
||||||
<field name="model_id" ref="model_mrs_materials_model"/>
|
<field name="model_id" ref="model_sf_materials_model"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_materials_model()</field>
|
<field name="code">model.sync_materials_model()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -23,10 +22,9 @@
|
|||||||
<field name="doall" eval="False"/>
|
<field name="doall" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<record model="ir.cron" id="sf_cron3">
|
<record model="ir.cron" id="sf_cron3">
|
||||||
<field name="name">同步资源库表面工艺</field>
|
<field name="name">同步资源库表面工艺</field>
|
||||||
<field name="model_id" ref="model_mrs_production_process"/>
|
<field name="model_id" ref="model_sf_production_process"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_production_process()</field>
|
<field name="code">model.sync_production_process()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -37,7 +35,7 @@
|
|||||||
|
|
||||||
<record model="ir.cron" id="sf_cron4">
|
<record model="ir.cron" id="sf_cron4">
|
||||||
<field name="name">同步资源库加工工艺</field>
|
<field name="name">同步资源库加工工艺</field>
|
||||||
<field name="model_id" ref="model_mrs_processing_technology"/>
|
<field name="model_id" ref="model_sf_processing_technology"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_processing_technology()</field>
|
<field name="code">model.sync_processing_technology()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -48,7 +46,7 @@
|
|||||||
|
|
||||||
<record model="ir.cron" id="sf_cron5">
|
<record model="ir.cron" id="sf_cron5">
|
||||||
<field name="name">同步资源库标签</field>
|
<field name="name">同步资源库标签</field>
|
||||||
<field name="model_id" ref="model_mrs_machine_brand_tags"/>
|
<field name="model_id" ref="model_sf_machine_brand_tags"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_machine_brand_tags()</field>
|
<field name="code">model.sync_machine_brand_tags()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -57,10 +55,9 @@
|
|||||||
<field name="doall" eval="False"/>
|
<field name="doall" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<record model="ir.cron" id="sf_cron6">
|
<record model="ir.cron" id="sf_cron6">
|
||||||
<field name="name">同步资源库控制系统</field>
|
<field name="name">同步资源库控制系统</field>
|
||||||
<field name="model_id" ref="model_mrs_machine_control_system"/>
|
<field name="model_id" ref="model_sf_machine_control_system"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_machine_tool_type_control_system()</field>
|
<field name="code">model.sync_machine_tool_type_control_system()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -71,7 +68,7 @@
|
|||||||
|
|
||||||
<record model="ir.cron" id="sf_cron7">
|
<record model="ir.cron" id="sf_cron7">
|
||||||
<field name="name">同步资源库品牌</field>
|
<field name="name">同步资源库品牌</field>
|
||||||
<field name="model_id" ref="model_mrs_machine_brand"/>
|
<field name="model_id" ref="model_sf_machine_brand"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_machine_brand()</field>
|
<field name="code">model.sync_machine_brand()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -80,20 +77,20 @@
|
|||||||
<field name="doall" eval="False"/>
|
<field name="doall" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- <record model="ir.cron" id="sf_cron8">-->
|
<!-- <record model="ir.cron" id="sf_cron8">-->
|
||||||
<!-- <field name="name">同步注册机床</field>-->
|
<!-- <field name="name">同步注册机床</field>-->
|
||||||
<!-- <field name="model_id" ref="model_mrs_machine_tool"/>-->
|
<!-- <field name="model_id" ref="model_mrs_machine_tool"/>-->
|
||||||
<!-- <field name="state">code</field>-->
|
<!-- <field name="state">code</field>-->
|
||||||
<!-- <field name="code">model.enroll_machine_tool()</field>-->
|
<!-- <field name="code">model.enroll_machine_tool()</field>-->
|
||||||
<!-- <field name="interval_number">1</field>-->
|
<!-- <field name="interval_number">1</field>-->
|
||||||
<!-- <field name="interval_type">days</field>-->
|
<!-- <field name="interval_type">days</field>-->
|
||||||
<!-- <field name="numbercall">-1</field>-->
|
<!-- <field name="numbercall">-1</field>-->
|
||||||
<!-- <field name="doall" eval="False"/>-->
|
<!-- <field name="doall" eval="False"/>-->
|
||||||
<!-- </record>-->
|
<!-- </record>-->
|
||||||
|
|
||||||
<record model="ir.cron" id="sf_cron9">
|
<record model="ir.cron" id="sf_cron9">
|
||||||
<field name="name">同步资源库机床型号</field>
|
<field name="name">同步资源库机床型号</field>
|
||||||
<field name="model_id" ref="model_mrs_machine_tool_type"/>
|
<field name="model_id" ref="model_sf_machine_tool_type"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_machine_tool_type()</field>
|
<field name="code">model.sync_machine_tool_type()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -104,7 +101,7 @@
|
|||||||
|
|
||||||
<record model="ir.cron" id="sf_cron10">
|
<record model="ir.cron" id="sf_cron10">
|
||||||
<field name="name">同步资源库刀具类别</field>
|
<field name="name">同步资源库刀具类别</field>
|
||||||
<field name="model_id" ref="model_mrs_cutting_tool_category"/>
|
<field name="model_id" ref="model_sf_cutting_tool_category"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_cutting_tool_category()</field>
|
<field name="code">model.sync_cutting_tool_category()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -115,7 +112,7 @@
|
|||||||
|
|
||||||
<record model="ir.cron" id="sf_cron11">
|
<record model="ir.cron" id="sf_cron11">
|
||||||
<field name="name">同步资源库刀具型号</field>
|
<field name="name">同步资源库刀具型号</field>
|
||||||
<field name="model_id" ref="model_mrs_cutting_tool_type"/>
|
<field name="model_id" ref="model_sf_cutting_tool_type"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_cutting_tool_type()</field>
|
<field name="code">model.sync_cutting_tool_type()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -124,9 +121,9 @@
|
|||||||
<field name="doall" eval="False"/>
|
<field name="doall" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.cron" id="sf_cron12">
|
<record model="ir.cron" id="sf_cron12">
|
||||||
<field name="name">同步资源库工序</field>
|
<field name="name">同步资源库工序</field>
|
||||||
<field name="model_id" ref="model_mrs_processing_order"/>
|
<field name="model_id" ref="model_sf_processing_order"/>
|
||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model.sync_processing_order()</field>
|
<field name="code">model.sync_processing_order()</field>
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number">1</field>
|
||||||
@@ -1 +1,4 @@
|
|||||||
from . import models
|
from . import res_config_setting
|
||||||
|
from . import sync_common
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,32 +12,32 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
_inherit = 'res.config.settings'
|
_inherit = 'res.config.settings'
|
||||||
|
|
||||||
token = fields.Char(string='TOKEN', default='b811ac06-3f00-11ed-9aed-0242ac110003')
|
token = fields.Char(string='TOKEN', default='b811ac06-3f00-11ed-9aed-0242ac110003')
|
||||||
mrs_secret_key = fields.Char(string='密钥', default= 'wBmxej38OkErKhD6')
|
sf_secret_key = fields.Char(string='密钥', default= 'wBmxej38OkErKhD6')
|
||||||
mrs_url = fields.Char(string='访问地址', default= 'https://mrs.cs.jikimo.com')
|
sf_url = fields.Char(string='访问地址', default= 'https://sf.cs.jikimo.com')
|
||||||
|
|
||||||
def sf_all_sync(self):
|
def sf_all_sync(self):
|
||||||
self.env['mrs.production.materials'].sync_all_production_materials()
|
self.env['sf.production.materials'].sync_all_production_materials()
|
||||||
_logger.info("同步资源库材料")
|
_logger.info("同步资源库材料")
|
||||||
self.env['mrs.materials.model'].sync_all_materials_model()
|
self.env['sf.materials.model'].sync_all_materials_model()
|
||||||
_logger.info("同步资源库材料型号")
|
_logger.info("同步资源库材料型号")
|
||||||
self.env['mrs.production.process'].sync_all_production_process()
|
self.env['sf.production.process'].sync_all_production_process()
|
||||||
_logger.info("同步资源库表面工艺")
|
_logger.info("同步资源库表面工艺")
|
||||||
self.env['mrs.processing.technology'].sync_all_processing_technology()
|
self.env['sf.processing.technology'].sync_all_processing_technology()
|
||||||
_logger.info("同步资源库加工工艺")
|
_logger.info("同步资源库加工工艺")
|
||||||
self.env['mrs.machine.brand.tags'].sync_all_machine_brand_tags()
|
self.env['sf.machine.brand.tags'].sync_all_machine_brand_tags()
|
||||||
_logger.info("同步资源库品牌类别")
|
_logger.info("同步资源库品牌类别")
|
||||||
self.env['mrs.machine.brand'].sync_all_machine_brand()
|
self.env['sf.machine.brand'].sync_all_machine_brand()
|
||||||
_logger.info("同步资源库品牌")
|
_logger.info("同步资源库品牌")
|
||||||
self.env['mrs.machine.control_system'].sync_all_machine_tool_type_control_system()
|
self.env['sf.machine.control_system'].sync_all_machine_tool_type_control_system()
|
||||||
_logger.info("同步资源库控制系统")
|
_logger.info("同步资源库控制系统")
|
||||||
# self.env['mrs.machine_tool'].sync_all_machine_tool()
|
# self.env['sf.machine_tool'].sync_all_machine_tool()
|
||||||
self.env['mrs.machine_tool.type'].sync_all_machine_tool_type()
|
self.env['sf.machine_tool.type'].sync_all_machine_tool_type()
|
||||||
_logger.info("同步资源库机床型号")
|
_logger.info("同步资源库机床型号")
|
||||||
self.env['mrs.cutting_tool.category'].sync_all_cutting_tool_category()
|
self.env['sf.cutting_tool.category'].sync_all_cutting_tool_category()
|
||||||
_logger.info("同步资源库刀具类别")
|
_logger.info("同步资源库刀具类别")
|
||||||
self.env['mrs.cutting_tool.type'].sync_all_cutting_tool_type()
|
self.env['sf.cutting_tool.type'].sync_all_cutting_tool_type()
|
||||||
_logger.info("同步资源库刀具")
|
_logger.info("同步资源库刀具")
|
||||||
# self.env['mrs.processing.order'].sync_all_processing_order()
|
# self.env['sf.processing.order'].sync_all_processing_order()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -50,13 +50,13 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
values = super(ResConfigSettings, self).get_values()
|
values = super(ResConfigSettings, self).get_values()
|
||||||
config = self.env['ir.config_parameter'].sudo()
|
config = self.env['ir.config_parameter'].sudo()
|
||||||
token = config.get_param('token', default='')
|
token = config.get_param('token', default='')
|
||||||
mrs_secret_key = config.get_param('mrs_secret_key', default='')
|
sf_secret_key = config.get_param('sf_secret_key', default='')
|
||||||
mrs_url = config.get_param('mrs_url', default='')
|
sf_url = config.get_param('sf_url', default='')
|
||||||
|
|
||||||
values.update(
|
values.update(
|
||||||
token=token,
|
token=token,
|
||||||
mrs_secret_key=mrs_secret_key,
|
sf_secret_key=sf_secret_key,
|
||||||
mrs_url=mrs_url,
|
sf_url=sf_url,
|
||||||
)
|
)
|
||||||
return values
|
return values
|
||||||
|
|
||||||
@@ -64,6 +64,6 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
super(ResConfigSettings, self).set_values()
|
super(ResConfigSettings, self).set_values()
|
||||||
ir_config = self.env['ir.config_parameter'].sudo()
|
ir_config = self.env['ir.config_parameter'].sudo()
|
||||||
ir_config.set_param("token", self.token or "")
|
ir_config.set_param("token", self.token or "")
|
||||||
ir_config.set_param("mrs_secret_key", self.mrs_secret_key or "")
|
ir_config.set_param("sf_secret_key", self.sf_secret_key or "")
|
||||||
ir_config.set_param("mrs_url", self.mrs_url or "")
|
ir_config.set_param("sf_url", self.sf_url or "")
|
||||||
|
|
||||||
@@ -12,8 +12,8 @@ from .res_config_setting import ResConfigSettings
|
|||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class MrsProductionMaterials(models.Model):
|
class sfProductionMaterials(models.Model):
|
||||||
_inherit = "mrs.production.materials"
|
_inherit = "sf.production.materials"
|
||||||
_description = "材料"
|
_description = "材料"
|
||||||
url = '/api/production_materials/list'
|
url = '/api/production_materials/list'
|
||||||
|
|
||||||
@@ -23,10 +23,10 @@ class MrsProductionMaterials(models.Model):
|
|||||||
# 配置中获取token
|
# 配置中获取token
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
|
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
@@ -34,7 +34,7 @@ class MrsProductionMaterials(models.Model):
|
|||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['production_materials_yesterday_list']:
|
for item in result['production_materials_yesterday_list']:
|
||||||
if item:
|
if item:
|
||||||
brand = self.env['mrs.production.materials'].search(
|
brand = self.env['sf.production.materials'].search(
|
||||||
[("materials_no", '=', item['materials_no'])])
|
[("materials_no", '=', item['materials_no'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
@@ -42,7 +42,7 @@ class MrsProductionMaterials(models.Model):
|
|||||||
brand.remark = item['remark'],
|
brand.remark = item['remark'],
|
||||||
brand.active = item['active']
|
brand.active = item['active']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.production.materials'].create({
|
self.env['sf.production.materials'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"materials_no": item['materials_no'],
|
"materials_no": item['materials_no'],
|
||||||
@@ -57,10 +57,10 @@ class MrsProductionMaterials(models.Model):
|
|||||||
_logger = '正在同步所有材料'
|
_logger = '正在同步所有材料'
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
@@ -68,10 +68,10 @@ class MrsProductionMaterials(models.Model):
|
|||||||
for item in result['production_materials_all_list']:
|
for item in result['production_materials_all_list']:
|
||||||
if item:
|
if item:
|
||||||
|
|
||||||
brand = self.env['mrs.production.materials'].search(
|
brand = self.env['sf.production.materials'].search(
|
||||||
[("materials_no", '=', item['materials_no'])])
|
[("materials_no", '=', item['materials_no'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.production.materials'].create({
|
self.env['sf.production.materials'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"materials_no": item['materials_no'],
|
"materials_no": item['materials_no'],
|
||||||
@@ -82,8 +82,8 @@ class MrsProductionMaterials(models.Model):
|
|||||||
raise ValidationError("认证未通过")
|
raise ValidationError("认证未通过")
|
||||||
|
|
||||||
|
|
||||||
class MrsMaterialModel(models.Model):
|
class sfMaterialModel(models.Model):
|
||||||
_inherit = 'mrs.materials.model'
|
_inherit = 'sf.materials.model'
|
||||||
_description = '材料型号'
|
_description = '材料型号'
|
||||||
url = '/api/materials_model/list'
|
url = '/api/materials_model/list'
|
||||||
|
|
||||||
@@ -91,17 +91,17 @@ class MrsMaterialModel(models.Model):
|
|||||||
def sync_materials_model(self):
|
def sync_materials_model(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['materials_model_yesterday_list']:
|
for item in result['materials_model_yesterday_list']:
|
||||||
if item:
|
if item:
|
||||||
brand = self.env['mrs.materials.model'].search(
|
brand = self.env['sf.materials.model'].search(
|
||||||
[("materials_no", '=', item['materials_no'])])
|
[("materials_no", '=', item['materials_no'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
@@ -110,18 +110,18 @@ class MrsMaterialModel(models.Model):
|
|||||||
brand.remark = item['remark'],
|
brand.remark = item['remark'],
|
||||||
brand.active = item['active'],
|
brand.active = item['active'],
|
||||||
brand.mf_materia_post = item['mf_materia_post'],
|
brand.mf_materia_post = item['mf_materia_post'],
|
||||||
brand.materials_id = self.env['mrs.production.materials'].search(
|
brand.materials_id = self.env['sf.production.materials'].search(
|
||||||
[("materials_no", '=', item['materials_id.materials_no'])]).id,
|
[("materials_no", '=', item['materials_id.materials_no'])]).id,
|
||||||
brand.need_h = item['need_h'],
|
brand.need_h = item['need_h'],
|
||||||
brand.density = item['density']
|
brand.density = item['density']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.materials.model'].create({
|
self.env['sf.materials.model'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"materials_no": item['materials_no'],
|
"materials_no": item['materials_no'],
|
||||||
"remark": item['remark'],
|
"remark": item['remark'],
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
"materials_id": self.env['mrs.production.materials'].search(
|
"materials_id": self.env['sf.production.materials'].search(
|
||||||
[("materials_no", '=', item['materials_id.materials_no'])]).id,
|
[("materials_no", '=', item['materials_id.materials_no'])]).id,
|
||||||
"need_h": item['need_h'],
|
"need_h": item['need_h'],
|
||||||
"mf_materia_post": item['mf_materia_post'],
|
"mf_materia_post": item['mf_materia_post'],
|
||||||
@@ -136,24 +136,24 @@ class MrsMaterialModel(models.Model):
|
|||||||
def sync_all_materials_model(self):
|
def sync_all_materials_model(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['materials_model_all_list']:
|
for item in result['materials_model_all_list']:
|
||||||
if item:
|
if item:
|
||||||
brand = self.env['mrs.materials.model'].search(
|
brand = self.env['sf.materials.model'].search(
|
||||||
[("materials_no", '=', item['materials_no'])])
|
[("materials_no", '=', item['materials_no'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.materials.model'].create({
|
self.env['sf.materials.model'].create({
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"materials_no": item['materials_no'],
|
"materials_no": item['materials_no'],
|
||||||
"remark": item['remark'],
|
"remark": item['remark'],
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
"materials_id": self.env['mrs.production.materials'].search(
|
"materials_id": self.env['sf.production.materials'].search(
|
||||||
[("materials_no", '=', item['materials_id.materials_no'])]).id,
|
[("materials_no", '=', item['materials_id.materials_no'])]).id,
|
||||||
"need_h": item['need_h'],
|
"need_h": item['need_h'],
|
||||||
"mf_materia_post": item['mf_materia_post'],
|
"mf_materia_post": item['mf_materia_post'],
|
||||||
@@ -165,8 +165,8 @@ class MrsMaterialModel(models.Model):
|
|||||||
raise ValidationError("认证未通过")
|
raise ValidationError("认证未通过")
|
||||||
|
|
||||||
|
|
||||||
class MrsProductionProcess(models.Model):
|
class sfProductionProcess(models.Model):
|
||||||
_inherit = 'mrs.production.process'
|
_inherit = 'sf.production.process'
|
||||||
_description = '表面工艺'
|
_description = '表面工艺'
|
||||||
url = '/api/production_process/list'
|
url = '/api/production_process/list'
|
||||||
|
|
||||||
@@ -174,17 +174,17 @@ class MrsProductionProcess(models.Model):
|
|||||||
def sync_production_process(self):
|
def sync_production_process(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['production_process_yesterday_list']:
|
for item in result['production_process_yesterday_list']:
|
||||||
if item:
|
if item:
|
||||||
brand = self.env['mrs.production.process'].search(
|
brand = self.env['sf.production.process'].search(
|
||||||
[("process_encode", '=', item['process_encode'])])
|
[("process_encode", '=', item['process_encode'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
@@ -194,7 +194,7 @@ class MrsProductionProcess(models.Model):
|
|||||||
brand.active = item['active'],
|
brand.active = item['active'],
|
||||||
brand.remark = item['remark']
|
brand.remark = item['remark']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.production.process'].create({
|
self.env['sf.production.process'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"process_encode": item['process_encode'],
|
"process_encode": item['process_encode'],
|
||||||
@@ -210,20 +210,20 @@ class MrsProductionProcess(models.Model):
|
|||||||
def sync_all_production_process(self):
|
def sync_all_production_process(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['production_process_all_list']:
|
for item in result['production_process_all_list']:
|
||||||
if item:
|
if item:
|
||||||
brand = self.env['mrs.production.process'].search(
|
brand = self.env['sf.production.process'].search(
|
||||||
[("process_encode", '=', item['process_encode'])])
|
[("process_encode", '=', item['process_encode'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.production.process'].create({
|
self.env['sf.production.process'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"process_encode": item['process_encode'],
|
"process_encode": item['process_encode'],
|
||||||
@@ -236,8 +236,8 @@ class MrsProductionProcess(models.Model):
|
|||||||
raise ValidationError("认证未通过")
|
raise ValidationError("认证未通过")
|
||||||
|
|
||||||
|
|
||||||
class MrsProcessingTechnology(models.Model):
|
class sfProcessingTechnology(models.Model):
|
||||||
_inherit = 'mrs.processing.technology'
|
_inherit = 'sf.processing.technology'
|
||||||
_description = '加工工艺'
|
_description = '加工工艺'
|
||||||
url = '/api/processing_technology/list'
|
url = '/api/processing_technology/list'
|
||||||
|
|
||||||
@@ -245,17 +245,17 @@ class MrsProcessingTechnology(models.Model):
|
|||||||
def sync_processing_technology(self):
|
def sync_processing_technology(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['processing_technology_yesterday_list']:
|
for item in result['processing_technology_yesterday_list']:
|
||||||
if item:
|
if item:
|
||||||
brand = self.env['mrs.processing.technology'].search(
|
brand = self.env['sf.processing.technology'].search(
|
||||||
[("process_encode", '=', item['process_encode'])])
|
[("process_encode", '=', item['process_encode'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
@@ -264,7 +264,7 @@ class MrsProcessingTechnology(models.Model):
|
|||||||
brand.remark = item['remark'],
|
brand.remark = item['remark'],
|
||||||
brand.active = item['active']
|
brand.active = item['active']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.processing.technology'].create({
|
self.env['sf.processing.technology'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"process_encode": item['process_encode'],
|
"process_encode": item['process_encode'],
|
||||||
@@ -280,20 +280,20 @@ class MrsProcessingTechnology(models.Model):
|
|||||||
def sync_all_processing_technology(self):
|
def sync_all_processing_technology(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['processing_technology_all_list']:
|
for item in result['processing_technology_all_list']:
|
||||||
if item:
|
if item:
|
||||||
brand = self.env['mrs.processing.technology'].search(
|
brand = self.env['sf.processing.technology'].search(
|
||||||
[("process_encode", '=', item['process_encode'])])
|
[("process_encode", '=', item['process_encode'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.processing.technology'].create({
|
self.env['sf.processing.technology'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"process_encode": item['process_encode'],
|
"process_encode": item['process_encode'],
|
||||||
@@ -307,7 +307,7 @@ class MrsProcessingTechnology(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class MachineBrandTags(models.Model):
|
class MachineBrandTags(models.Model):
|
||||||
_inherit = 'mrs.machine.brand.tags'
|
_inherit = 'sf.machine.brand.tags'
|
||||||
_description = '品牌类别'
|
_description = '品牌类别'
|
||||||
url = '/api/machine_brand_tags/list'
|
url = '/api/machine_brand_tags/list'
|
||||||
|
|
||||||
@@ -315,23 +315,23 @@ class MachineBrandTags(models.Model):
|
|||||||
def sync_machine_brand_tags(self):
|
def sync_machine_brand_tags(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_brand_tags_yesterday_list']:
|
for item in result['machine_brand_tags_yesterday_list']:
|
||||||
brand = self.env['mrs.machine.brand.tags'].search(
|
brand = self.env['sf.machine.brand.tags'].search(
|
||||||
[("id", '=', item['id'])])
|
[("id", '=', item['id'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
brand.name = item['name'],
|
brand.name = item['name'],
|
||||||
brand.color = item['color']
|
brand.color = item['color']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.machine.brand.tags'].create({
|
self.env['sf.machine.brand.tags'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"color": item['color'],
|
"color": item['color'],
|
||||||
@@ -344,19 +344,19 @@ class MachineBrandTags(models.Model):
|
|||||||
def sync_all_machine_brand_tags(self):
|
def sync_all_machine_brand_tags(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_brand_tags_all_list']:
|
for item in result['machine_brand_tags_all_list']:
|
||||||
brand = self.env['mrs.machine.brand.tags'].search(
|
brand = self.env['sf.machine.brand.tags'].search(
|
||||||
[("name", '=', item['name'])])
|
[("name", '=', item['name'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.machine.brand.tags'].create({
|
self.env['sf.machine.brand.tags'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"color": item['color'],
|
"color": item['color'],
|
||||||
@@ -368,7 +368,7 @@ class MachineBrandTags(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class MachineControlSystem(models.Model):
|
class MachineControlSystem(models.Model):
|
||||||
_inherit = 'mrs.machine.control_system'
|
_inherit = 'sf.machine.control_system'
|
||||||
_description = '控制系统'
|
_description = '控制系统'
|
||||||
url = '/api/machine_control_system/list'
|
url = '/api/machine_control_system/list'
|
||||||
|
|
||||||
@@ -376,31 +376,31 @@ class MachineControlSystem(models.Model):
|
|||||||
def sync_machine_tool_type_control_system(self):
|
def sync_machine_tool_type_control_system(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_control_system_yesterday_list']:
|
for item in result['machine_control_system_yesterday_list']:
|
||||||
if item:
|
if item:
|
||||||
brand = self.env['mrs.machine.control_system'].search(
|
brand = self.env['sf.machine.control_system'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
brand.name = item['name'],
|
brand.name = item['name'],
|
||||||
brand.code = item['code'],
|
brand.code = item['code'],
|
||||||
brand.brand_id=self.env['mrs.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
brand.brand_id=self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
||||||
brand.active = item['active']
|
brand.active = item['active']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.machine.control_system'].create({
|
self.env['sf.machine.control_system'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"code": item['code'],
|
"code": item['code'],
|
||||||
|
|
||||||
'brand_id': self.env['mrs.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
# "tag_ids": item['tag_ids']
|
# "tag_ids": item['tag_ids']
|
||||||
|
|
||||||
@@ -412,10 +412,10 @@ class MachineControlSystem(models.Model):
|
|||||||
def sync_all_machine_tool_type_control_system(self):
|
def sync_all_machine_tool_type_control_system(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
|
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
@@ -423,14 +423,14 @@ class MachineControlSystem(models.Model):
|
|||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_control_system_all_list']:
|
for item in result['machine_control_system_all_list']:
|
||||||
if item:
|
if item:
|
||||||
brand = self.env['mrs.machine.control_system'].search(
|
brand = self.env['sf.machine.control_system'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.machine.control_system'].create({
|
self.env['sf.machine.control_system'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"code": item['code'],
|
"code": item['code'],
|
||||||
'brand_id': self.env['mrs.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
||||||
|
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
# "tag_ids": item['tag_ids']
|
# "tag_ids": item['tag_ids']
|
||||||
@@ -441,7 +441,7 @@ class MachineControlSystem(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class MachineBrand(models.Model):
|
class MachineBrand(models.Model):
|
||||||
_inherit = 'mrs.machine.brand'
|
_inherit = 'sf.machine.brand'
|
||||||
_description = '品牌'
|
_description = '品牌'
|
||||||
url = '/api/machine_brand/list'
|
url = '/api/machine_brand/list'
|
||||||
|
|
||||||
@@ -449,17 +449,17 @@ class MachineBrand(models.Model):
|
|||||||
def sync_machine_brand(self):
|
def sync_machine_brand(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
|
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_brand_yesterday_list']:
|
for item in result['machine_brand_yesterday_list']:
|
||||||
brand = self.env['mrs.machine.brand'].search(
|
brand = self.env['sf.machine.brand'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
@@ -467,7 +467,7 @@ class MachineBrand(models.Model):
|
|||||||
brand.code = item['code'],
|
brand.code = item['code'],
|
||||||
brand.active = item['active']
|
brand.active = item['active']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.machine.brand'].create({
|
self.env['sf.machine.brand'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"code": item['code'],
|
"code": item['code'],
|
||||||
@@ -483,26 +483,26 @@ class MachineBrand(models.Model):
|
|||||||
def sync_all_machine_brand(self):
|
def sync_all_machine_brand(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
|
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_brand_all_list']:
|
for item in result['machine_brand_all_list']:
|
||||||
brand = self.env['mrs.machine.brand'].search(
|
brand = self.env['sf.machine.brand'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.machine.brand'].create({
|
self.env['sf.machine.brand'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"code": item['code'],
|
"code": item['code'],
|
||||||
# "image_brand": item['image_brand'],
|
# "image_brand": item['image_brand'],
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
"tag_ids": self.env['mrs.machine.brand.tags'].search(
|
"tag_ids": self.env['sf.machine.brand.tags'].search(
|
||||||
[("name", 'in', item['tag_ids'])]).ids
|
[("name", 'in', item['tag_ids'])]).ids
|
||||||
|
|
||||||
|
|
||||||
@@ -512,7 +512,7 @@ class MachineBrand(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class MachineTool(models.Model):
|
class MachineTool(models.Model):
|
||||||
_inherit = 'mrs.machine_tool'
|
_inherit = 'sf.machine_tool'
|
||||||
_description = '机床'
|
_description = '机床'
|
||||||
url = '/api/machine_tool/list'
|
url = '/api/machine_tool/list'
|
||||||
crea_url = '/api/machine_tool/create'
|
crea_url = '/api/machine_tool/create'
|
||||||
@@ -523,16 +523,16 @@ class MachineTool(models.Model):
|
|||||||
def sync_machine_tool(self):
|
def sync_machine_tool(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_tool_all_yesterday_list']:
|
for item in result['machine_tool_all_yesterday_list']:
|
||||||
brand = self.env['mrs.machine_tool'].search(
|
brand = self.env['sf.machine_tool'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
@@ -557,7 +557,7 @@ class MachineTool(models.Model):
|
|||||||
brand.active = item['active']
|
brand.active = item['active']
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.env['mrs.machine_tool'].create({
|
self.env['sf.machine_tool'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"precision": item['precision'],
|
"precision": item['precision'],
|
||||||
@@ -588,19 +588,19 @@ class MachineTool(models.Model):
|
|||||||
def sync_all_machine_tool(self):
|
def sync_all_machine_tool(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_tool_all_list']:
|
for item in result['machine_tool_all_list']:
|
||||||
brand = self.env['mrs.machine_tool'].search(
|
brand = self.env['sf.machine_tool'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.machine_tool'].create({
|
self.env['sf.machine_tool'].create({
|
||||||
|
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
@@ -614,7 +614,7 @@ class MachineTool(models.Model):
|
|||||||
"number_of_axles": item['number_of_axles'],
|
"number_of_axles": item['number_of_axles'],
|
||||||
# "control_system_id": item['control_system_id'],
|
# "control_system_id": item['control_system_id'],
|
||||||
"type_id": item['type_id'],
|
"type_id": item['type_id'],
|
||||||
'brand_id': self.env['mrs.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
||||||
"x_axis": item['x_axis'],
|
"x_axis": item['x_axis'],
|
||||||
"y_axis": item['y_axis'],
|
"y_axis": item['y_axis'],
|
||||||
"z_axis": item['z_axis'],
|
"z_axis": item['z_axis'],
|
||||||
@@ -630,7 +630,7 @@ class MachineTool(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class MachineToolType(models.Model):
|
class MachineToolType(models.Model):
|
||||||
_inherit = 'mrs.machine_tool.type'
|
_inherit = 'sf.machine_tool.type'
|
||||||
_description = '机床型号'
|
_description = '机床型号'
|
||||||
url = '/api/machine_tool_type/list'
|
url = '/api/machine_tool_type/list'
|
||||||
|
|
||||||
@@ -638,16 +638,16 @@ class MachineToolType(models.Model):
|
|||||||
def sync_machine_tool_type(self):
|
def sync_machine_tool_type(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_tool_type_yesterday_list']:
|
for item in result['machine_tool_type_yesterday_list']:
|
||||||
brand = self.env['mrs.machine_tool.type'].search(
|
brand = self.env['sf.machine_tool.type'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
@@ -657,7 +657,7 @@ class MachineToolType(models.Model):
|
|||||||
brand.number_of_knife_library = item['number_of_knife_library'],
|
brand.number_of_knife_library = item['number_of_knife_library'],
|
||||||
brand.rotate_speed = item['rotate_speed'],
|
brand.rotate_speed = item['rotate_speed'],
|
||||||
brand.number_of_axles = item['number_of_axles'],
|
brand.number_of_axles = item['number_of_axles'],
|
||||||
brand.control_system_id = self.env['mrs.machine.control_system'].search([('code', '=', item['control_system_id'])]).id,
|
brand.control_system_id = self.env['sf.machine.control_system'].search([('code', '=', item['control_system_id'])]).id,
|
||||||
|
|
||||||
brand.x_axis = item['x_axis'],
|
brand.x_axis = item['x_axis'],
|
||||||
brand.y_axis = item['y_axis'],
|
brand.y_axis = item['y_axis'],
|
||||||
@@ -666,18 +666,18 @@ class MachineToolType(models.Model):
|
|||||||
brand.c_axis = item['c_axis'],
|
brand.c_axis = item['c_axis'],
|
||||||
brand.active = item['active'],
|
brand.active = item['active'],
|
||||||
brand.remark = item['remark'],
|
brand.remark = item['remark'],
|
||||||
brand.brand_id=self.env['mrs.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
brand.brand_id=self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
||||||
brand.machine_tool_id = self.env['mrs.machine_tool'].search([('code', '=', item['machine_tool_id'])]).id
|
brand.machine_tool_id = self.env['sf.machine_tool'].search([('code', '=', item['machine_tool_id'])]).id
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.env['mrs.machine_tool.type'].create({
|
self.env['sf.machine_tool.type'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"code": item['code'],
|
"code": item['code'],
|
||||||
|
|
||||||
"number_of_knife_library": item['number_of_knife_library'],
|
"number_of_knife_library": item['number_of_knife_library'],
|
||||||
"rotate_speed": item['rotate_speed'],
|
"rotate_speed": item['rotate_speed'],
|
||||||
'machine_tool_id' : self.env['mrs.machine_tool'].search([('code', '=', item['machine_tool_id'])]).id,
|
'machine_tool_id' : self.env['sf.machine_tool'].search([('code', '=', item['machine_tool_id'])]).id,
|
||||||
"number_of_axles": item['number_of_axles'],
|
"number_of_axles": item['number_of_axles'],
|
||||||
"x_axis": item['x_axis'],
|
"x_axis": item['x_axis'],
|
||||||
"y_axis": item['y_axis'],
|
"y_axis": item['y_axis'],
|
||||||
@@ -686,9 +686,9 @@ class MachineToolType(models.Model):
|
|||||||
"c_axis": item['c_axis'],
|
"c_axis": item['c_axis'],
|
||||||
"remark": item['remark'],
|
"remark": item['remark'],
|
||||||
"precision": item['precision'],
|
"precision": item['precision'],
|
||||||
'control_system_id' : self.env['mrs.machine.control_system'].search([('code', '=', item['control_system_id'])]).id,
|
'control_system_id' : self.env['sf.machine.control_system'].search([('code', '=', item['control_system_id'])]).id,
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
'brand_id': self.env['mrs.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
||||||
|
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
@@ -698,25 +698,25 @@ class MachineToolType(models.Model):
|
|||||||
def sync_all_machine_tool_type(self):
|
def sync_all_machine_tool_type(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['machine_tool_type_all_list']:
|
for item in result['machine_tool_type_all_list']:
|
||||||
brand = self.env['mrs.machine_tool.type'].search(
|
brand = self.env['sf.machine_tool.type'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.machine_tool.type'].create({
|
self.env['sf.machine_tool.type'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"code": item['code'],
|
"code": item['code'],
|
||||||
"number_of_knife_library": item['number_of_knife_library'],
|
"number_of_knife_library": item['number_of_knife_library'],
|
||||||
"rotate_speed": item['rotate_speed'],
|
"rotate_speed": item['rotate_speed'],
|
||||||
'machine_tool_id' : self.env['mrs.machine_tool'].search([('code', '=', item['machine_tool_id'])]).id,
|
'machine_tool_id' : self.env['sf.machine_tool'].search([('code', '=', item['machine_tool_id'])]).id,
|
||||||
"number_of_axles": item['number_of_axles'],
|
"number_of_axles": item['number_of_axles'],
|
||||||
"x_axis": item['x_axis'],
|
"x_axis": item['x_axis'],
|
||||||
"y_axis": item['y_axis'],
|
"y_axis": item['y_axis'],
|
||||||
@@ -725,9 +725,9 @@ class MachineToolType(models.Model):
|
|||||||
"c_axis": item['c_axis'],
|
"c_axis": item['c_axis'],
|
||||||
"remark": item['remark'],
|
"remark": item['remark'],
|
||||||
"precision": item['precision'],
|
"precision": item['precision'],
|
||||||
'control_system_id' : self.env['mrs.machine.control_system'].search([('code', '=', item['control_system_id'])]).id,
|
'control_system_id' : self.env['sf.machine.control_system'].search([('code', '=', item['control_system_id'])]).id,
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
'brand_id': self.env['mrs.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
||||||
|
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
@@ -735,7 +735,7 @@ class MachineToolType(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class CuttingTool(models.Model):
|
class CuttingTool(models.Model):
|
||||||
_inherit = 'mrs.cutting_tool.category'
|
_inherit = 'sf.cutting_tool.category'
|
||||||
_description = '刀具类别'
|
_description = '刀具类别'
|
||||||
url = '/api/cutting_tool_category/list'
|
url = '/api/cutting_tool_category/list'
|
||||||
|
|
||||||
@@ -743,16 +743,16 @@ class CuttingTool(models.Model):
|
|||||||
def sync_cutting_tool_category(self):
|
def sync_cutting_tool_category(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['cutting_tool_category_yesterday_list']:
|
for item in result['cutting_tool_category_yesterday_list']:
|
||||||
brand = self.env['mrs.cutting_tool.category'].search(
|
brand = self.env['sf.cutting_tool.category'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
@@ -761,7 +761,7 @@ class CuttingTool(models.Model):
|
|||||||
brand.active = item['active'],
|
brand.active = item['active'],
|
||||||
brand.remark = item['remark']
|
brand.remark = item['remark']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.cutting_tool.category'].create({
|
self.env['sf.cutting_tool.category'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"code": item['code'],
|
"code": item['code'],
|
||||||
@@ -777,19 +777,19 @@ class CuttingTool(models.Model):
|
|||||||
def sync_all_cutting_tool_category(self):
|
def sync_all_cutting_tool_category(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['cutting_tool_category_all_list']:
|
for item in result['cutting_tool_category_all_list']:
|
||||||
brand = self.env['mrs.cutting_tool.category'].search(
|
brand = self.env['sf.cutting_tool.category'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.cutting_tool.category'].create({
|
self.env['sf.cutting_tool.category'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"code": item['code'],
|
"code": item['code'],
|
||||||
@@ -803,7 +803,7 @@ class CuttingTool(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class CuttingToolType(models.Model):
|
class CuttingToolType(models.Model):
|
||||||
_inherit = 'mrs.cutting_tool.type'
|
_inherit = 'sf.cutting_tool.type'
|
||||||
_description = '刀具型号'
|
_description = '刀具型号'
|
||||||
url = '/api/cutting_tool_type/list'
|
url = '/api/cutting_tool_type/list'
|
||||||
|
|
||||||
@@ -811,16 +811,16 @@ class CuttingToolType(models.Model):
|
|||||||
def sync_cutting_tool_type(self):
|
def sync_cutting_tool_type(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['cutting_tool_type_yesterday_list']:
|
for item in result['cutting_tool_type_yesterday_list']:
|
||||||
brand = self.env['mrs.cutting_tool.type'].search(
|
brand = self.env['sf.cutting_tool.type'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id'],
|
brand.id = item['id'],
|
||||||
@@ -835,10 +835,10 @@ class CuttingToolType(models.Model):
|
|||||||
brand.taper_shank_length = item['taper_shank_length'],
|
brand.taper_shank_length = item['taper_shank_length'],
|
||||||
brand.tool_length = item['tool_length'],
|
brand.tool_length = item['tool_length'],
|
||||||
brand.blade_number = item['blade_number']
|
brand.blade_number = item['blade_number']
|
||||||
brand.brand_id = self.env['mrs.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
brand.brand_id = self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
||||||
brand.category_id = self.env['mrs.cutting_tool.category'].search([('code', '=', item['category_id'])]).id
|
brand.category_id = self.env['sf.cutting_tool.category'].search([('code', '=', item['category_id'])]).id
|
||||||
else:
|
else:
|
||||||
self.env['mrs.cutting_tool.type'].create({
|
self.env['sf.cutting_tool.type'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"remark": item['remark'],
|
"remark": item['remark'],
|
||||||
@@ -851,8 +851,8 @@ class CuttingToolType(models.Model):
|
|||||||
"taper_shank_length": item['taper_shank_length'],
|
"taper_shank_length": item['taper_shank_length'],
|
||||||
"tool_length": item['tool_length'],
|
"tool_length": item['tool_length'],
|
||||||
"blade_number": item['blade_number'],
|
"blade_number": item['blade_number'],
|
||||||
'brand_id': self.env['mrs.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
||||||
"category_id": self.env['mrs.cutting_tool.category'].search([('code', '=', item['category_id'])]).id,
|
"category_id": self.env['sf.cutting_tool.category'].search([('code', '=', item['category_id'])]).id,
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
raise ValidationError("认证未通过")
|
raise ValidationError("认证未通过")
|
||||||
@@ -861,19 +861,19 @@ class CuttingToolType(models.Model):
|
|||||||
def sync_all_cutting_tool_type(self):
|
def sync_all_cutting_tool_type(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['cutting_tool_type_all_list']:
|
for item in result['cutting_tool_type_all_list']:
|
||||||
brand = self.env['mrs.cutting_tool.type'].search(
|
brand = self.env['sf.cutting_tool.type'].search(
|
||||||
[("code", '=', item['code'])])
|
[("code", '=', item['code'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.cutting_tool.type'].create({
|
self.env['sf.cutting_tool.type'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
"remark": item['remark'],
|
"remark": item['remark'],
|
||||||
@@ -886,16 +886,16 @@ class CuttingToolType(models.Model):
|
|||||||
"taper_shank_length": item['taper_shank_length'],
|
"taper_shank_length": item['taper_shank_length'],
|
||||||
"tool_length": item['tool_length'],
|
"tool_length": item['tool_length'],
|
||||||
"blade_number": item['blade_number'],
|
"blade_number": item['blade_number'],
|
||||||
'brand_id': self.env['mrs.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
|
||||||
"category_id": self.env['mrs.cutting_tool.category'].search([('code', '=', item['category_id'])]).id,
|
"category_id": self.env['sf.cutting_tool.category'].search([('code', '=', item['category_id'])]).id,
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
raise ValidationError("认证未通过")
|
raise ValidationError("认证未通过")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MrsProcessingOrder(models.Model):
|
class sfProcessingOrder(models.Model):
|
||||||
_inherit = 'mrs.processing.order'
|
_inherit = 'sf.processing.order'
|
||||||
_description = '工序'
|
_description = '工序'
|
||||||
url = '/api/processing_order/list'
|
url = '/api/processing_order/list'
|
||||||
|
|
||||||
@@ -903,22 +903,22 @@ class MrsProcessingOrder(models.Model):
|
|||||||
def sync_processing_order(self):
|
def sync_processing_order(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['processing_order_yesterday_list']:
|
for item in result['processing_order_yesterday_list']:
|
||||||
brand = self.env['mrs.processing.order'].search(
|
brand = self.env['sf.processing.order'].search(
|
||||||
[("id", '=', item['id'])])
|
[("id", '=', item['id'])])
|
||||||
if brand:
|
if brand:
|
||||||
brand.id = item['id']
|
brand.id = item['id']
|
||||||
brand.sequence = item['sequence']
|
brand.sequence = item['sequence']
|
||||||
else:
|
else:
|
||||||
self.env['mrs.processing.order'].create({
|
self.env['sf.processing.order'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"sequence": item['sequence'],
|
"sequence": item['sequence'],
|
||||||
|
|
||||||
@@ -930,19 +930,19 @@ class MrsProcessingOrder(models.Model):
|
|||||||
def sync_all_processing_order(self):
|
def sync_all_processing_order(self):
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
mrs_secret_key = sf_sync_config['mrs_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, mrs_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
|
|
||||||
strUrl = sf_sync_config['mrs_url'] + self.url
|
strUrl = sf_sync_config['sf_url'] + self.url
|
||||||
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
r = requests.post(strUrl, json={}, data=None, headers=headers)
|
||||||
r = r.json()
|
r = r.json()
|
||||||
result = json.loads(r['result'])
|
result = json.loads(r['result'])
|
||||||
if result['status'] == 1:
|
if result['status'] == 1:
|
||||||
for item in result['processing_order_all_list']:
|
for item in result['processing_order_all_list']:
|
||||||
brand = self.env['mrs.processing.order'].search(
|
brand = self.env['sf.processing.order'].search(
|
||||||
[("id", '=', item['id'])])
|
[("id", '=', item['id'])])
|
||||||
if not brand:
|
if not brand:
|
||||||
self.env['mrs.processing.order'].create({
|
self.env['sf.processing.order'].create({
|
||||||
"id": item['id'],
|
"id": item['id'],
|
||||||
"sequence": item['sequence'],
|
"sequence": item['sequence'],
|
||||||
})
|
})
|
||||||
@@ -18,12 +18,12 @@
|
|||||||
<field name="token" />
|
<field name="token" />
|
||||||
</div>
|
</div>
|
||||||
<div class="text-muted">
|
<div class="text-muted">
|
||||||
<label for="mrs_secret_key"/>
|
<label for="sf_secret_key"/>
|
||||||
<field name="mrs_secret_key"/>
|
<field name="sf_secret_key"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-muted">
|
<div class="text-muted">
|
||||||
<label for="mrs_url"/>
|
<label for="sf_url"/>
|
||||||
<field name="mrs_url"/>
|
<field name="sf_url"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -31,8 +31,6 @@
|
|||||||
<button type="object" class="oe_highlight" name="sf_all_sync" string="同步资源库所有基础数据"
|
<button type="object" class="oe_highlight" name="sf_all_sync" string="同步资源库所有基础数据"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
||||||
{
|
|
||||||
'name': '机企猫藏智能工厂 同步模块',
|
|
||||||
'version': '1.0',
|
|
||||||
'summary': '智能工厂同步模块',
|
|
||||||
'sequence': 1,
|
|
||||||
'description': """
|
|
||||||
在本模块,同步资源库
|
|
||||||
""",
|
|
||||||
'category': 'YZ',
|
|
||||||
'website': 'https://www.sf.cs.jikimo.com',
|
|
||||||
'depends': ['account', 'sf_base', 'base'],
|
|
||||||
'data': [
|
|
||||||
'views/sf_sync_config_settings_views.xml',
|
|
||||||
'data/sf_cron.xml'
|
|
||||||
|
|
||||||
|
|
||||||
],
|
|
||||||
'demo': [
|
|
||||||
],
|
|
||||||
'qweb': [
|
|
||||||
],
|
|
||||||
'installable': True,
|
|
||||||
'application': False,
|
|
||||||
'auto_install': False,
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# -*-coding:utf-8-*-
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# -*-coding:utf-8-*-
|
|
||||||
from . import sf_sync_common
|
|
||||||
from . import res_config_setting
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# -*-coding:utf-8-*-
|
|
||||||
from . import models
|
|
||||||
from . import report
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
||||||
{
|
|
||||||
'name': '机企猫藏智能工厂 工序',
|
|
||||||
'version': '1.0',
|
|
||||||
'summary': '智能工厂工作中心工序',
|
|
||||||
'sequence': 1,
|
|
||||||
'description': """
|
|
||||||
在本模块,同步资源库
|
|
||||||
""",
|
|
||||||
'category': 'YZ',
|
|
||||||
'website': 'https://www.sf.cs.jikimo.com',
|
|
||||||
'depends': ['mrp', 'sf_base', 'hr_holidays', 'maintenance', 'sf_manufacturing_orders'],
|
|
||||||
'data': [
|
|
||||||
'views/sf_tray_view.xml',
|
|
||||||
'views/sf_workorder.xml',
|
|
||||||
'views/maintenance_views.xml',
|
|
||||||
'views/mrp_views.xml',
|
|
||||||
'views/mrp_workcenter_views.xml',
|
|
||||||
'report/sf_tray_report.xml'
|
|
||||||
],
|
|
||||||
'demo': [
|
|
||||||
],
|
|
||||||
'qweb': [
|
|
||||||
],
|
|
||||||
'installable': True,
|
|
||||||
'application': False,
|
|
||||||
'auto_install': False,
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# -*-coding:utf-8-*-
|
|
||||||
from . import workcenter
|
|
||||||
from . import mrp_maintenance
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
||||||
|
|
||||||
from dateutil.relativedelta import relativedelta
|
|
||||||
from datetime import timedelta, datetime
|
|
||||||
from collections import defaultdict
|
|
||||||
|
|
||||||
from odoo import api, fields, models, _
|
|
||||||
from odoo.addons.resource.models.resource import Intervals
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MrpWorkcenter(models.Model):
|
|
||||||
_inherit = "mrp.workcenter"
|
|
||||||
|
|
||||||
machine_tool_id = fields.Many2one('mrs.machine_tool', '机床')
|
|
||||||
|
|
||||||
equipment_ids = fields.One2many(
|
|
||||||
'maintenance.equipment', 'workcenter_id', string="Maintenance Equipment",
|
|
||||||
check_company=True)
|
|
||||||
|
|
||||||
def action_work_order(self):
|
|
||||||
if not self.env.context.get('desktop_list_view', False):
|
|
||||||
action = self.env["ir.actions.actions"]._for_xml_id("sf_route_workcenter.mrp_workorder_action_tablet")
|
|
||||||
return action
|
|
||||||
else:
|
|
||||||
return super(MrpWorkcenter, self).action_work_order()
|
|
||||||
|
|
||||||
def _get_unavailability_intervals(self, start_datetime, end_datetime):
|
|
||||||
res = super(MrpWorkcenter, self)._get_unavailability_intervals(start_datetime, end_datetime)
|
|
||||||
if not self:
|
|
||||||
return res
|
|
||||||
sql = """
|
|
||||||
SELECT workcenter_id, ARRAY_AGG((schedule_date || '|' || schedule_date + INTERVAL '1h' * duration)) as date_intervals
|
|
||||||
FROM maintenance_request
|
|
||||||
LEFT JOIN maintenance_equipment
|
|
||||||
ON maintenance_request.equipment_id = maintenance_equipment.id
|
|
||||||
WHERE
|
|
||||||
schedule_date IS NOT NULL
|
|
||||||
AND duration IS NOT NULL
|
|
||||||
AND equipment_id IS NOT NULL
|
|
||||||
AND maintenance_equipment.workcenter_id IS NOT NULL
|
|
||||||
AND maintenance_equipment.workcenter_id IN %s
|
|
||||||
AND (schedule_date, schedule_date + INTERVAL '1h' * duration) OVERLAPS (%s, %s)
|
|
||||||
GROUP BY maintenance_equipment.workcenter_id;
|
|
||||||
"""
|
|
||||||
self.env.cr.execute(sql, [tuple(self.ids), fields.Datetime.to_string(start_datetime.astimezone()), fields.Datetime.to_string(end_datetime.astimezone())])
|
|
||||||
res_maintenance = defaultdict(list)
|
|
||||||
for wc_row in self.env.cr.dictfetchall():
|
|
||||||
res_maintenance[wc_row.get('workcenter_id')] = [
|
|
||||||
[fields.Datetime.to_datetime(i) for i in intervals.split('|')]
|
|
||||||
for intervals in wc_row.get('date_intervals')
|
|
||||||
]
|
|
||||||
|
|
||||||
for wc_id in self.ids:
|
|
||||||
intervals_previous_list = [(s.timestamp(), e.timestamp(), self.env['maintenance.request']) for s, e in res[wc_id]]
|
|
||||||
intervals_maintenances_list = [(m[0].timestamp(), m[1].timestamp(), self.env['maintenance.request']) for m in res_maintenance[wc_id]]
|
|
||||||
final_intervals_wc = Intervals(intervals_previous_list + intervals_maintenances_list)
|
|
||||||
res[wc_id] = [(datetime.fromtimestamp(s), datetime.fromtimestamp(e)) for s, e, _ in final_intervals_wc]
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
class MaintenanceEquipment(models.Model):
|
|
||||||
_inherit = "maintenance.equipment"
|
|
||||||
_check_company_auto = True
|
|
||||||
|
|
||||||
expected_mtbf = fields.Integer(string='Expected MTBF', help='Expected Mean Time Between Failure')
|
|
||||||
mtbf = fields.Integer(compute='_compute_maintenance_request', string='MTBF', help='Mean Time Between Failure, computed based on done corrective maintenances.')
|
|
||||||
mttr = fields.Integer(compute='_compute_maintenance_request', string='MTTR', help='Mean Time To Repair')
|
|
||||||
estimated_next_failure = fields.Date(compute='_compute_maintenance_request', string='Estimated time before next failure (in days)', help='Computed as Latest Failure Date + MTBF')
|
|
||||||
latest_failure_date = fields.Date(compute='_compute_maintenance_request', string='Latest Failure Date')
|
|
||||||
workcenter_id = fields.Many2one(
|
|
||||||
'mrp.workcenter', string='Work Center', check_company=True)
|
|
||||||
|
|
||||||
@api.depends('effective_date', 'maintenance_ids.stage_id', 'maintenance_ids.close_date', 'maintenance_ids.request_date')
|
|
||||||
def _compute_maintenance_request(self):
|
|
||||||
for equipment in self:
|
|
||||||
maintenance_requests = equipment.maintenance_ids.filtered(lambda x: x.maintenance_type == 'corrective' and x.stage_id.done)
|
|
||||||
mttr_days = 0
|
|
||||||
for maintenance in maintenance_requests:
|
|
||||||
if maintenance.stage_id.done and maintenance.close_date:
|
|
||||||
mttr_days += (maintenance.close_date - maintenance.request_date).days
|
|
||||||
equipment.mttr = len(maintenance_requests) and (mttr_days / len(maintenance_requests)) or 0
|
|
||||||
maintenance = maintenance_requests.sorted(lambda x: x.request_date)
|
|
||||||
if len(maintenance) >= 1:
|
|
||||||
equipment.mtbf = (maintenance[-1].request_date - equipment.effective_date).days / len(maintenance)
|
|
||||||
equipment.latest_failure_date = maintenance and maintenance[-1].request_date or False
|
|
||||||
if equipment.mtbf:
|
|
||||||
equipment.estimated_next_failure = equipment.latest_failure_date + relativedelta(days=equipment.mtbf)
|
|
||||||
else:
|
|
||||||
equipment.estimated_next_failure = False
|
|
||||||
|
|
||||||
def button_mrp_workcenter(self):
|
|
||||||
self.ensure_one()
|
|
||||||
return {
|
|
||||||
'name': _('work centers'),
|
|
||||||
'view_mode': 'form',
|
|
||||||
'res_model': 'mrp.workcenter',
|
|
||||||
'view_id': self.env.ref('mrp.mrp_workcenter_view').id,
|
|
||||||
'type': 'ir.actions.act_window',
|
|
||||||
'res_id': self.workcenter_id.id,
|
|
||||||
'context': {
|
|
||||||
'default_company_id': self.company_id.id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class MaintenanceRequest(models.Model):
|
|
||||||
_inherit = "maintenance.request"
|
|
||||||
_check_company_auto = True
|
|
||||||
|
|
||||||
production_id = fields.Many2one(
|
|
||||||
'mrp.production', string='Manufacturing Order', check_company=True)
|
|
||||||
workorder_id = fields.Many2one(
|
|
||||||
'mrp.workorder', string='Work Order', check_company=True)
|
|
||||||
production_company_id = fields.Many2one(string='Production Company', related='production_id.company_id')
|
|
||||||
company_id = fields.Many2one(domain="[('id', '=?', production_company_id)]")
|
|
||||||
|
|
||||||
|
|
||||||
class MrpProduction(models.Model):
|
|
||||||
_inherit = "mrp.production"
|
|
||||||
|
|
||||||
maintenance_count = fields.Integer(compute='_compute_maintenance_count', string="Number of maintenance requests")
|
|
||||||
request_ids = fields.One2many('maintenance.request', 'production_id')
|
|
||||||
|
|
||||||
@api.depends('request_ids')
|
|
||||||
def _compute_maintenance_count(self):
|
|
||||||
for production in self:
|
|
||||||
production.maintenance_count = len(production.request_ids)
|
|
||||||
|
|
||||||
def button_maintenance_req(self):
|
|
||||||
self.ensure_one()
|
|
||||||
return {
|
|
||||||
'name': _('New Maintenance Request'),
|
|
||||||
'view_mode': 'form',
|
|
||||||
'res_model': 'maintenance.request',
|
|
||||||
'type': 'ir.actions.act_window',
|
|
||||||
'context': {
|
|
||||||
'default_company_id': self.company_id.id,
|
|
||||||
'default_production_id': self.id,
|
|
||||||
},
|
|
||||||
'domain': [('production_id', '=', self.id)],
|
|
||||||
}
|
|
||||||
|
|
||||||
def open_maintenance_request_mo(self):
|
|
||||||
self.ensure_one()
|
|
||||||
action = {
|
|
||||||
'name': _('Maintenance Requests'),
|
|
||||||
'view_mode': 'kanban,tree,form,pivot,graph,calendar',
|
|
||||||
'res_model': 'maintenance.request',
|
|
||||||
'type': 'ir.actions.act_window',
|
|
||||||
'context': {
|
|
||||||
'default_company_id': self.company_id.id,
|
|
||||||
'default_production_id': self.id,
|
|
||||||
},
|
|
||||||
'domain': [('production_id', '=', self.id)],
|
|
||||||
}
|
|
||||||
if self.maintenance_count == 1:
|
|
||||||
production = self.env['maintenance.request'].search([('production_id', '=', self.id)])
|
|
||||||
action['view_mode'] = 'form'
|
|
||||||
action['res_id'] = production.id
|
|
||||||
return action
|
|
||||||
|
|
||||||
|
|
||||||
class MrpProductionWorkcenterLine(models.Model):
|
|
||||||
_inherit = "mrp.workorder"
|
|
||||||
|
|
||||||
def button_maintenance_req(self):
|
|
||||||
self.ensure_one()
|
|
||||||
return {
|
|
||||||
'name': _('New Maintenance Request'),
|
|
||||||
'view_mode': 'form',
|
|
||||||
'views': [(self.env.ref('mrp_maintenance.maintenance_request_view_form_inherit_mrp').id, 'form')],
|
|
||||||
'res_model': 'maintenance.request',
|
|
||||||
'type': 'ir.actions.act_window',
|
|
||||||
'context': {
|
|
||||||
'default_company_id': self.company_id.id,
|
|
||||||
'default_workorder_id': self.id,
|
|
||||||
'default_production_id': self.production_id.id,
|
|
||||||
'discard_on_footer_button': True,
|
|
||||||
},
|
|
||||||
'target': 'new',
|
|
||||||
'domain': [('workorder_id', '=', self.id)]
|
|
||||||
}
|
|
||||||
@@ -1,449 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Part of SmartGo. See LICENSE file for full copyright and licensing details.
|
|
||||||
import base64
|
|
||||||
import logging
|
|
||||||
import math
|
|
||||||
import json
|
|
||||||
import requests
|
|
||||||
from io import BytesIO
|
|
||||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
|
||||||
from pystrich.code128 import Code128Encoder
|
|
||||||
from odoo.exceptions import ValidationError
|
|
||||||
from datetime import datetime, timedelta
|
|
||||||
from dateutil.relativedelta import relativedelta
|
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class CNCprocessing(models.Model):
|
|
||||||
_inherit = 'cnc.processing'
|
|
||||||
_description = "CNC加工"
|
|
||||||
|
|
||||||
workorder_id = fields.Many2one('mrp.workorder', string="工单")
|
|
||||||
|
|
||||||
# mrs下发编程单创建CNC加工
|
|
||||||
def CNCprocessing_create(self, obj):
|
|
||||||
workorder = self.env['mrp.workorder'].search([('production_id', '=', obj['manufacturing_order_no']),
|
|
||||||
('processing_panel', '=', obj['processing_panel']),
|
|
||||||
('routing_type', '=', 'CNC加工')])
|
|
||||||
self.env['cnc.processing'].create({
|
|
||||||
'workorder_id': workorder.id,
|
|
||||||
'FNo': obj['sequence_number'],
|
|
||||||
'FPGName': obj['program_name'],
|
|
||||||
'FKnifeName': obj['cutting_tool_name'],
|
|
||||||
'FDNo': obj['cutting_tool_no'],
|
|
||||||
'FWorkType': obj['processing_type'],
|
|
||||||
'FXY': obj['margin_x_y'],
|
|
||||||
'FZ': obj['margin_z'],
|
|
||||||
'FJGSD': obj['depth_of_processing_z'],
|
|
||||||
'FSCCD': obj['cutting_tool_extension_length'],
|
|
||||||
'FDJSpec': obj['cutting_tool_handle_type'],
|
|
||||||
# 'FJGDate': obj['']
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
class Tray(models.Model):
|
|
||||||
_inherit = 'sf.tray'
|
|
||||||
_description = '托盘'
|
|
||||||
qr_image = fields.Binary(string="托盘二维码", compute='compute_qr_image')
|
|
||||||
|
|
||||||
production_id = fields.Many2one('mrp.production', string='制造订单',
|
|
||||||
related='workorder_id.production_id'
|
|
||||||
)
|
|
||||||
workorder_id = fields.Many2one('mrp.workorder', string="工单"
|
|
||||||
)
|
|
||||||
|
|
||||||
@api.onchange('production_id')
|
|
||||||
def updateTrayState(self):
|
|
||||||
|
|
||||||
if self.workorder_id != False:
|
|
||||||
self.state = '占用'
|
|
||||||
else:
|
|
||||||
self.state = '空闲'
|
|
||||||
|
|
||||||
def unclamp(self):
|
|
||||||
self.workorder_id = False
|
|
||||||
self.production_id = False
|
|
||||||
self.state = '空闲'
|
|
||||||
|
|
||||||
@api.depends('code')
|
|
||||||
def compute_qr_image(self):
|
|
||||||
for item in self:
|
|
||||||
if not item.code:
|
|
||||||
item.qr_image = False
|
|
||||||
continue
|
|
||||||
# 根据code动态生成二维码图片
|
|
||||||
# qr = qrcode.QRCode(
|
|
||||||
# version=1,
|
|
||||||
# error_correction=qrcode.constants.ERROR_CORRECT_L,
|
|
||||||
# box_size=10,
|
|
||||||
# border=4,
|
|
||||||
# )
|
|
||||||
# qr.add_data(item.code)
|
|
||||||
# qr.make(fit=True)
|
|
||||||
# img = qr.make_image()
|
|
||||||
# 生成条形码文件
|
|
||||||
# bar = barcode.get("ean13", "123456789102", writer=ImageWriter())
|
|
||||||
# a = bar.get_fullcode()
|
|
||||||
# b = bar.save('occ')
|
|
||||||
# 生成条形码图片
|
|
||||||
partner_encoder = Code128Encoder(item.code)
|
|
||||||
# 转换bytes流
|
|
||||||
temp = BytesIO()
|
|
||||||
partner_encoder.save(temp)
|
|
||||||
# img.save(temp, format='PNG')
|
|
||||||
qr_image = base64.b64encode(temp.getvalue())
|
|
||||||
item.qr_image = qr_image
|
|
||||||
|
|
||||||
|
|
||||||
'''
|
|
||||||
工单绑定托盘信息
|
|
||||||
'''
|
|
||||||
|
|
||||||
|
|
||||||
class MrpWorkOrder(models.Model):
|
|
||||||
_inherit = 'mrp.workorder'
|
|
||||||
_description = '工单'
|
|
||||||
|
|
||||||
def button_start(self):
|
|
||||||
if self.state == 'waiting':
|
|
||||||
self.ensure_one()
|
|
||||||
if any(not time.date_end for time in self.time_ids.filtered(lambda t: t.user_id.id == self.env.user.id)):
|
|
||||||
return True
|
|
||||||
# As button_start is automatically called in the new view
|
|
||||||
if self.state in ('done', 'cancel'):
|
|
||||||
return True
|
|
||||||
|
|
||||||
if self.product_tracking == 'serial':
|
|
||||||
self.qty_producing = 1.0
|
|
||||||
else:
|
|
||||||
self.qty_producing = self.qty_remaining
|
|
||||||
|
|
||||||
self.env['mrp.workcenter.productivity'].create(
|
|
||||||
self._prepare_timeline_vals(self.duration, datetime.now())
|
|
||||||
)
|
|
||||||
if self.production_id.state != 'progress':
|
|
||||||
self.production_id.write({
|
|
||||||
'date_start': datetime.now(),
|
|
||||||
})
|
|
||||||
if self.state == 'progress':
|
|
||||||
return True
|
|
||||||
start_date = datetime.now()
|
|
||||||
vals = {
|
|
||||||
'state': 'progress',
|
|
||||||
'date_start': start_date,
|
|
||||||
}
|
|
||||||
if not self.leave_id:
|
|
||||||
leave = self.env['resource.calendar.leaves'].create({
|
|
||||||
'name': self.display_name,
|
|
||||||
'calendar_id': self.workcenter_id.resource_calendar_id.id,
|
|
||||||
'date_from': start_date,
|
|
||||||
'date_to': start_date + relativedelta(minutes=self.duration_expected),
|
|
||||||
'resource_id': self.workcenter_id.resource_id.id,
|
|
||||||
'time_type': 'other'
|
|
||||||
})
|
|
||||||
vals['leave_id'] = leave.id
|
|
||||||
return self.write(vals)
|
|
||||||
else:
|
|
||||||
if self.date_planned_start > start_date:
|
|
||||||
vals['date_planned_start'] = start_date
|
|
||||||
if self.date_planned_finished and self.date_planned_finished < start_date:
|
|
||||||
vals['date_planned_finished'] = start_date
|
|
||||||
return self.write(vals)
|
|
||||||
else:
|
|
||||||
raise ValidationError(_('请先完成上一步工单'))
|
|
||||||
|
|
||||||
# def get_tray_info(self):
|
|
||||||
# @api.onchange('X_axis', 'Y_axis', 'Z_axis')
|
|
||||||
# def get_center_point(self):
|
|
||||||
# return 'X:%s,Y:%s,Z:%s' % (self.X_axis, self.Y_axis, self.Z_axis)
|
|
||||||
# 加工面
|
|
||||||
# surface = fields.Selection([("前面", "前面"), ("后面", "后面"), ("左面", "左面"), ("右面", "右面"),
|
|
||||||
# ("上面", "上面")], string="加工面1")
|
|
||||||
|
|
||||||
material_center_point = fields.Char(string='配料中心点')
|
|
||||||
X1_axis = fields.Float(string='Lx1', default=0)
|
|
||||||
Y1_axis = fields.Float(string='Ly1', default=0)
|
|
||||||
Z1_axis = fields.Float(string='Lz1', default=0)
|
|
||||||
X2_axis = fields.Float(string='Lx2', default=0)
|
|
||||||
Y2_axis = fields.Float(string='Ly2', default=0)
|
|
||||||
Z2_axis = fields.Float(string='Lz2', default=0)
|
|
||||||
X3_axis = fields.Float(string='Fx3', default=0)
|
|
||||||
Y3_axis = fields.Float(string='Fy3', default=0)
|
|
||||||
Z3_axis = fields.Float(string='Fz3', default=0)
|
|
||||||
X4_axis = fields.Float(string='Fx4', default=0)
|
|
||||||
Y4_axis = fields.Float(string='Fy4', default=0)
|
|
||||||
Z4_axis = fields.Float(string='Fz4', default=0)
|
|
||||||
X5_axis = fields.Float(string='Rx5', default=0)
|
|
||||||
Y5_axis = fields.Float(string='Ry5', default=0)
|
|
||||||
Z5_axis = fields.Float(string='Rz5', default=0)
|
|
||||||
X6_axis = fields.Float(string='Rx6', default=0)
|
|
||||||
Y6_axis = fields.Float(string='Ry6', default=0)
|
|
||||||
Z6_axis = fields.Float(string='Rz6', default=0)
|
|
||||||
X7_axis = fields.Float(string='Bx7', default=0)
|
|
||||||
Y7_axis = fields.Float(string='By7', default=0)
|
|
||||||
Z7_axis = fields.Float(string='Bz7', default=0)
|
|
||||||
X8_axis = fields.Float(string='Bx8', default=0)
|
|
||||||
Y8_axis = fields.Float(string='By8', default=0)
|
|
||||||
Z8_axis = fields.Float(string='Bz8', default=0)
|
|
||||||
X9_axis = fields.Float(string='Uz9', default=0)
|
|
||||||
Y9_axis = fields.Float(string='Uz9', default=0)
|
|
||||||
Z9_axis = fields.Float(string='Uz9', default=0)
|
|
||||||
X10_axis = fields.Float(string='Uz10', default=0)
|
|
||||||
Y10_axis = fields.Float(string='Uz10', default=0)
|
|
||||||
Z10_axis = fields.Float(string='Uz10', default=0)
|
|
||||||
|
|
||||||
# 计算配料中心点和与x轴倾斜度方法
|
|
||||||
def getcenter(self):
|
|
||||||
x1 = self.X1_axis
|
|
||||||
x2 = self.X2_axis
|
|
||||||
x3 = self.X3_axis
|
|
||||||
x4 = self.X4_axis
|
|
||||||
x5 = self.X5_axis
|
|
||||||
x6 = self.X6_axis
|
|
||||||
x7 = self.X7_axis
|
|
||||||
x8 = self.X8_axis
|
|
||||||
y1 = self.Y1_axis
|
|
||||||
y2 = self.Y2_axis
|
|
||||||
y3 = self.Y3_axis
|
|
||||||
y4 = self.Y4_axis
|
|
||||||
y5 = self.Y5_axis
|
|
||||||
y6 = self.Y6_axis
|
|
||||||
y7 = self.Y7_axis
|
|
||||||
y8 = self.Y8_axis
|
|
||||||
z1 = self.Z9_axis
|
|
||||||
x0 = ((x3 - x4) * (x2 * y1 - x1 * y2) - (x1 - x2) * (x4 * y3 - x3 * y4)) / (
|
|
||||||
(x3 - x4) * (y1 - y2) - (x1 - x2) * (y3 - y4))
|
|
||||||
y0 = ((y3 - y4) * (y2 * x1 - y1 * x2) - (y1 - y2) * (y4 * x3 - y3 * x4)) / (
|
|
||||||
(y3 - y4) * (x1 - x2) - (y1 - y2) * (x3 - x4))
|
|
||||||
x1 = ((x7 - x8) * (x6 * y5 - x5 * y6) - (x5 - x6) * (x8 * y7 - x7 * y8)) / (
|
|
||||||
(x7 - x8) * (y5 - y6) - (x5 - x6) * (y7 - y8));
|
|
||||||
y1 = ((y7 - y8) * (y6 * x5 - y5 * x6) - (y5 - y6) * (y8 * x7 - y7 * x8)) / (
|
|
||||||
(y7 - y8) * (x5 - x6) - (y5 - y6) * (x7 - x8))
|
|
||||||
x = (x0 + x1) / 2
|
|
||||||
y = (y0 + y1) / 2
|
|
||||||
z = z1 / 2
|
|
||||||
|
|
||||||
jd = math.atan2((x5 - x6), (y5 - y6))
|
|
||||||
jdz = jd * 180 / math.pi
|
|
||||||
print("(%.2f,%.2f)" % (x, y))
|
|
||||||
self.material_center_point = ("(%.2f,%.2f,%.2f)" % (x, y, z))
|
|
||||||
self.X_deviation_angle = jdz
|
|
||||||
|
|
||||||
X_deviation_angle = fields.Integer(string="X轴偏差度", default=0)
|
|
||||||
|
|
||||||
test_results = fields.Selection([("合格", "合格"), ("返工", "返工"), ("报废", "报废")], string="检测结果")
|
|
||||||
|
|
||||||
cnc_ids = fields.One2many("cnc.processing", 'workorder_id', string="CNC加工")
|
|
||||||
|
|
||||||
tray_code = fields.Char(string="托盘")
|
|
||||||
|
|
||||||
# 扫码绑定托盘方法
|
|
||||||
def gettray(self):
|
|
||||||
if self.tray_code != False:
|
|
||||||
values = self.env['sf.tray'].search([("code", "=", self.tray_code)])
|
|
||||||
if values:
|
|
||||||
if values.state == "占用":
|
|
||||||
raise ValidationError('该托盘已占用')
|
|
||||||
if values.state == "报损":
|
|
||||||
raise ValidationError('该托盘已损坏')
|
|
||||||
else:
|
|
||||||
values.update({
|
|
||||||
'workorder_id': self,
|
|
||||||
'production_id': self.production_id,
|
|
||||||
'state': '占用',
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
raise ValidationError('该托盘编码已失效')
|
|
||||||
else:
|
|
||||||
return ""
|
|
||||||
|
|
||||||
# 解除托盘绑定
|
|
||||||
def unbindtray(self):
|
|
||||||
tray = self.env['sf.tray'].search([("production_id", "=", self.production_id.id)])
|
|
||||||
if tray:
|
|
||||||
tray.unclamp()
|
|
||||||
|
|
||||||
return ""
|
|
||||||
|
|
||||||
def recreateManufacturingOrWorkerOrder(self):
|
|
||||||
"""
|
|
||||||
重新生成制造订单或者重新生成工单
|
|
||||||
"""
|
|
||||||
if self.test_results == '报废':
|
|
||||||
values = self.env['mrp.production'].create_production1_values(self.production_id)
|
|
||||||
productions = self.env['mrp.production'].with_user(SUPERUSER_ID).sudo().with_company(
|
|
||||||
self.production_id.company_id).create(
|
|
||||||
values)
|
|
||||||
self.env['stock.move'].sudo().create(productions._get_moves_raw_values())
|
|
||||||
self.env['stock.move'].sudo().create(productions._get_moves_finished_values())
|
|
||||||
productions._create_workorder()
|
|
||||||
productions.filtered(lambda p: (not p.orderpoint_id and p.move_raw_ids) or \
|
|
||||||
(
|
|
||||||
p.move_dest_ids.procure_method != 'make_to_order' and not p.move_raw_ids and not p.workorder_ids)).action_confirm()
|
|
||||||
|
|
||||||
for production in productions:
|
|
||||||
origin_production = production.move_dest_ids and production.move_dest_ids[
|
|
||||||
0].raw_material_production_id or False
|
|
||||||
orderpoint = production.orderpoint_id
|
|
||||||
if orderpoint and orderpoint.create_uid.id == SUPERUSER_ID and orderpoint.trigger == 'manual':
|
|
||||||
production.message_post(
|
|
||||||
body=_('This production order has been created from Replenishment Report.'),
|
|
||||||
message_type='comment',
|
|
||||||
subtype_xmlid='mail.mt_note')
|
|
||||||
elif orderpoint:
|
|
||||||
production.message_post_with_view(
|
|
||||||
'mail.message_origin_link',
|
|
||||||
values={'self': production, 'origin': orderpoint},
|
|
||||||
subtype_id=self.env.ref('mail.mt_note').id)
|
|
||||||
elif origin_production:
|
|
||||||
production.message_post_with_view(
|
|
||||||
'mail.message_origin_link',
|
|
||||||
values={'self': production, 'origin': origin_production},
|
|
||||||
subtype_id=self.env.ref('mail.mt_note').id)
|
|
||||||
if self.test_results == '返工':
|
|
||||||
productions = self.production_id
|
|
||||||
self.env['stock.move'].sudo().create(productions._get_moves_raw_values())
|
|
||||||
self.env['stock.move'].sudo().create(productions._get_moves_finished_values())
|
|
||||||
productions._create_workorder2(self.processing_panel)
|
|
||||||
else:
|
|
||||||
return True
|
|
||||||
|
|
||||||
# cnc程序获取
|
|
||||||
|
|
||||||
def fetchCNC(self):
|
|
||||||
res = [{'model_code': self.product_id.barcode, 'production_no': self.production_id.name,
|
|
||||||
'machine_tool_code': self.workcenter_id.machine_tool_id.code,
|
|
||||||
'material_code': self.env['mrs.production.materials'].search(
|
|
||||||
[('id', '=', self.product_id.materials_id.id)]).materials_no,
|
|
||||||
'material_type_code': self.env['mrs.materials.model'].search(
|
|
||||||
[('id', '=', self.product_id.materials_type_id.id)]).materials_no,
|
|
||||||
'embryo_long': self.product_id.bom_ids.bom_line_ids.product_id.long,
|
|
||||||
'embryo_height': self.product_id.bom_ids.bom_line_ids.product_id.height,
|
|
||||||
'embryo_width': self.product_id.bom_ids.bom_line_ids.product_id.width
|
|
||||||
# 'factory_code': self.env.user.company_id.partner_id.
|
|
||||||
}]
|
|
||||||
configsettings = self.env['res.config.settings'].get_values()
|
|
||||||
config_header = Common.get_headers(self, configsettings['token'], configsettings['mrs_secret_key'])
|
|
||||||
url = '/api/intelligent_programming/create'
|
|
||||||
config_url = configsettings['mrs_url'] + url
|
|
||||||
res_str = json.dumps(res)
|
|
||||||
ret = requests.post(config_url, json={"result": res_str}, data=None, headers=config_header)
|
|
||||||
ret = ret.json()
|
|
||||||
result = json.loads(ret['result'])
|
|
||||||
if result['status'] == 1:
|
|
||||||
return self.write({'state': 'progress'})
|
|
||||||
|
|
||||||
def json_workorder_str1(self, k, production, route):
|
|
||||||
workorders_values_str = [0, '', {
|
|
||||||
'product_uom_id': production.product_uom_id.id,
|
|
||||||
'qty_producing': 0,
|
|
||||||
'operation_id': False,
|
|
||||||
'name': route.route_workcenter_id.name,
|
|
||||||
'processing_panel': k,
|
|
||||||
'routing_type': route.routing_type,
|
|
||||||
'workcenter_id': self.env['mrp.routing.workcenter'].get_workcenter(route.workcenter_ids.ids),
|
|
||||||
'date_planned_start': False,
|
|
||||||
'date_planned_finished': False,
|
|
||||||
'duration_expected': 60,
|
|
||||||
'duration': 0
|
|
||||||
}]
|
|
||||||
return workorders_values_str
|
|
||||||
|
|
||||||
|
|
||||||
'''
|
|
||||||
制造订单绑定托盘信息
|
|
||||||
'''
|
|
||||||
|
|
||||||
|
|
||||||
class MrpProduction(models.Model):
|
|
||||||
_inherit = 'mrp.production'
|
|
||||||
_description = "制造订单"
|
|
||||||
tray_ids = fields.One2many('sf.tray', 'production_id', string="托盘")
|
|
||||||
|
|
||||||
def create_production1_values(self, production):
|
|
||||||
production_values_str = {'origin': production.origin,
|
|
||||||
'product_id': production.product_id.id,
|
|
||||||
'product_description_variants': production.product_description_variants,
|
|
||||||
'product_qty': production.product_qty,
|
|
||||||
'product_uom_id': production.product_uom_id.id,
|
|
||||||
'location_src_id': production.location_src_id.id,
|
|
||||||
'location_dest_id': production.location_dest_id.id,
|
|
||||||
'bom_id': production.bom_id.id,
|
|
||||||
'date_deadline': production.date_deadline,
|
|
||||||
'date_planned_start': production.date_planned_start,
|
|
||||||
'date_planned_finished': production.date_planned_finished,
|
|
||||||
'procurement_group_id': False,
|
|
||||||
'propagate_cancel': production.propagate_cancel,
|
|
||||||
'orderpoint_id': production.orderpoint_id.id,
|
|
||||||
'picking_type_id': production.picking_type_id.id,
|
|
||||||
'company_id': production.company_id.id,
|
|
||||||
'move_dest_ids': production.move_dest_ids.ids,
|
|
||||||
'user_id': production.user_id.id}
|
|
||||||
return production_values_str
|
|
||||||
|
|
||||||
def _reset_work_order_sequence1(self, k):
|
|
||||||
for rec in self:
|
|
||||||
current_sequence = 1
|
|
||||||
for work in rec.workorder_ids:
|
|
||||||
work.sequence = current_sequence
|
|
||||||
current_sequence += 1
|
|
||||||
|
|
||||||
def _create_workorder1(self, k):
|
|
||||||
for production in self:
|
|
||||||
if not production.bom_id or not production.product_id:
|
|
||||||
continue
|
|
||||||
workorders_values = []
|
|
||||||
|
|
||||||
product_qty = production.product_uom_id._compute_quantity(production.product_qty,
|
|
||||||
production.bom_id.product_uom_id)
|
|
||||||
exploded_boms, dummy = production.bom_id.explode(production.product_id,
|
|
||||||
product_qty / production.bom_id.product_qty,
|
|
||||||
picking_type=production.bom_id.picking_type_id)
|
|
||||||
|
|
||||||
for bom, bom_data in exploded_boms:
|
|
||||||
# If the operations of the parent BoM and phantom BoM are the same, don't recreate work orders.
|
|
||||||
if not (bom.operation_ids and (not bom_data['parent_line'] or bom_data[
|
|
||||||
'parent_line'].bom_id.operation_ids != bom.operation_ids)):
|
|
||||||
continue
|
|
||||||
for operation in bom.operation_ids:
|
|
||||||
if operation._skip_operation_line(bom_data['product']):
|
|
||||||
continue
|
|
||||||
workorders_values += [{
|
|
||||||
'name': operation.name,
|
|
||||||
'production_id': production.id,
|
|
||||||
'workcenter_id': operation.workcenter_id.id,
|
|
||||||
'product_uom_id': production.product_uom_id.id,
|
|
||||||
'operation_id': operation.id,
|
|
||||||
'state': 'pending',
|
|
||||||
}]
|
|
||||||
# 根据加工面板的面数及对应的工序模板生成工单
|
|
||||||
i = 0
|
|
||||||
production.product_id.model_processing_panel = k
|
|
||||||
processing_panel_len = len(k)
|
|
||||||
for k in (production.product_id.model_processing_panel.split(',')):
|
|
||||||
routingworkcenter = self.env['sf.model.type.routing.sort'].search(
|
|
||||||
[('model_type_id', '=', production.product_id.model_type_id.id)],
|
|
||||||
|
|
||||||
order='sequence asc'
|
|
||||||
)
|
|
||||||
i += 1
|
|
||||||
for route in routingworkcenter:
|
|
||||||
|
|
||||||
if route.routing_type == '后置三元质量检测':
|
|
||||||
workorders_values.append(
|
|
||||||
self.env['mrp.workorder'].json_workorder_str1(k, production, route)
|
|
||||||
)
|
|
||||||
if route.routing_type == 'CNC加工':
|
|
||||||
workorders_values.append(
|
|
||||||
self.env['mrp.workorder'].json_workorder_str1(k, production, route))
|
|
||||||
|
|
||||||
production.workorder_ids = workorders_values
|
|
||||||
for workorder in production.workorder_ids:
|
|
||||||
workorder.duration_expected = workorder._get_duration_expected()
|
|
||||||
|
|
||||||
def _create_workorder2(self, k):
|
|
||||||
res = self._create_workorder1(k)
|
|
||||||
self._reset_work_order_sequence1(k)
|
|
||||||
return res
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<record id="mrp_workcenter_view_kanban_inherit_workorder" model="ir.ui.view">
|
|
||||||
<field name="name">mrp.workcenter.view.kanban.inherit.mrp.workorder</field>
|
|
||||||
<field name="model">mrp.workcenter</field>
|
|
||||||
<field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<!-- Desktop view -->
|
|
||||||
<xpath expr="//div[@name='o_wo']" position="inside">
|
|
||||||
<button class="btn btn-secondary fa fa-desktop" name="action_work_order" type="object" context="{'search_default_ready': 1, 'search_default_progress': 1, 'search_default_pending': 1, 'desktop_list_view': 1, 'search_default_workcenter_id': active_id}" title="Work orders" aria-label="Work orders"/>
|
|
||||||
</xpath>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<!-- override to change the no content image -->
|
|
||||||
<record id="mrp.action_work_orders" model="ir.actions.act_window">
|
|
||||||
<field name="help" type="html">
|
|
||||||
<p class="o_view_nocontent_workorder">
|
|
||||||
No work orders to do!
|
|
||||||
</p><p>
|
|
||||||
Work orders are operations to do as part of a manufacturing order.
|
|
||||||
Operations are defined in the bill of materials or added in the manufacturing order directly.
|
|
||||||
</p><p>
|
|
||||||
Use the table work center control panel to register operations in the shop floor directly.
|
|
||||||
The tablet provides worksheets for your workers and allow them to scrap products, track time,
|
|
||||||
launch a maintenance request, perform quality tests, etc.
|
|
||||||
</p>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<menuitem id="menu_mrp_dashboard"
|
|
||||||
name="工作中心概述"
|
|
||||||
action="mrp.mrp_workcenter_kanban_action"
|
|
||||||
groups="mrp.group_mrp_routings"
|
|
||||||
parent="mrp.menu_mrp_root"
|
|
||||||
sequence="5"/>
|
|
||||||
|
|
||||||
</odoo>
|
|
||||||
@@ -1,273 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<record model="ir.actions.act_window" id="mrp_workorder_action_tablet">
|
|
||||||
<field name="name">Work Orders</field>
|
|
||||||
<field name="type">ir.actions.act_window</field>
|
|
||||||
<field name="res_model">mrp.workorder</field>
|
|
||||||
<field name="view_mode">kanban,tree,form</field>
|
|
||||||
<field name="view_ids" eval="[(5, 0, 0),
|
|
||||||
(0, 0, {'view_mode': 'kanban', 'view_id': ref('mrp.workcenter_line_kanban')}),
|
|
||||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('mrp.mrp_production_workorder_tree_editable_view')}) ]"/>
|
|
||||||
<field name="target">fullscreen</field>
|
|
||||||
<field name="domain">[('state', 'not in', ['done', 'cancel'])]</field>
|
|
||||||
<field name="context">{'search_default_workcenter_id': active_id}</field>
|
|
||||||
<field name="help" type="html">
|
|
||||||
<p class="o_view_nocontent_workorder">
|
|
||||||
No work orders to do!
|
|
||||||
</p><p>
|
|
||||||
Work orders are operations to do as part of a manufacturing order.
|
|
||||||
Operations are defined in the bill of materials or added in the manufacturing order directly.
|
|
||||||
</p><p>
|
|
||||||
Use the table work center control panel to register operations in the shop floor directly.
|
|
||||||
The tablet provides worksheets for your workers and allow them to scrap products, track time,
|
|
||||||
launch a maintenance request, perform quality tests, etc.
|
|
||||||
</p>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
|
|
||||||
<record id="sf_install_the_tray_workorder_form_view" model="ir.ui.view">
|
|
||||||
<field name="name">装夹工序工单</field>
|
|
||||||
<field name="model">mrp.workorder</field>
|
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<!-- <field name="production_id" position="after">-->
|
|
||||||
<!-- <field name="tray_code" readonly="1" attrs='{"invisible": [("tray_code","=",False)]}'/>-->
|
|
||||||
<!-- </field>-->
|
|
||||||
|
|
||||||
<xpath expr="//page[last()]" position="after">
|
|
||||||
<page string="获取CNC加工程序" attrs='{"invisible": [("routing_type","!=","获取CNC加工程序")]}'>
|
|
||||||
<div class="col-12 col-lg-6 o_setting_box">
|
|
||||||
<button type="object" class="oe_highlight" name="fetchCNC" string="获取CNC程序代码"
|
|
||||||
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</page>
|
|
||||||
|
|
||||||
</xpath>
|
|
||||||
<xpath expr="//page[last()]" position="after" >
|
|
||||||
<page string="装夹托盘" attrs='{"invisible": [("routing_type","!=","装夹")]}'>
|
|
||||||
<group >
|
|
||||||
|
|
||||||
<field name="routing_type" invisible="1"/>
|
|
||||||
<field name="processing_panel" readonly = "1" />
|
|
||||||
<field name="tray_code"/>
|
|
||||||
<div class="col-12 col-lg-6 o_setting_box">
|
|
||||||
<button type="object" class="oe_highlight" name="gettray" string="绑定托盘"
|
|
||||||
attrs='{"invisible": [("production_id","=",False)]}'
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</group>
|
|
||||||
</page>
|
|
||||||
|
|
||||||
</xpath>
|
|
||||||
<xpath expr="//page[last()]" position="after">
|
|
||||||
|
|
||||||
<page string="三元前置检测定位参数" attrs='{"invisible": [("routing_type","!=","前置三元定位检测")]}'>
|
|
||||||
<group>
|
|
||||||
<group>
|
|
||||||
<field name="processing_panel" readonly = "1"/>
|
|
||||||
|
|
||||||
</group>
|
|
||||||
|
|
||||||
</group>
|
|
||||||
<group>
|
|
||||||
<div>左面:</div>
|
|
||||||
<div></div>
|
|
||||||
<div class="o_address_format">
|
|
||||||
<label for="X1_axis" string="x1"/>
|
|
||||||
<field name='X1_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Y1_axis" string="y1"/>
|
|
||||||
<field name='Y1_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Z1_axis" string="z1"/>
|
|
||||||
<field name='Z1_axis' class="o_address_zip"/>
|
|
||||||
</div>
|
|
||||||
<div class="o_address_format">
|
|
||||||
<label for="X2_axis" string="x2"/>
|
|
||||||
<field name='X2_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Y2_axis" string="y2"/>
|
|
||||||
<field name='Y2_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Z2_axis" string="z2"/>
|
|
||||||
<field name='Z2_axis' class="o_address_zip"/>
|
|
||||||
</div>
|
|
||||||
<div>前面:</div>
|
|
||||||
<div></div>
|
|
||||||
<div class="o_address_format">
|
|
||||||
<label for="X3_axis" string="x1"/>
|
|
||||||
<field name='X3_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Y3_axis" string="y1"/>
|
|
||||||
<field name='Y3_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Z3_axis" string="z1"/>
|
|
||||||
<field name='Z3_axis' class="o_address_zip"/>
|
|
||||||
</div>
|
|
||||||
<div class="o_address_format">
|
|
||||||
<label for="X4_axis" string="x2"/>
|
|
||||||
<field name='X4_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Y4_axis" string="y2"/>
|
|
||||||
<field name='Y4_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Z4_axis" string="z2"/>
|
|
||||||
<field name='Z4_axis' class="o_address_zip"/>
|
|
||||||
</div>
|
|
||||||
<div>右面:</div>
|
|
||||||
<div></div>
|
|
||||||
<div class="o_address_format">
|
|
||||||
<label for="X5_axis" string="x1"/>
|
|
||||||
<field name='X5_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Y5_axis" string="y1"/>
|
|
||||||
<field name='Y5_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Z5_axis" string="z1"/>
|
|
||||||
<field name='Z5_axis' class="o_address_zip"/>
|
|
||||||
</div>
|
|
||||||
<div class="o_address_format">
|
|
||||||
<label for="X6_axis" string="x2"/>
|
|
||||||
<field name='X6_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Y6_axis" string="y2"/>
|
|
||||||
<field name='Y6_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Z6_axis" string="z2"/>
|
|
||||||
<field name='Z6_axis' class="o_address_zip"/>
|
|
||||||
</div>
|
|
||||||
<div>后面:</div>
|
|
||||||
<div></div>
|
|
||||||
<div class="o_address_format">
|
|
||||||
<label for="X7_axis" string="x1"/>
|
|
||||||
<field name='X7_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Y7_axis" string="y1"/>
|
|
||||||
<field name='Y7_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Z7_axis" string="z1"/>
|
|
||||||
<field name='Z7_axis' class="o_address_zip"/>
|
|
||||||
</div>
|
|
||||||
<div class="o_address_format">
|
|
||||||
<label for="X8_axis" string="x2"/>
|
|
||||||
<field name='X8_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Y8_axis" string="y2"/>
|
|
||||||
<field name='Y8_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Z8_axis" string="z2"/>
|
|
||||||
<field name='Z8_axis' class="o_address_zip"/>
|
|
||||||
</div>
|
|
||||||
<div>上面:</div>
|
|
||||||
<div></div>
|
|
||||||
<div class="o_address_format">
|
|
||||||
<label for="X9_axis" string="x1"/>
|
|
||||||
<field name='X9_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Y9_axis" string="y1"/>
|
|
||||||
<field name='Y9_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Z9_axis" string="z1"/>
|
|
||||||
<field name='Z9_axis' class="o_address_zip"/>
|
|
||||||
</div>
|
|
||||||
<div class="o_address_format">
|
|
||||||
<label for="X10_axis" string="x2"/>
|
|
||||||
<field name='X10_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Y10_axis" string="y2"/>
|
|
||||||
<field name='Y10_axis' class="o_address_zip"/>
|
|
||||||
<span>&nbsp;</span>
|
|
||||||
<label for="Z10_axis" string="z2"/>
|
|
||||||
<field name='Z10_axis' class="o_address_zip"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-12 col-lg-6 o_setting_box">
|
|
||||||
<button type="object" class="oe_highlight" name="getcenter" string="计算定位"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</group>
|
|
||||||
<group>
|
|
||||||
<field name="material_center_point"/>
|
|
||||||
<field name='X_deviation_angle'/>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
</page>
|
|
||||||
|
|
||||||
|
|
||||||
</xpath>
|
|
||||||
|
|
||||||
<xpath expr="//page[last()]" position="after">
|
|
||||||
<page string="CNC程序" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
|
||||||
|
|
||||||
|
|
||||||
<field name="cnc_ids" widget="one2many">
|
|
||||||
<tree>
|
|
||||||
<field name="cnc_id"/>
|
|
||||||
<field name="FNo" />
|
|
||||||
<field name="FPGName" />
|
|
||||||
<field name="FKnifeName" />
|
|
||||||
<field name="FDNo" />
|
|
||||||
<field name="FWorkType" />
|
|
||||||
<field name="FXY" />
|
|
||||||
<field name="FZ" />
|
|
||||||
<field name="FJGSD" />
|
|
||||||
<field name="FSCCD" />
|
|
||||||
<field name="FDJSpec" />
|
|
||||||
<field name="FJGDate" />
|
|
||||||
<field name="FComment" />
|
|
||||||
</tree>
|
|
||||||
|
|
||||||
</field>
|
|
||||||
|
|
||||||
</page>
|
|
||||||
|
|
||||||
</xpath>
|
|
||||||
|
|
||||||
<xpath expr="//page[last()]" position="after">
|
|
||||||
<page string="后置三元检测" attrs='{"invisible": [("routing_type","!=","后置三元质量检测")]}'>
|
|
||||||
<group>
|
|
||||||
<field name="test_results" widget="selection"/>
|
|
||||||
<div class="col-12 col-lg-6 o_setting_box">
|
|
||||||
<button type="object" class="oe_highlight" name="recreateManufacturingOrWorkerOrder" string="检测确认"
|
|
||||||
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</group>
|
|
||||||
</page>
|
|
||||||
|
|
||||||
</xpath>
|
|
||||||
<xpath expr="//page[last()]" position="after">
|
|
||||||
<page string="解除装夹" attrs='{"invisible": [("routing_type","!=","解除装夹")]}' >
|
|
||||||
<group>
|
|
||||||
<div class="col-12 col-lg-6 o_setting_box">
|
|
||||||
<button type="object" class="oe_highlight" name="unbindtray" string="解除装夹"
|
|
||||||
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12 col-lg-6 o_setting_box">
|
|
||||||
<button type="action" class="oe_highlight" name="sf_route_workcenter.label_sf_tray_code1" string="打印标签"
|
|
||||||
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
|
|
||||||
</page>
|
|
||||||
|
|
||||||
</xpath>
|
|
||||||
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@@ -1,4 +1 @@
|
|||||||
from . import http
|
|
||||||
from . import models
|
from . import models
|
||||||
|
|
||||||
|
|
||||||
@@ -1,22 +1,18 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': '机企猫智能工厂 工作订单排序',
|
'name': '机企猫智能工厂 销售模块',
|
||||||
'version': '1.0',
|
'version': '1.0',
|
||||||
'summary': '智能工厂工作订单',
|
'summary': '智能工厂销售模块',
|
||||||
'sequence': 1,
|
'sequence': 1,
|
||||||
'description': """
|
'description': """
|
||||||
|
在本模块,为业务平台传过来的订单信息
|
||||||
""",
|
""",
|
||||||
'category': '',
|
'category': 'sf',
|
||||||
'website': 'https://www.sf.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['mrp'],
|
'depends': ['sale', 'sf_bf_connect'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/mrp_workorder_view.xml',
|
'views/sale_order_view.xml'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
],
|
],
|
||||||
1
sf_sale/models/__init__.py
Normal file
1
sf_sale/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from. import sale_order
|
||||||
Reference in New Issue
Block a user