Accept Merge Request #126: (feature/sf优化界面 -> develop)

Merge Request: 优化工单展示

Created By: @龚启豪
Accepted By: @龚启豪
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/126
This commit is contained in:
龚启豪
2023-02-02 15:09:53 +08:00
6 changed files with 57 additions and 11 deletions

View File

@@ -13,7 +13,8 @@
'depends': ['mrp', 'base', 'sf_manufacturing'],
'data': [
'data/product_data.xml',
'views/product_template_view.xml'
'views/product_template_view.xml',
'views/product_workorder.xml'
],
'demo': [
],

View File

@@ -1,5 +1,6 @@
from. import product_template
from. import product_supplierinfo
from. import product_workorder

View File

@@ -0,0 +1,13 @@
from odoo import api, fields, models
class ResMrpWorkOrder(models.Model):
_inherit = 'mrp.workorder'
_order = 'sequence'
product_tmpl_id_length = fields.Float(related='production_id.product_tmpl_id.length', readonly=True, store=True, check_company=True, string="胚料长度(mm)")
product_tmpl_id_width = fields.Float(related='production_id.product_tmpl_id.width', readonly=True, store=True, check_company=True, string="胚料宽度(mm)")
product_tmpl_id_height = fields.Float(related='production_id.product_tmpl_id.height', readonly=True, store=True, check_company=True, string="胚料高度(mm)")
product_tmpl_id_materials_id = fields.Many2one(related='production_id.product_tmpl_id.materials_id', readonly=True, store=True, check_company=True, string="材料")
product_tmpl_id_materials_type_id = fields.Many2one(related='production_id.product_tmpl_id.materials_type_id', readonly=True, store=True, check_company=True, string="型号")

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_mrp_production_workorder_tray_form_inherit_sf1" model="ir.ui.view">
<field name="name">production.workorder.dlm</field>
<field name="model">mrp.workorder</field>
<field name="inherit_id" ref="sf_manufacturing.view_mrp_production_workorder_tray_form_inherit_sf"/>
<field name="arch" type="xml">
<xpath expr="//page[1]" position="before">
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
<group>
<group>
<field name="product_tmpl_id_materials_id" widget="many2one"/>
<field name="product_tmpl_id_materials_type_id" widget="many2one"/>
</group>
<group>
<field name="product_tmpl_id_length"/>
<field name="product_tmpl_id_width"/>
<field name="product_tmpl_id_height"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
</odoo>

View File

@@ -56,7 +56,7 @@
</field>
</record>
<record id="mrp_workcenter_kanban_action1" model="ir.actions.act_window">
<field name="name">工作中心概述</field>
<field name="name">工作中心看板</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workcenter</field>
<field name="view_mode">kanban,form</field>
@@ -76,7 +76,7 @@
</record>
<menuitem id="menu_mrp_dashboard"
name="工作中心概述"
name="工作中心看板"
action="mrp_workcenter_kanban_action1"
groups="mrp.group_mrp_routings"
parent="mrp.menu_mrp_root"

View File

@@ -7,7 +7,7 @@
<field name="arch" type="xml">
<field name="name" position="before">
<field name="sequence"/>
<field name='user_permissions'/>
<field name='user_permissions' invisible="1"/>
</field>
<field name="name" position="after">
<field name="processing_panel"/>
@@ -110,17 +110,26 @@
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>
</xpath>
<!-- 隐藏物料清单-->
<xpath expr="//page[@name='components']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<!-- 隐藏物料清单-->
<field name="production_id" position="after">
<group>
<field name="date_planned_start" invisible="1"/>
<field name="date_planned_finished" invisible="1"/>
<field name="duration" widget="mrp_timer"
attrs="{'invisible': [('production_state','=', 'draft')], 'readonly': [('is_user_working', '=', True)]}"
sum="real duration"/>
<field name="processing_panel" readonly="1"/>
</group>
<field name="processing_panel" readonly="1" attrs="{'invisible': [('routing_type', 'in', ('获取CNC加工程序','装夹','解除装夹',
'前置三元定位检测','后置三元质量检测','解除装夹'))]}"/>
</field>
<xpath expr="//page[1]" position="before">
<page string="获取CNC加工程序" attrs='{"invisible": [("routing_type","!=","获取CNC加工程序")]}'>
<group>
@@ -145,7 +154,6 @@
<page string="装夹托盘" attrs='{"invisible": [("routing_type","!=","装夹")]}'>
<group>
<field name="routing_type" invisible="1"/>
<field name="processing_panel" readonly="1"/>
<field name="tray_code"/>
<field name="tray_id" readonly="1"/>
@@ -159,12 +167,8 @@
</xpath>
<xpath expr="//page[1]" position="before">
<page string="三元前置检测定位参数" attrs='{"invisible": [("routing_type","!=","前置三元定位检测")]}'>
<group>
<group>
<field name="processing_panel" readonly="1"/>
</group>
</group>
<page string="前置三元检测定位参数" attrs='{"invisible": [("routing_type","!=","前置三元定位检测")]}'>
<div>左面:</div>
<div class="o_address_format">
<label for="X1_axis" string="x"/>