合并代码
This commit is contained in:
@@ -10,18 +10,13 @@
|
||||
""",
|
||||
'category': 'YZ',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['account', 'base', 'mrp', 'sale'],
|
||||
'depends': ['account', 'base', 'mrp'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'data/product_data.xml',
|
||||
# 'data/process_data.xml',
|
||||
'views/mrs_base_view.xml',
|
||||
'views/mrs_common_view.xml',
|
||||
'views/menu_view.xml',
|
||||
'views/mrp_routing_workcenter_view.xml',
|
||||
'views/sale_order_view.xml',
|
||||
'views/product_template_view.xml',
|
||||
"views/menu_view.xml"
|
||||
|
||||
],
|
||||
'demo': [
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
from. import sf_base
|
||||
from. import sf_common
|
||||
from . import product_template
|
||||
from . import sale_order
|
||||
from . import process
|
||||
|
||||
@@ -13,12 +13,7 @@ access_mrs_production_materials,mrs_production_materials,model_mrs_production_ma
|
||||
access_mrs_materials_model,mrs_materials_model,model_mrs_materials_model,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
|
||||
<<<<<<< HEAD
|
||||
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
|
||||
>>>>>>> 8e337dda97a98a9a8d0a892a2c39bc076640f6ac
|
||||
|
||||
|
||||
|
||||
|
||||
|
Can't render this file because it has a wrong number of fields in line 16.
|
@@ -142,13 +142,13 @@
|
||||
action="action_mrs_machine_control_system"/>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_model_type"
|
||||
name="模型类型"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
sequence="10"
|
||||
action="action_sf_model_type"
|
||||
/>
|
||||
<!-- <menuitem-->
|
||||
<!-- id="menu_sf_partner_views"-->
|
||||
<!-- name="工厂token"-->
|
||||
<!-- parent="menu_mrs_base"-->
|
||||
<!-- sequence="1"-->
|
||||
<!-- action="token_factory_view"-->
|
||||
<!-- />-->
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -368,8 +368,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
<field name="type_id" required="1" options="{'no_create': True}"
|
||||
domain="[('brand_id', '=', brand_id)]" attrs="{'invisible': [('brand_id','=',False)]}"/>
|
||||
<field name="type_id" required="1" options="{'no_create': True}" domain="[('brand_id', '=', brand_id)]" attrs="{'invisible': [('brand_id','=',False)]}"/>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
@@ -490,61 +489,4 @@
|
||||
</p>
|
||||
</field>
|
||||
</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"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name='routing_tmpl_ids'>
|
||||
<tree editable='bottom'>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="route_workcenter_id" string="工序"/>
|
||||
</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>
|
||||
@@ -277,23 +277,10 @@
|
||||
</record>
|
||||
|
||||
#------------------托盘------------------
|
||||
<record id="action_sf_tray" model="ir.actions.act_window">
|
||||
<field name="name">托盘</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.tray</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
创建托盘吧
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sf_tray_search" model="ir.ui.view">
|
||||
<field name="name">sf.tray.search</field>
|
||||
<field name="model">sf.tray</field>
|
||||
<field name="arch" type="xml">
|
||||
<<<<<<< HEAD
|
||||
<!-- <group>-->
|
||||
|
||||
|
||||
@@ -305,14 +292,6 @@
|
||||
<group string="分组">
|
||||
<filter name="state" string="状态" domain="[]" context="{'group_by': 'state'}"/>
|
||||
</group>
|
||||
=======
|
||||
<search string="托盘">
|
||||
<field name="name" string="名称" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码" filter_domain="[('code','ilike',self)]"/>
|
||||
</search>
|
||||
<!-- <group string="分组">-->
|
||||
<!-- <filter name="state" string="状态" domain="[]" context="{'group_by': 'state'}"/>-->
|
||||
>>>>>>> 8e337dda97a98a9a8d0a892a2c39bc076640f6ac
|
||||
<!-- </group>-->
|
||||
</field>
|
||||
</record>
|
||||
@@ -347,7 +326,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_sf_tray" model="ir.actions.act_window">
|
||||
<field name="name">托盘</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.tray</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
创建托盘吧
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,18 +1,18 @@
|
||||
<?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>-->
|
||||
<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>
|
||||
@@ -10,10 +10,11 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.cs.jikimo.com',
|
||||
'depends': ['sale', 'sf_base', 'mrp'],
|
||||
'depends': ['sale', 'sf_base'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'data/product_data.xml',
|
||||
'views/product_template_view.xml',
|
||||
'views/sale_order_view.xml'
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
|
||||
16
sf_bpm_api/data/product_data.xml
Normal file
16
sf_bpm_api/data/product_data.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?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 +1,6 @@
|
||||
from . import sale_order
|
||||
from . import product_template
|
||||
from . import http
|
||||
from . import models
|
||||
|
||||
|
||||
|
||||
|
||||
86
sf_bpm_api/models/product_template.py
Normal file
86
sf_bpm_api/models/product_template.py
Normal file
@@ -0,0 +1,86 @@
|
||||
from odoo import models, fields
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class ResProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
# 模型的长,宽,高,体积,精度,材料
|
||||
model_long = fields.Float('长[mm]', digits=(16, 3))
|
||||
model_width = fields.Float('宽[mm]', digits=(16, 3))
|
||||
model_height = fields.Float('高[mm]', digits=(16, 3))
|
||||
model_volume = fields.Float('体积[mm³]', 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='型号')
|
||||
# 胚料的长,宽,高
|
||||
embryo_long = fields.Float('长[mm]', digits=(16, 3))
|
||||
embryo_width = fields.Float('宽[mm]', digits=(16, 3))
|
||||
embryo_height = fields.Float('高[mm]', digits=(16, 3))
|
||||
embryo_materials_id = fields.Many2one('mrs.production.materials', string='材料')
|
||||
embryo_materials_type_id = fields.Many2one('mrs.materials.model', string='型号')
|
||||
|
||||
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品
|
||||
def product_create(self, product_id, item, order_id, order_number, i):
|
||||
copy_product_id = product_id.with_user(self.env.ref("base.user_admin")).copy()
|
||||
copy_product_id.product_tmpl_id.active = True
|
||||
vals = {
|
||||
'name': '%s-%s' % (order_id.name, i),
|
||||
'model_long': item['model_long'],
|
||||
'model_width': item['model_width'],
|
||||
'model_height': item['model_height'],
|
||||
'model_volume': item['model_volume'],
|
||||
'list_price': item['price'],
|
||||
'model_materials_id': self.env['mrs.production.materials'].search(
|
||||
[('materials_no', '=', item['texture_code'])]).id,
|
||||
'model_materials_type_id': self.env['mrs.materials.model'].search(
|
||||
[('materials_no', '=', item['texture_type_code'])]).id,
|
||||
'default_code': '%s-%s' % (order_number, i),
|
||||
'barcode': item['barcode'],
|
||||
'active': True
|
||||
}
|
||||
copy_product_id.sudo().write(vals)
|
||||
return copy_product_id
|
||||
|
||||
|
||||
class ResProductCategory(models.Model):
|
||||
_inherit = "product.category"
|
||||
|
||||
is_embryo = fields.Boolean('胚料')
|
||||
|
||||
|
||||
class ResMrpBom(models.Model):
|
||||
_inherit = 'mrp.bom'
|
||||
|
||||
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品后再次进行创建bom
|
||||
def bom_create(self, product):
|
||||
bom_id = self.env['mrp.bom'].create({
|
||||
'product_tmpl_id': product.product_tmpl_id.id,
|
||||
'type': 'normal',
|
||||
'product_qty': 1,
|
||||
'product_uom_id': 1
|
||||
})
|
||||
return bom_id
|
||||
|
||||
# 生成产品BOM匹配胚料,胚料的匹配规则:
|
||||
# 一、匹配的胚料类别需要带有胚料的标签;
|
||||
# 二、胚料的材料型号与生成产品的材料型号一致;
|
||||
# 三、胚料的长宽高均要大于模型的长宽高;
|
||||
# 四、如果匹配成功多个胚料,则选取体积最小的胚料;
|
||||
def bom_create_Line(self, product):
|
||||
embryo = self.env['product.product'].search(
|
||||
[('categ_id.is_embryo', '=', True), ('embryo_materials_type_id', '=', product.model_materials_type_id.id),
|
||||
('embryo_long', '>', product.model_long), ('embryo_width', '>', product.model_width),
|
||||
('embryo_height', '>', product.model_height)
|
||||
],
|
||||
limit=1,
|
||||
order='volume desc'
|
||||
)
|
||||
vals = {
|
||||
'bom_id': self.id,
|
||||
'product_id': embryo.id,
|
||||
'product_tmpl_id': embryo.product_tmpl_id.id,
|
||||
'product_qty': 1,
|
||||
'product_uom_id': 1
|
||||
}
|
||||
return self.env['mrp.bom.line'].create(vals)
|
||||
34
sf_bpm_api/models/sale_order.py
Normal file
34
sf_bpm_api/models/sale_order.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from odoo import models, fields
|
||||
from odoo.exceptions import ValidationError
|
||||
import datetime
|
||||
|
||||
|
||||
class ReSaleOrder(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
deadline_of_delivery = fields.Date('交货截止日期')
|
||||
|
||||
# 业务平台分配工厂后在智能工厂先创建销售订单
|
||||
def sale_order_create(self, deadline_of_delivery, company_id):
|
||||
now_time = datetime.datetime.now()
|
||||
order_id = self.env['sale.order'].sudo().create({
|
||||
'company_id': company_id.id,
|
||||
'date_order': now_time,
|
||||
'name': self.env['ir.sequence'].next_by_code('sale.order', sequence_date=now_time),
|
||||
'partner_id': 8,
|
||||
'state': 'sale',
|
||||
'user_id': 6,
|
||||
'deadline_of_delivery': deadline_of_delivery
|
||||
})
|
||||
return order_id
|
||||
|
||||
# 业务平台分配工厂时在创建完产品后再创建销售明细信息
|
||||
def sale_order_create_line(self, product, item):
|
||||
vals = {
|
||||
'order_id': self.id,
|
||||
'product_id': product.id,
|
||||
'name': '%s/%s/%s/%s/%s' % (item['model_long'], item['model_width'], item['model_height'], item['model_volume'], product.model_materials_id.name),
|
||||
'price_unit': item['price'],
|
||||
'product_uom_qty': item['number']
|
||||
}
|
||||
return self.env['sale.order.line'].create(vals)
|
||||
@@ -1,2 +1,5 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
69
sf_bpm_api/views/product_template_view.xml
Normal file
69
sf_bpm_api/views/product_template_view.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?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="CNC加工">
|
||||
<group string="模型">
|
||||
<group>
|
||||
<field name="model_long"/>
|
||||
<field name="model_width"/>
|
||||
<field name="model_height"/>
|
||||
<field name="model_volume"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="model_precision"/>
|
||||
<field name="model_materials_id"/>
|
||||
<field name="model_materials_type_id"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//label[@for='volume']" position="before">
|
||||
<label for="embryo_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="embryo_long" string="长"/>
|
||||
<field name="embryo_long" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="embryo_width" string="宽"/>
|
||||
<field name="embryo_width" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="embryo_height" string="高"/>
|
||||
<field name="embryo_height" class="o_address_zip"/>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//label[@for='produce_delay']" position="before">
|
||||
<label for="embryo_materials_id"
|
||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
|
||||
<div class="o_row"
|
||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}">
|
||||
<field name="embryo_materials_id"/>
|
||||
</div>
|
||||
<label for="embryo_materials_type_id"
|
||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
|
||||
<div class="o_row"
|
||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}">
|
||||
<field name="embryo_materials_type_id" domain="[('materials_id', '=', embryo_materials_id)]"/>
|
||||
</div>
|
||||
</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>
|
||||
15
sf_bpm_api/views/sale_order_view.xml
Normal file
15
sf_bpm_api/views/sale_order_view.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_sale_order_form_inherit_sf">
|
||||
<field name="name">sale.order.form.inherit.sf</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="payment_term_id" position="after">
|
||||
<field name="deadline_of_delivery"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -8,8 +8,7 @@ import qrcode
|
||||
|
||||
from io import BytesIO
|
||||
from odoo import api, fields, models
|
||||
import barcode
|
||||
from barcode.writer import ImageWriter
|
||||
|
||||
from pystrich.code128 import Code128Encoder
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
@@ -86,21 +85,15 @@ class MrpWorkOrder(models.Model):
|
||||
_inherit = 'mrp.workorder'
|
||||
_description = '工单'
|
||||
|
||||
tray_id = fields.Many2one('sf.tray', string="托盘")
|
||||
tray_code = fields.Char(
|
||||
string='托盘编码',
|
||||
related='tray_id.code')
|
||||
tray_state = fields.Selection(
|
||||
string='托盘状态',
|
||||
related='tray_id.state')
|
||||
|
||||
tray_ids = fields.One2many('sf.tray', 'workorder_id', string='托盘')
|
||||
# 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([("前面", "前面"), ("后面", "后面"), ("左面", "左面"), ("右面", "右面"),
|
||||
("上面", "上面")], required=True, default="顶面", string="加工面")
|
||||
("上面", "上面")], string="加工面1")
|
||||
|
||||
material_center_point = fields.Char(string='配料中心点')
|
||||
X1_axis = fields.Float(string='Lx1', default=0)
|
||||
Y1_axis = fields.Float(string='Ly1', default=0)
|
||||
@@ -179,6 +172,7 @@ class MrpWorkOrder(models.Model):
|
||||
test_results = fields.Selection([("合格", "合格"), ("返工", "返工"), ("报废", "报废")], string="检测结果")
|
||||
|
||||
cnc_ids = fields.One2many("cnc.processing", 'workorder_id', string="CNC加工")
|
||||
|
||||
# @api.depends('tray_id')
|
||||
# def updateTrayState(self):
|
||||
#
|
||||
@@ -193,6 +187,11 @@ class MrpWorkOrder(models.Model):
|
||||
# 'state': "占用",
|
||||
# }
|
||||
# )
|
||||
def recreateManufacturing(self):
|
||||
return ""
|
||||
|
||||
def recreateWorkerOrder(self):
|
||||
return ""
|
||||
|
||||
|
||||
'''
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
attrs='{"invisible": [("production_id","=",False)]}'/>
|
||||
<field name="workorder_id"/>
|
||||
</group>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="col
|
||||
-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="unclamp" string="解除装夹"
|
||||
attrs='{"invisible": [("state","=","空闲")]}'/>
|
||||
</div>
|
||||
|
||||
@@ -12,8 +12,10 @@
|
||||
<field name="surface" widget="radio"/>
|
||||
<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>
|
||||
|
||||
@@ -29,6 +31,8 @@
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<div>左面:</div>
|
||||
<div></div>
|
||||
<div class="o_address_city">
|
||||
<label for="X1_axis" string="Lx1"/>
|
||||
<field name='X1_axis' class="o_address_city"/>
|
||||
@@ -45,72 +49,76 @@
|
||||
<label for="Z2_axis" string="Lz2"/>
|
||||
<field name='Z2_axis' class="o_address_city"/>
|
||||
</div>
|
||||
|
||||
<div>前面:</div>
|
||||
<div></div>
|
||||
<div class="o_address_city">
|
||||
<label for="X3_axis" string="Fx3"/>
|
||||
<label for="X3_axis" string="Fx1"/>
|
||||
<field name='X3_axis' class="o_address_city"/>
|
||||
<label for="Y3_axis" string="Fy3"/>
|
||||
<label for="Y3_axis" string="Fy1"/>
|
||||
<field name='Y3_axis' class="o_address_city"/>
|
||||
<label for="Z3_axis" string="Fz3"/>
|
||||
<label for="Z3_axis" string="Fz1"/>
|
||||
<field name='Z3_axis' class="o_address_city"/>
|
||||
</div>
|
||||
<div class="o_address_city">
|
||||
<label for="X4_axis" string="Fx4"/>
|
||||
<label for="X4_axis" string="Fx2"/>
|
||||
<field name='X4_axis' class="o_address_city"/>
|
||||
<label for="Y4_axis" string="Fy4"/>
|
||||
<label for="Y4_axis" string="Fy2"/>
|
||||
<field name='Y4_axis' class="o_address_city"/>
|
||||
<label for="Z4_axis" string="Fz4"/>
|
||||
<label for="Z4_axis" string="Fz2"/>
|
||||
<field name='Z4_axis' class="o_address_city"/>
|
||||
</div>
|
||||
|
||||
<div>右面:</div>
|
||||
<div></div>
|
||||
<div class="o_address_city">
|
||||
<label for="X5_axis" string="Rx5"/>
|
||||
<label for="X5_axis" string="Rx1"/>
|
||||
<field name='X5_axis' class="o_address_city"/>
|
||||
<label for="Y5_axis" string="Ry5"/>
|
||||
<label for="Y5_axis" string="Ry1"/>
|
||||
<field name='Y5_axis' class="o_address_city"/>
|
||||
<label for="Z5_axis" string="Rz5"/>
|
||||
<label for="Z5_axis" string="Rz1"/>
|
||||
<field name='Z5_axis' class="o_address_city"/>
|
||||
</div>
|
||||
<div class="o_address_city">
|
||||
<label for="X6_axis" string="Rx6"/>
|
||||
<label for="X6_axis" string="Rx2"/>
|
||||
<field name='X6_axis' class="o_address_city"/>
|
||||
<label for="Y6_axis" string="Ry6"/>
|
||||
<label for="Y6_axis" string="Ry2"/>
|
||||
<field name='Y6_axis' class="o_address_city"/>
|
||||
<label for="Z6_axis" string="Rz6"/>
|
||||
<label for="Z6_axis" string="Rz2"/>
|
||||
<field name='Z6_axis' class="o_address_city"/>
|
||||
</div>
|
||||
|
||||
<div>下面:</div>
|
||||
<div></div>
|
||||
<div class="o_address_city">
|
||||
<label for="X7_axis" string="Bx7"/>
|
||||
<label for="X7_axis" string="Bx1"/>
|
||||
<field name='X7_axis' class="o_address_city"/>
|
||||
<label for="Y7_axis" string="By7"/>
|
||||
<label for="Y7_axis" string="By1"/>
|
||||
<field name='Y7_axis' class="o_address_city"/>
|
||||
<label for="Z7_axis" string="Bz7"/>
|
||||
<label for="Z7_axis" string="Bz1"/>
|
||||
<field name='Z7_axis' class="o_address_city"/>
|
||||
</div>
|
||||
<div class="o_address_city">
|
||||
<label for="X8_axis" string="Bx8"/>
|
||||
<label for="X8_axis" string="Bx2"/>
|
||||
<field name='X8_axis' class="o_address_city"/>
|
||||
<label for="Y8_axis" string="By8"/>
|
||||
<label for="Y8_axis" string="By2"/>
|
||||
<field name='Y8_axis' class="o_address_city"/>
|
||||
<label for="Z8_axis" string="Bz8"/>
|
||||
<label for="Z8_axis" string="Bz2"/>
|
||||
<field name='Z8_axis' class="o_address_city"/>
|
||||
</div>
|
||||
|
||||
<div>上面:</div>
|
||||
<div></div>
|
||||
<div class="o_address_city">
|
||||
<label for="X9_axis" string="Ux9"/>
|
||||
<label for="X9_axis" string="Ux1"/>
|
||||
<field name='X9_axis' class="o_address_city"/>
|
||||
<label for="Y9_axis" string="Uy9"/>
|
||||
<label for="Y9_axis" string="Uy1"/>
|
||||
<field name='Y9_axis' class="o_address_city"/>
|
||||
<label for="Z9_axis" string="Uz9"/>
|
||||
<label for="Z9_axis" string="Uz1"/>
|
||||
<field name='Z9_axis' class="o_address_city"/>
|
||||
</div>
|
||||
<div class="o_address_city">
|
||||
<label for="X10_axis" string="Ux10"/>
|
||||
<label for="X10_axis" string="Ux2"/>
|
||||
<field name='X10_axis' class="o_address_city"/>
|
||||
<label for="Y10_axis" string="Uy10"/>
|
||||
<label for="Y10_axis" string="Uy2"/>
|
||||
<field name='Y10_axis' class="o_address_city"/>
|
||||
<label for="Z10_axis" string="Uz10"/>
|
||||
<label for="Z10_axis" string="Uz2"/>
|
||||
<field name='Z10_axis' class="o_address_city"/>
|
||||
</div>
|
||||
|
||||
@@ -146,11 +154,27 @@
|
||||
<page string="后置三元检测">
|
||||
<group>
|
||||
<field name="test_results" widget="radio"/>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="recreateWorkerOrder" string="重新生成工单"
|
||||
attrs='{"invisible": [("test_results","!=","返工")]}'
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="recreateManufacturing" string="重新生成制造订单"
|
||||
attrs='{"invisible": [("test_results","!=","报废")]}'
|
||||
/>
|
||||
</div>
|
||||
|
||||
</group>
|
||||
</page>
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//page[last()]" position="after">
|
||||
<page string="解除装夹">
|
||||
<field name="test_results" widget="radio"/>
|
||||
</page>
|
||||
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user