合并企业版代码(未测试,先提交到测试分支)

This commit is contained in:
qihao.gong@jikimo.com
2023-04-14 17:42:23 +08:00
parent 7a7b3d7126
commit d28525526a
1300 changed files with 513579 additions and 5426 deletions

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="mrp_routing_workcenter_tree_view_inherited" model="ir.ui.view">
<field name="name">mrp.routing.workcenter.tree.view.inherited</field>
<field name="model">mrp.routing.workcenter</field>
<field name="inherit_id" ref="mrp.mrp_routing_workcenter_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='company_id']" position="after">
<button name="action_mrp_workorder_show_steps" class="btn-link" type="object" string="Instructions">
<field name="quality_point_count"/>
</button>
</xpath>
</field>
</record>
<record id="mrp_bom_form_view_inherit" model="ir.ui.view">
<field name="name">mrp.bom.form.view</field>
<field name="model">mrp.bom</field>
<field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='message_follower_ids']" position="after">
<field name="activity_ids"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,19 @@
<odoo>
<record id="mrp_workorder_operation_form_view" model="ir.ui.view">
<field name="name">mrp_workorder.mrp_workorder.operation.form.view</field>
<field name="model">mrp.routing.workcenter</field>
<field name="inherit_id" ref="mrp.mrp_routing_workcenter_form_view"/>
<field name="arch" type="xml">
<xpath expr="//widget[@name='web_ribbon']" position="before">
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" name="action_mrp_workorder_show_steps" type="object" icon="fa-wrench" attrs="{'invisible': [('quality_point_count', '=', 0)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="quality_point_count"/></span>
<span class="o_stat_text">Instructions</span>
</div>
</button>
</div>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Manufacturing Order for Planing view -->
<record id="mrp_production_tree_view_planning" model="ir.ui.view">
<field name="name">mrp.production.tree.inherit.planning</field>
<field name="model">mrp.production</field>
<field name="arch" type="xml">
<tree default_order="date_planned_start asc" decoration-info="state=='confirmed'" decoration-danger="date_planned_start&lt;current_date and state not in ('done','cancel')" decoration-muted="state in ('done','cancel')" string="Manufacturing Orders" name="Production">
<field name="message_needaction" invisible="1"/>
<field name="name"/>
<field name="date_planned_start"/>
<field name="product_id"/>
<field name="product_qty" sum="Total Qty" string="Quantity"/>
<field name="product_uom_id" string="Unit of Measure" options="{'no_open':True,'no_create':True}" groups="uom.group_uom"/>
<field name="reservation_state" string="Availability"/>
<field name="origin"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="mrp_production_view_search_inherit_planning" model="ir.ui.view">
<field name="name">mrp.production.search.view.inherit.planning</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.view_mrp_production_filter"/>
<field name="arch" type="xml">
<filter name="filter_planned" position="attributes">
<attribute name="domain">[('is_planned', '=', True), ('date_planned_start', '!=', False), ('date_planned_finished', '!=', False)]</attribute>
</filter>
</field>
</record>
<record id="production_order_unplan_server_action" model="ir.actions.server">
<field name="name">Unplan orders</field>
<field name="model_id" ref="mrp.model_mrp_production"/>
<field name="binding_model_id" ref="mrp.model_mrp_production" />
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">records.button_unplan()</field>
</record>
<record id="mrp.act_product_mrp_production_workcenter" model="ir.actions.act_window">
<field name="domain">[('bom_id', '!=', False), ('bom_id.operation_ids.workcenter_id', '=', active_id), ('date_planned_start', '!=', False), ('date_planned_finished', '!=', False)]</field>
<field name="view_id" ref="mrp_production_tree_view_planning"/>
</record>
<menuitem id="mrp_workorder_menu_planning"
name="Work Orders"
sequence="2"
parent="mrp.mrp_planning_menu_root"
groups="mrp.group_mrp_routings"/>
<menuitem id="menu_mrp_workorder_production"
name="Planning by Production"
sequence="1"
action="mrp.action_mrp_workorder_production"
parent="mrp_workorder_menu_planning"/>
<menuitem id="menu_mrp_workorder_workcenter"
name="Planning by Workcenter"
sequence="2"
action="mrp_workorder.action_mrp_workorder_dependencies_workcenter"
parent="mrp_workorder_menu_planning"/>
</odoo>

View File

@@ -0,0 +1,37 @@
<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="Overview"
action="mrp.mrp_workcenter_kanban_action"
groups="mrp.group_mrp_routings"
parent="mrp.menu_mrp_root"
sequence="5"/>
</odoo>

View File

@@ -0,0 +1,286 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="mrp_workorder_view_form_inherit_workorder" model="ir.ui.view">
<field name="name">mrp.workorder.view.form.inherit.workorder</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="//header" position="replace">
<field name="check_ids" invisible="1"/>
<field name="quality_check_fail" invisible="1"/>
<header>
<field name="state" widget="statusbar" statusbar_visible="pending,waiting,ready,progress,done"/>
</header>
</xpath>
<page name='workorder_page_work_instruction' position="before">
<page string="Finished Steps" name="finished_steps" attrs="{'invisible': [('check_ids', '=', [])]}">
<field name="check_ids" domain="[('quality_state', '!=', 'none')]" readonly="1" context="{'form_view_ref': 'mrp_workorder.quality_check_workorder_form'}">
<tree>
<field name="quality_state" invisible="1"/>
<field name="test_type" invisible="1"/>
<field name="control_date" string="Date"/>
<field name="user_id" string="Operator"/>
<field name="finished_lot_id" string="Finished Lot/Serial Number" attrs="{'column_invisible': [('parent.product_tracking', '=', 'none')]}"/>
<field name="title"/>
<field name="result"/>
</tree>
</field>
</page>
</page>
</field>
</record>
<record id="mrp_production_workorder_tree_editable_view_inherit_workorder" model="ir.ui.view">
<field name="name">mrp.production.work.order.tree.editable.inherit.mrp.workorder</field>
<field name="model">mrp.workorder</field>
<field name="inherit_id" ref="mrp.mrp_production_workorder_tree_editable_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="after">
<field name="production_state" invisible="1"/>
</xpath>
<xpath expr="//button[@name='action_open_wizard']" position="after">
<button name="open_tablet_view" type="object" icon="fa-tablet" title="Open Tablet View" context="{'from_production_order': True}" attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'cancel', 'done')), ('state', '=', 'done')]}"/>
</xpath>
</field>
</record>
<record id="workcenter_line_graph_inherit_workorder" model="ir.ui.view">
<field name="name">mrp.production.work.order.graph.inherit.mrp.workorder</field>
<field name="model">mrp.workorder</field>
<field name="inherit_id" ref="mrp.workcenter_line_graph"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='duration_expected']" position="after">
<field name="worksheet_page" invisible="1"/>
</xpath>
</field>
</record>
<record id="workcenter_line_pivot_inherit_workorder" model="ir.ui.view">
<field name="name">mrp.production.work.order.pivot.inherit.mrp.workorder</field>
<field name="model">mrp.workorder</field>
<field name="inherit_id" ref="mrp.workcenter_line_graph"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='duration_expected']" position="after">
<field name="worksheet_page" invisible="1"/>
</xpath>
</field>
</record>
<record id="mrp_workorder_view_gantt_dependencies" model="ir.ui.view">
<field name="name">mrp.workorder.view.gantt.dependencies</field>
<field name="model">mrp.workorder</field>
<field name="inherit_id" ref="mrp.mrp_workorder_view_gantt"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//gantt" position="attributes">
<attribute name="dependency_field">blocked_by_workorder_ids</attribute>
<attribute name="dependency_inverted_field">needed_by_workorder_ids</attribute>
</xpath>
</field>
</record>
<record id="action_mrp_workorder_dependencies_workcenter" model="ir.actions.server">
<field name="name">Work Orders Planning</field>
<field name="model_id" ref="model_mrp_workorder"/>
<field name="state">code</field>
<field name="code">
action = env.ref('mrp.action_mrp_workorder_workcenter').sudo().read()[0]
if env.user.has_group('mrp.group_mrp_workorder_dependencies'):
action['views'] = [(env.ref('mrp_workorder.mrp_workorder_view_gantt_dependencies').id, 'gantt')] + [(id, kind) for id, kind in action['views'] if kind != 'gantt']
</field>
</record>
<!-- MRP.WORKORDER TABLET VIEW -->
<record id="mrp_workorder_view_form_tablet" model="ir.ui.view">
<field name="name">mrp.workorder.view.form.inherit.quality.tablet.new</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<form string="Production Workcenter" delete="0" create="0" class="o_workorder_tablet_form form_top">
<field name="allow_producing_quantity_change" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="is_last_lot" invisible="1"/>
<field name="is_last_unfinished_wo" invisible="1"/>
<field name="is_user_working" invisible="1"/>
<field name="state" invisible="1"/>
<field name="product_tracking" invisible="1"/>
<field name="working_state" invisible="1"/>
<field name="production_id" invisible="1"/>
<field name="current_quality_check_id" invisible="1"/>
<div class="o_workorder_bar">
<div class="o_workorder_bar_left o_workorder_bar_content">
<button name="action_back" type="object" class="btn btn-secondary o_exit fa fa-arrow-left o_unblock" title="back"/>
<div class="o_workorder_field">
<field name="production_id" options="{'no_open': True}" readonly="1"/> - <field name="name" readonly="1"/>
</div>
</div>
<div class="o_workorder_bar_center o_workorder_bar_content">
<div class="o_workorder_field">
<field name="product_id" context="{'display_default_code': False}" options="{'no_open': True}" readonly="1"/>
<label for="qty_producing" string=":"/>
<field name="qty_producing" class="oe_inline text-start" attrs="{'readonly': ['|', '|', ('allow_producing_quantity_change', '=', False), ('product_tracking', '=', 'serial'), ('state', 'in', ('done', 'cancel'))]}" required="1"/>
/ <field name="qty_remaining" class="oe_inline text-start" attrs="{'invisible': [('state', '=', 'done')]}"/> <field name="qty_production" class="oe_inline text-start" attrs="{'invisible': [('state', '!=', 'done')]}"/>
<label for="product_uom_id" string="" class="oe_inline"/>
<field name="product_uom_id" options="{'no_open': True}" class="oe_inline" readonly="1"/>
</div>
</div>
<div class="o_workorder_bar_right o_workorder_bar_content">
</div>
</div>
<div class="o_workorder_bar">
<div class="o_workorder_bar_left o_workorder_action o_workorder_bar_content">
<button name="openMenuPopup" t-att-disabled="isBlocked" class="btn btn-secondary o_workorder_icon_btn fa fa-bars" type="workorder_event" title="menu"/>
<span groups="mrp_workorder.group_mrp_wo_tablet_timer">
<button name="button_pending" type="object" class="btn btn-secondary" attrs="{'invisible': ['|', ('is_user_working', '=', False), ('working_state', '=', 'blocked')]}" barcode_trigger="pause" string="PAUSE"/>
<button name="button_start" type="object" class="btn btn-warning" attrs="{'invisible': ['|', '|', ('is_user_working', '=', True), ('working_state', '=', 'blocked'), ('state', '=', ('done', 'cancel'))]}" barcode_trigger="pause" string="CONTINUE"/>
<button name="button_unblock" type="object" class="btn btn-secondary btn-danger o_unblock" attrs="{'invisible': [('working_state', '!=', 'blocked')]}">Unblock</button>
<field name="duration" widget="mrp_timer" class="ms-1" readonly="1"/>
</span>
</div>
<div class="o_workorder_bar_center o_workorder_bar_content">
<div class="o_workorder_field o_workorder_lot">
<div attrs="{'invisible': [('product_tracking', '=', 'none')]}">
<label for="finished_lot_id" string="Lot" attrs="{'invisible': [('product_tracking', '!=', 'lot')]}"/>
<label for="finished_lot_id" string="Serial" attrs="{'invisible': [('product_tracking', '!=', 'serial')]}"/>
<field name="finished_lot_id" context="{'default_product_id': product_id, 'default_company_id': company_id}" domain="[('product_id', '=', product_id)]"/>
<button name="action_generate_serial" type="object" class="btn btn-secondary fa fa-plus-square-o" aria-label="Creates a new serial/lot number" title="Creates a new serial/lot number" role="img" attrs="{'invisible': [('finished_lot_id', '!=', False)]}"/>
</div>
</div>
</div>
<div class="o_workorder_bar_right o_workorder_bar_content">
<button name="do_finish" type="object" string="Mark as Done" icon="fa-check" attrs="{'invisible': ['|', ('current_quality_check_id', '!=', False), '&amp;', ('is_last_unfinished_wo', '=', False), ('is_last_lot', '=', False)]}" class="btn-primary" barcode_trigger="cloWO"/>
<button name="action_open_manufacturing_order" type="object" string="Mark as Done and Close MO" icon="fa-check" attrs="{'invisible': ['|', ('current_quality_check_id', '!=', False), ('is_last_unfinished_wo', '=', False)]}" class="btn-primary" barcode_trigger="cloMO"/>
<button name="record_production" type="object" string="Record production" attrs="{'invisible': ['|', '|', ('current_quality_check_id', '!=', False), ('is_last_unfinished_wo', '=', True), ('is_last_lot', '=', True)]}" barcode_trigger="record" class="btn-primary"/>
</div>
</div>
</form>
</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>
<!-- override to change the no content image -->
<record model="ir.actions.act_window" id="mrp.mrp_workorder_todo">
<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>
<!-- override to change the no content image -->
<record model="ir.actions.act_window" id="mrp.action_mrp_workorder_production_specific">
<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>
<!-- override to change the no content image -->
<record model="ir.actions.act_window" id="mrp.action_mrp_workorder_workcenter">
<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>
<!-- override to change the no content image -->
<record model="ir.actions.act_window" id="mrp.action_mrp_workorder_production">
<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="mrp_workorder_view_kanban_inherit_quality" model="ir.ui.view">
<field name="name">mrp.workorder.view.kanban.inherit.quality</field>
<field name="model">mrp.workorder</field>
<field name="inherit_id" ref="mrp.workcenter_line_kanban"/>
<field name="arch" type="xml">
<kanban position="attributes">
<attribute name="js_class">tablet_kanban_view</attribute>
</kanban>
</field>
</record>
<record id="view_routing_steps_search" model="ir.ui.view">
<field name="name">view.routing.steps.search</field>
<field name="model">quality.point</field>
<field name="arch" type="xml">
<search string="Quality Point Steps">
<field name="active" invisible="1"/>
<filter name="archived" string="Archived" domain="[('active', '=', False)]"/>
</search>
</field>
</record>
<record id="action_mrp_workorder_show_steps" model="ir.actions.act_window">
<field name="name">Steps</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">quality.point</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree'}),
(0, 0, {'view_mode': 'kanban'}),
(0, 0, {'view_mode': 'form', 'view_id': ref('step_view_form')})]"/>
<field name="search_view_id" ref="view_routing_steps_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_steps">
No manufacturing steps defined yet!
</p><p>
Use steps to show instructions on a worksheet to operators, or trigger quality checks at specific steps of the work order.
</p>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,227 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="quality_point_view_form_inherit_mrp" model="ir.ui.view">
<field name="name">quality.point.view.form.inherit.mrp</field>
<field name="model">quality.point</field>
<field name="inherit_id" ref="quality.quality_point_view_form"/>
<field name="arch" type="xml">
<field name="test_type_id" position="after">
<field name="component_ids" invisible="1"/>
<field name="bom_product_ids" invisible="1"/>
<field name="component_id" attrs="{'required': [('test_type', 'in', ('register_byproducts', 'register_consumed_materials'))], 'invisible': ['|', '|', ('is_workorder_step', '=', False), ('operation_id', '=', False), ('test_type', 'not in', ('register_byproducts', 'register_consumed_materials'))]}" domain="[('id', 'in', component_ids), '|', ('company_id', '=', company_id), ('company_id', '=', False)]"/>
<field name="test_report_type" widget="selection" attrs="{'invisible': [('test_type','!=','print_label')]}"/>
</field>
<field name="picking_type_ids" position="after">
<field string="Work Order Operation" name="operation_id" attrs="{'invisible': [('is_workorder_step', '=', False)]}" groups="mrp.group_mrp_routings" options="{'no_create': True}"/>
<field name="is_workorder_step" invisible="1"/>
</field>
<field name="user_id" position="after">
<field name="operation_id" invisible="1"/>
<field name="source_document" widget="radio"/>
<field name="worksheet_page" attrs="{'invisible': ['|', '|', ('is_workorder_step', '=', False), ('operation_id', '=', False), ('source_document', '=', 'step')]}"/>
</field>
<field name="product_category_ids" position="attributes">
<attribute name="attrs">{
'invisible': [
('is_workorder_step', '=', True),
('operation_id', '!=', False)
]}
</attribute>
</field>
<xpath expr="//field[@name='note']" position="after">
<field name="worksheet_document" help="Upload your PDF file." widget="pdf_viewer" attrs="{'invisible': [('source_document', '=', 'operation')]}"/>
<field name="worksheet_url" placeholder="Google Slide Link" widget="embed_viewer"/>
</xpath>
</field>
</record>
<record id="step_view_form" model="ir.ui.view">
<field name="name">quality.point.view.form.inherit.mrp</field>
<field name="model">quality.point</field>
<field name="inherit_id" ref="mrp_workorder.quality_point_view_form_inherit_mrp"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<field name="picking_type_ids" position="replace">
<field name="picking_type_ids" widget="many2many_tags" domain="[('code', '=', 'mrp_operation'), ('company_id', '=', company_id)]"/>
</field>
</field>
</record>
<record id="quality_check_view_form_tablet" model="ir.ui.view">
<field name="name">quality.check.view.form.tablet</field>
<field name="model">quality.check</field>
<field name="priority">200</field>
<field name="arch" type="xml">
<form class="o_workorder_tablet_form">
<field name="test_type" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="component_tracking" invisible="1"/>
<field name="is_user_working" invisible="1"/>
<field name="quality_state" invisible="1"/>
<field name="test_type" invisible="1"/>
<field name="working_state" invisible="1"/>
<field name="consumption" invisible="1"/>
<field name="component_qty_to_do" invisible="1"/>
<field name="additional" invisible="1"/>
<field name="production_id" invisible="1"/>
<div class="o_workorder_bar">
<div class="o_workorder_bar_left">
<div class="o_workorder_bar_content" attrs="{'invisible': [('test_type', 'not in', ('register_byproducts', 'register_consumed_materials'))]}">
<div>
<field name="component_id" options="{'no_open': True}" readonly="1"/>
</div>
</div>
<div class="o_workorder_bar_content" attrs="{'invisible': [('test_type', 'not in', ('register_byproducts', 'register_consumed_materials'))]}">
<label for="qty_done" string="Quantity"/>
<field name="qty_done" attrs="{'readonly': [('component_tracking', '=', 'serial')]}" string="Quantity" class="oe_inline"/>
<div attrs="{'invisible': [('additional', '=', True)]}">
/ <field name="component_remaining_qty" readonly="1"/>
</div>
<label for="component_uom_id" string=" "/>
<field name="component_uom_id" options="{'no_open': True}" readonly="1"/>
<div class="o_workorder_lot">
<div class="o_form_label ps-5" attrs="{'invisible': [('component_tracking', '!=', 'serial')]}">Serial</div>
<div class="o_form_label ps-5" attrs="{'invisible': [('component_tracking', '!=', 'lot')]}">Lot</div>
<field name="lot_id" class="text-center" context="{'default_product_id': component_id, 'default_company_id': company_id, 'active_mo_id': test_type == 'register_consumed_materials' and production_id or False}" attrs="{'invisible': [('component_tracking', '=', 'none')]}" domain="[('product_id', '=', component_id), '|', ('company_id', '=', False), ('company_id', '=', company_id)]"/>
</div>
</div>
<div class="o_workorder_bar_content">
<field name="note" readonly="1"/>
</div>
<div class="o_workorder_bar_content">
<field name="additional_note" readonly="1"/>
</div>
<div class="o_workorder_bar_content">
<div class="workorder_picture" attrs="{'invisible': [('test_type', '!=', 'picture')]}">
<field name="picture" widget="image"/>
</div>
</div>
</div>
<div class="o_workorder_bar_center">
</div>
<div class="o_workorder_bar_right o_workorder_bar_content o_workorder_action" attrs="{'invisible': [('working_state', '=', 'blocked')]}">
<button
name="action_next"
type="object"
class="btn-primary"
attrs="{'invisible': ['|', ('is_user_working', '=', False), '&amp;', '|', ('quality_state', '=', 'none'), ('test_type', '!=', 'passfail'), ('test_type', '!=', 'instructions')]}"
barcode_trigger="next"
string="Next"/>
<button
name="action_next"
type="object"
class="btn-secondary"
attrs="{'invisible': ['|', '|', '|', ('is_user_working', '=', False), ('test_type', 'not in', ['register_consumed_materials', 'register_byproducts', 'picture']), ('consumption', '=', 'strict'), '&amp;', ('consumption', 'in', ['flexible', 'warning']), ('component_qty_to_do', '&gt;=', 0)]}"
barcode_trigger="next"
string="VALIDATE"
/>
<button
name="action_next"
type="object"
class="btn-primary"
attrs="{'invisible': ['|', '|', ('is_user_working', '=', False), ('test_type', 'not in', ['register_consumed_materials', 'register_byproducts', 'picture']), ('component_qty_to_do', '&lt;', 0)]}"
barcode_trigger="next"
string="VALIDATE"
/>
<button name="action_continue"
type="object"
class="btn-primary"
attrs="{'invisible': ['|', '|', ('is_user_working', '=', False), ('test_type', 'not in', ('register_consumed_materials', 'register_byproducts')), ('component_qty_to_do', '&gt;=', 0)]}"
barcode_trigger="continue"
string="CONTINUE PRODUCTION"
/>
<button name="action_continue"
type="object"
class="btn-secondary"
attrs="{'invisible': ['|', '|', '|', ('is_user_working', '=', False), ('test_type', 'not in', ('register_consumed_materials', 'register_byproducts')), ('consumption', '=', 'strict'), '&amp;', ('consumption', 'in', ['flexible', 'warning']), ('component_qty_to_do', '&lt;', 0)]}"
barcode_trigger="continue"
string="CONTINUE PRODUCTION"
/>
<button name="action_print" type="object" class="btn-primary" attrs="{'invisible': [('test_type', '!=', 'print_label')]}" barcode_trigger="print" string="Print Labels"/>
</div>
</div>
</form>
</field>
</record>
<record id="quality_check_workorder_form" model="ir.ui.view">
<field name="name">quality.check.workorder.form</field>
<field name="model">quality.check</field>
<field name="priority">100</field>
<field name="arch" type="xml">
<form>
<group>
<field name="product_id" force_save="1"/>
<field name="test_type" force_save="1"/>
<field name="team_id" invisible="1" force_save="1"/>
<field name="workorder_id" invisible="1" force_save="1"/>
<field name="company_id" invisible="1"/>
<field string="Type" name="test_type_id" options="{'no_open': True, 'no_create': True}"/>
<field name="point_id"/>
<field name="product_id" attrs="{'invisible': [('test_type', 'not in', ('register_consumed_materials', 'register_byproducts'))]}"/>
<field name="lot_id" attrs="{'invisible': [('test_type', 'not in', ('register_consumed_materials', 'register_byproducts'))]}"/>
<field name="qty_done" attrs="{'invisible': [('test_type', 'not in', ('register_consumed_materials', 'register_byproducts'))]}"/>
</group>
<group>
<field name="note"/>
<field name="worksheet_document"/>
</group>
</form>
</field>
</record>
<record id="add_quality_check_from_tablet" model="ir.ui.view">
<field name="name">add.quality.check.from.tablet</field>
<field name="model">quality.check</field>
<field name="priority">200</field>
<field name="arch" type="xml">
<form>
<group>
<field name="company_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="workorder_id" invisible="1"/>
<field name="title" string="Title"/>
<field name="note" string="Instruction"/>
<field name="worksheet_document" string="Document"/>
</group>
<footer>
<button class="btn btn-primary" type="object" name="add_check_in_chain" string="Propose Change"/>
<button class="btn btn-secondary" type="object" special="cancel" string="Discard"/>
</footer>
</form>
</field>
</record>
<record id="quality_alert_view_tree" model="ir.ui.view">
<field name="name">quality.alert.view.tree.inherit.mrp.workorder</field>
<field name="model">quality.alert</field>
<field name="inherit_id" ref="quality.quality_alert_view_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='lot_id']" position="after">
<field name="workcenter_id" optional="show"/>
</xpath>
</field>
</record>
<record id="quality_point_view_tree" model="ir.ui.view">
<field name="name">quality.point.view.tree.inherit.mrp.workorder</field>
<field name="model">quality.point</field>
<field name="inherit_id" ref="quality.quality_point_view_tree"/>
<field name="arch" type="xml">
<field name="picking_type_ids" position="after">
<field name="operation_id" optional="hide" string="Work Order Operation"/>
</field>
</field>
</record>
<record id="quality_alert_view_search_inherit_mrp_workorder" model="ir.ui.view">
<field name="name">quality.alert.view.search.inherit.mrp.workorder</field>
<field name="model">quality.alert</field>
<field name="inherit_id" ref="quality.quality_alert_view_search"/>
<field name="arch" type="xml">
<field name="tag_ids" position="before">
<field name="workcenter_id" string="Work Center"/>
</field>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.mrp.workorder</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="mrp.res_config_settings_view_form"/>
<field name="arch" type="xml">
<div id="workorder_settings_workcenters" position="before">
<div id="workorder_settings_barcode_commands" class="mt8">
<a href="/mrp_workorder/static/src/pdf/barcodes_actions_Manufacturing.pdf" class="oe_link" target="_blank">
<i class="fa fa-print"/> Print barcode commands
</a>
</div>
</div>
<div id="quality_control_mrp" position="before">
<div class="col-lg-6 col-12 o_setting_box" attrs="{'invisible': [('group_mrp_routings', '=', False)]}" id="mrp_wo_tablet_view_timer">
<div class="o_setting_left_pane">
<field name="group_mrp_wo_tablet_timer"/>
</div>
<div class="o_setting_right_pane">
<label for="group_mrp_wo_tablet_timer"/>
<div class="text-muted">
Show the timer on the work order screen
</div>
</div>
</div>
</div>
</field>
</record>
</odoo>