Initial commit: Mrp packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:50 +02:00
commit 50d736b3bd
739 changed files with 538193 additions and 0 deletions

View file

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Files -->
<record model="ir.ui.view" id="view_document_file_kanban_mrp">
<field name="name">mrp.document kanban.mrp</field>
<field name="model">mrp.document</field>
<field name="arch" type="xml">
<kanban js_class="mrp_documents_kanban" class="o_mrp_documents_kanban_view" create="false">
<field name="ir_attachment_id"/>
<field name="mimetype"/>
<field name="type"/>
<field name="name"/>
<field name="priority"/>
<field name="create_uid"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_area o_kanban_attachment oe_kanban_global_click">
<div class="o_kanban_image">
<t t-set="binaryPreviewable"
t-value="new RegExp('(image|video|application/pdf|text)').test(record.mimetype.value) &amp;&amp; record.type.raw_value === 'binary'"/>
<div t-attf-class="o_kanban_image_wrapper #{(webimage or binaryPreviewable) ? 'o_kanban_previewer' : ''}">
<t t-set="webimage" t-value="new RegExp('image.*(gif|jpeg|jpg|png)').test(record.mimetype.value)"/>
<div t-if="record.type.raw_value == 'url'" class="o_url_image fa fa-link fa-3x text-muted" aria-label="Image is a link"/>
<img t-elif="webimage" t-attf-src="/web/image/#{record.ir_attachment_id.raw_value}" width="100" height="100" alt="Document" class="o_attachment_image"/>
<div t-else="" class="o_image o_image_thumbnail" t-att-data-mimetype="record.mimetype.value"/>
</div>
</div>
<div class="o_kanban_details">
<div class="o_kanban_details_wrapper">
<div class="o_kanban_record_title">
<field name="name" class="o_text_overflow"/>
</div>
<div class="o_kanban_record_body">
<field name="url" widget="url" attrs="{'invisible':[('type','=','binary')]}"/>
</div>
<div class="o_kanban_record_bottom">
<span class="oe_kanban_bottom_left">
<field name="priority" widget="priority"/>
</span>
<div class="oe_kanban_bottom_right">
<field name="create_uid" widget="many2one_avatar_user"/>
</div>
</div>
<div class="o_dropdown_kanban dropdown" tabindex="-1">
<a class="dropdown-toggle o-no-caret btn" data-bs-toggle="dropdown" href="#" role="button" aria-label="Dropdown menu" title="Dropdown menu">
<span class="fa fa-ellipsis-v"/>
</a>
<div class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<a t-if="widget.editable" type="edit" class="dropdown-item">Edit</a>
<a t-if="widget.deletable" type="delete" class="dropdown-item">Delete</a>
<a class="dropdown-item o_mrp_download">Download</a>
</div>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_mrp_document_form" model="ir.ui.view">
<field name="name">mrp.document.form</field>
<field name="model">mrp.document</field>
<field name="arch" type="xml">
<form string="Attachments">
<sheet>
<label for="name"/>
<h1>
<field name="name"/>
</h1>
<group>
<group>
<field name="type"/>
<field name="datas" filename="name" attrs="{'invisible':[('type','=','url')]}"/>
<field name="url" widget="url" attrs="{'invisible':[('type','=','binary')]}"/>
</group>
<group string="Attached To" groups="base.group_no_one">
<field name="res_name"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
</group>
<group string="History" groups="base.group_no_one" attrs="{'invisible':[('create_date','=',False)]}">
<label for="create_uid" string="Creation"/>
<div name="creation_div">
<field name="create_uid" readonly="1" class="oe_inline"/> on
<field name="create_date" readonly="1" class="oe_inline"/>
</div>
</group>
</group>
</sheet>
</form>
</field>
</record>
</odoo>

View file

@ -0,0 +1,290 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Bill of Materials -->
<record id="action_report_mrp_bom" model="ir.actions.client">
<field name="name">BoM Overview</field>
<field name="tag">mrp_bom_report</field>
<field name="context" eval="{'model': 'report.mrp.report_bom_structure'}" />
</record>
<record id="mrp_bom_byproduct_form_view" model="ir.ui.view">
<field name="name">mrp.bom.byproduct.form</field>
<field name="model">mrp.bom.byproduct</field>
<field name="arch" type="xml">
<form string="Byproduct">
<group>
<field name="allowed_operation_ids" invisible="1"/>
<field name="company_id"/>
<field name="product_id"/>
<field name="product_uom_category_id" invisible="1"/>
<label for="product_qty"/>
<div class="o_row">
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom"/>
</div>
<field name="operation_id" groups="mrp.group_mrp_routings" options="{'no_quick_create':True,'no_create_edit':True}"/>
<field name="possible_bom_product_template_attribute_value_ids" invisible="1"/>
<field name="bom_product_template_attribute_value_ids" widget="many2many_tags" options="{'no_create': True}" groups="product.group_product_variant"/>
</group>
</form>
</field>
</record>
<record id="mrp_bom_form_view" model="ir.ui.view">
<field name="name">mrp.bom.form</field>
<field name="model">mrp.bom</field>
<field name="priority">100</field>
<field name="arch" type="xml">
<form string="Bill of Material">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="%(action_mrp_routing_time)d" type="action" class="oe_stat_button" icon="fa-clock-o" groups="mrp.group_mrp_routings">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Operations<br/>Performance</span>
</div>
</button>
<button name="%(action_report_mrp_bom)d" type="action"
class="oe_stat_button" icon="fa-bars" string="Overview"/>
</div>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<group>
<group>
<field name="active" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="product_tmpl_id" context="{'default_detailed_type': 'product'}"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="allow_operation_dependencies" invisible="1"/>
<field name="product_id" groups="product.group_product_variant" context="{'default_detailed_type': 'product'}"/>
<field name="product_id" groups="!product.group_product_variant" invisible="1"/>
<label for="product_qty" string="Quantity"/>
<div class="o_row">
<field name="product_qty"/>
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="uom.group_uom"/>
</div>
</group>
<group>
<field name="code"/>
<field name="type" widget="radio"/>
<p colspan="2" class="oe_grey oe_edit_only" attrs="{'invisible': [('type','!=','phantom')]}">
<ul>
A BoM of type kit is used to split the product into its components.
<li>
At the creation of a Manufacturing Order.
</li>
<li>
At the creation of a Stock Transfer.
</li>
</ul>
</p>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True, 'no_open': True}"/>
</group>
</group>
<notebook>
<page string="Components" name="components">
<field name="bom_line_ids" widget="one2many" context="{'default_parent_product_tmpl_id': product_tmpl_id, 'default_product_id': False, 'default_bom_id': id}">
<tree string="Components" editable="bottom">
<field name="company_id" invisible="1"/>
<field name="sequence" widget="handle"/>
<field name="product_id" context="{'default_detailed_type': 'product'}"/>
<field name="product_tmpl_id" invisible="1"/>
<button name="action_see_attachments" type="object" icon="fa-files-o" aria-label="Product Attachments" title="Product Attachments" class="float-end"/>
<field name="attachments_count" class="text-start" string=" "/>
<field name="product_qty"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="parent_product_tmpl_id" invisible="1" />
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="uom.group_uom"/>
<field name="possible_bom_product_template_attribute_value_ids" invisible="1"/>
<field name="bom_product_template_attribute_value_ids" optional="hide" widget="many2many_tags" options="{'no_create': True}" attrs="{'column_invisible': [('parent.product_id', '!=', False)]}" groups="product.group_product_variant"/>
<field name="allowed_operation_ids" invisible="1"/>
<field name="operation_id" groups="mrp.group_mrp_routings" optional="hidden" attrs="{'column_invisible': [('parent.type','not in', ('normal', 'phantom'))]}" options="{'no_quick_create':True,'no_create_edit':True}"/>
<field name="manual_consumption_readonly" invisible="1"/>
<field name="manual_consumption" optional="hide" width="1.0" attrs="{'readonly': [('manual_consumption_readonly', '=', True)]}" force_save="1"/>
</tree>
</field>
</page>
<page string="Operations"
name="operations"
attrs="{'invisible': [('type', 'not in',('normal','phantom'))]}"
groups="mrp.group_mrp_routings">
<field name="operation_ids"
attrs="{'invisible': [('type','not in',('normal','phantom'))]}"
groups="mrp.group_mrp_routings"
context="{'bom_id_invisible': True, 'default_bom_id': id, 'tree_view_ref': 'mrp.mrp_routing_workcenter_bom_tree_view'}"/>
</page>
<page string="By-products"
name="by_products"
attrs="{'invisible': [('type','!=','normal')]}"
groups="mrp.group_mrp_byproducts">
<field name="byproduct_ids" context="{'form_view_ref' : 'mrp.mrp_bom_byproduct_form_view', 'default_bom_id': id}">
<tree string="By-products" editable="top">
<field name="company_id" invisible="1"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="sequence" widget="handle"/>
<field name="product_id" context="{'default_detailed_type': 'product'}"/>
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom"/>
<field name="cost_share" optional="hide"/>
<field name="allowed_operation_ids" invisible="1"/>
<field name="operation_id" groups="mrp.group_mrp_routings" options="{'no_quick_create':True,'no_create_edit':True}"/>
<field name="possible_bom_product_template_attribute_value_ids" invisible="1"/>
<field name="bom_product_template_attribute_value_ids" optional="hide" widget="many2many_tags" options="{'no_create': True}" attrs="{'column_invisible': [('parent.product_id', '!=', False)]}" groups="product.group_product_variant"/>
</tree>
</field>
</page>
<page string="Miscellaneous" name="miscellaneous">
<group>
<group>
<field name="ready_to_produce" attrs="{'invisible': [('type','=','phantom')]}" string="Manufacturing Readiness" widget="radio" groups="mrp.group_mrp_routings"/>
<field name="consumption" attrs="{'invisible': [('type','=','phantom')]}" widget="radio"/>
<field name="allow_operation_dependencies" groups="mrp.group_mrp_workorder_dependencies"/>
</group>
<group>
<field name="picking_type_id" attrs="{'invisible': [('type','=','phantom')]}" string="Operation" groups="stock.group_adv_location"/>
</group>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="message_ids" colspan="4" nolabel="1"/>
</div>
</form>
</field>
</record>
<record id="mrp_bom_tree_view" model="ir.ui.view">
<field name="name">mrp.bom.tree</field>
<field name="model">mrp.bom</field>
<field name="arch" type="xml">
<tree string="Bill of Materials" sample="1" default_order="sequence, id">
<field name="active" invisible="1"/>
<field name="sequence" widget="handle"/>
<field name="product_tmpl_id"/>
<field name="code" optional="show"/>
<field name="type"/>
<field name="product_id" groups="product.group_product_variant" optional="hide"/>
<field name="company_id" groups="base.group_multi_company" optional="show"/>
<field name="product_qty" optional="hide"/>
<field name="product_uom_id" groups="uom.group_uom" optional="hide" string="Unit of Measure"/>
</tree>
</field>
</record>
<record id="mrp_bom_kanban_view" model="ir.ui.view">
<field name="name">mrp.bom.kanban</field>
<field name="model">mrp.bom</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1">
<field name="product_tmpl_id"/>
<field name="product_qty"/>
<field name="product_uom_id"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings mt4">
<strong class="o_kanban_record_title"><span class="mt4"><field name="product_tmpl_id"/></span></strong>
</div>
<span class="float-end badge rounded-pill"><t t-esc="record.product_qty.value"/> <small><t t-esc="record.product_uom_id.value"/></small></span>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_mrp_bom_filter" model="ir.ui.view">
<field name="name">mrp.bom.select</field>
<field name="model">mrp.bom</field>
<field name="arch" type="xml">
<search string="Search Bill Of Material">
<field name="code" string="Bill of Materials" filter_domain="['|', ('code', 'ilike', self), ('product_tmpl_id', 'ilike', self)]"/>
<field name="product_tmpl_id" string="Product"/>
<field name="bom_line_ids" string="Component"/>
<filter string="Manufacturing" name="normal" domain="[('type', '=', 'normal')]"/>
<filter string="Kit" name="phantom" domain="[('type', '=', 'phantom')]"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<group expand="0" string="Group By...">
<filter string="Product" name="product" domain="[]" context="{'group_by': 'product_tmpl_id'}"/>
<filter string='BoM Type' name="group_by_type" domain="[]" context="{'group_by' : 'type'}"/>
<filter string='Unit of Measure' name="default_unit_of_measure" domain="[]" context="{'group_by' : 'product_uom_id'}"/>
</group>
</search>
</field>
</record>
<record id="mrp_bom_form_action" model="ir.actions.act_window">
<field name="name">Bills of Materials</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.bom</field>
<field name="domain">[]</field> <!-- force empty -->
<field name="view_mode">tree,kanban,form</field>
<field name="search_view_id" ref="view_mrp_bom_filter"/>
<field name="context">{'default_company_id': allowed_company_ids[0]}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No bill of materials found. Let's create one!
</p><p>
Bills of materials allow you to define the list of required raw
materials used to make a finished product; through a manufacturing
order or a pack of products.
</p>
</field>
</record>
<menuitem id="menu_mrp_bom_form_action"
action="mrp_bom_form_action"
parent="menu_mrp_bom"
sequence="13"/>
<!-- BOM Line -->
<record id="mrp_bom_line_view_form" model="ir.ui.view">
<field name="name">mrp.bom.line.view.form</field>
<field name="model">mrp.bom.line</field>
<field name="arch" type="xml">
<form string="Bill of Material line" create="0" edit="0">
<sheet>
<group>
<group string="Component">
<field name="product_id"/>
<field name="parent_product_tmpl_id" invisible="1"/>
<label for="product_qty" string="Quantity"/>
<div class="o_row">
<field name="product_qty"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="uom.group_uom"/>
</div>
<field name="possible_bom_product_template_attribute_value_ids" invisible="1"/>
<field name="bom_product_template_attribute_value_ids" widget="many2many_tags" options="{'no_create': True}" groups="product.group_product_variant"/>
</group>
<group string="Operation">
<field name="company_id" invisible="1"/>
<field name="sequence" groups="base.group_no_one"/>
<field name="allowed_operation_ids" invisible="1"/>
<field name="operation_id" groups="mrp.group_mrp_routings"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="template_open_bom" model="ir.actions.act_window">
<field name="context">{'default_product_tmpl_id': active_id}</field>
<field name="name">Bill of Materials</field>
<field name="res_model">mrp.bom</field>
<field name="domain">['|', ('product_tmpl_id', '=', active_id), ('byproduct_ids.product_id.product_tmpl_id', '=', active_id)]</field>
</record>
<record id="product_open_bom" model="ir.actions.act_window">
<field name="context">{'default_product_id': active_id}</field>
<field name="name">Bill of Materials</field>
<field name="res_model">mrp.bom</field>
<field name="domain">[]</field> <!-- Force empty -->
</record>
</data>
</odoo>

View file

@ -0,0 +1,667 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Manufacturing Order -->
<record id="mrp_production_tree_view" model="ir.ui.view">
<field name="name">mrp.production.tree</field>
<field name="model">mrp.production</field>
<field name="arch" type="xml">
<tree string="Manufacturing Orders" multi_edit="1" sample="1" decoration-info="state == 'draft'">
<header>
<button name="button_plan" type="object" string="Plan"/>
<button name="do_unreserve" type="object" string="Unreserve"/>
<button name="action_cancel" type="object" string="Cancel"/>
</header>
<field name="company_id" invisible="1"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="priority" optional="show" widget="priority" nolabel="1"/>
<field name="message_needaction" invisible="1"/>
<field name="name" decoration-bf="1"/>
<field name="date_planned_start" optional="show" widget="remaining_days"/>
<field name="date_deadline" widget="remaining_days" attrs="{'invisible': [('state', 'in', ['done', 'cancel'])]}" optional="hide"/>
<field name="product_id" readonly="1" optional="show"/>
<field name="lot_producing_id" optional="hide"/>
<field name="bom_id" readonly="1" optional="hide"/>
<field name="activity_ids" string="Next Activity" widget="list_activity" optional="show"/>
<field name="origin" optional="show"/>
<field name="user_id" optional="hide" widget="many2one_avatar_user"/>
<field name="components_availability_state" invisible="1" options='{"lazy": true}'/>
<field name="components_availability" options='{"lazy": true}'
attrs="{'invisible': [('state', 'not in', ['confirmed', 'progress'])]}"
optional="show"
decoration-success="reservation_state == 'assigned' or components_availability_state == 'available'"
decoration-warning="reservation_state != 'assigned' and components_availability_state in ('expected', 'available')"
decoration-danger="reservation_state != 'assigned' and components_availability_state == 'late'"/>
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'" decoration-success="reservation_state == 'assigned'"/>
<field name="product_qty" sum="Total Qty" string="Quantity" readonly="1" optional="show"/>
<field name="product_uom_id" string="UoM" readonly="1" options="{'no_open':True,'no_create':True}" groups="uom.group_uom" optional="show"/>
<field name="production_duration_expected" attrs="{'invisible': [('production_duration_expected', '=', 0)]}" groups="mrp.group_mrp_routings" widget="float_time" sum="Total expected duration" optional="show"/>
<field name="production_real_duration" attrs="{'invisible': [('production_real_duration', '=', 0)]}" groups="mrp.group_mrp_routings" widget="float_time" sum="Total real duration" optional="show"/>
<field name="company_id" readonly="1" groups="base.group_multi_company" optional="show"/>
<field name="state"
decoration-success="state in ('done', 'to_close')"
decoration-warning="state == 'progress'"
decoration-info="state == 'confirmed'"
decoration-danger="state == 'cancel'"
decoration-muted="state == 'draft'"
optional="show" widget="badge" class="text-dark"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
<field name="delay_alert_date" invisible="1"/>
<field nolabel="1" name="json_popover" widget="stock_rescheduling_popover" attrs="{'invisible': [('json_popover', '=', False)]}"/>
</tree>
</field>
</record>
<record id="action_production_order_split" model="ir.actions.server">
<field name="name">Split</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,form</field>
<field name="state">code</field>
<field name="code">action = records.action_split()</field>
</record>
<record id="action_production_order_merge" model="ir.actions.server">
<field name="name">Merge</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">action = records.action_merge()</field>
</record>
<record id="action_production_order_mark_done" model="ir.actions.server">
<field name="name">Mark as Done</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">
if records:
res = records.filtered(lambda mo: mo.state in {'confirmed', 'to_close', 'progress'}).button_mark_done()
if res is not True:
action = res
</field>
</record>
<record id="mrp_production_form_view" model="ir.ui.view">
<field name="name">mrp.production.form</field>
<field name="model">mrp.production</field>
<field name="arch" type="xml">
<form string="Manufacturing Orders">
<header>
<field name="confirm_cancel" invisible="1"/>
<field name="show_lock" invisible="1"/>
<button name="button_mark_done" attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '!=', [])]}" string="Validate" type="object" class="oe_highlight"
confirm="There are no components to consume. Are you still sure you want to continue?" data-hotkey="g"/>
<button name="button_mark_done" attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '=', [])]}" string="Validate" type="object" class="oe_highlight" data-hotkey="g"/>
<button name="button_mark_done" attrs="{'invisible': [
'|',
('move_raw_ids', '=', []),
'&amp;',
'|',
('state', 'not in', ('confirmed', 'progress')),
('qty_producing', '!=', 0),
('state', '!=', 'to_close')]}" string="Mark as Done" type="object" class="oe_highlight" data-hotkey="g"/>
<button name="button_mark_done" attrs="{'invisible': [
'|',
('move_raw_ids', '!=', []),
'&amp;',
'|',
('state', 'not in', ('confirmed', 'progress')),
('qty_producing', '!=', 0),
('state', '!=', 'to_close')]}" string="Mark as Done" type="object" class="oe_highlight" data-hotkey="g"
confirm="There are no components to consume. Are you still sure you want to continue?"/>
<button name="action_confirm" attrs="{'invisible': [('state', '!=', 'draft')]}" string="Confirm" type="object" class="oe_highlight" data-hotkey="v"/>
<button name="button_plan" attrs="{'invisible': ['|', '|', ('state', 'not in', ('confirmed', 'progress', 'to_close')), ('workorder_ids', '=', []), ('is_planned', '=', True)]}" type="object" string="Plan" class="oe_highlight" data-hotkey="x"/>
<button name="button_unplan" type="object" string="Unplan" attrs="{'invisible': ['|', ('is_planned', '=', False), ('state', '=', 'cancel')]}" data-hotkey="x"/>
<button name="action_assign" attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done', 'cancel')), ('reserve_visible', '=', False)]}" string="Check availability" type="object" data-hotkey="q"/>
<button name="do_unreserve" type="object" string="Unreserve" attrs="{'invisible': [('unreserve_visible', '=', False)]}" data-hotkey="w"/>
<button name="button_scrap" type="object" string="Scrap" attrs="{'invisible': [('state', 'in', ('cancel', 'draft'))]}" data-hotkey="y"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,progress,done"/>
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}" string="Unlock" groups="mrp.group_mrp_manager" type="object" help="Unlock the manufacturing order to adjust what has been consumed or produced." data-hotkey="l"/>
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}" string="Lock" groups="mrp.group_mrp_manager" type="object" help="Lock the manufacturing order to prevent changes to what has been consumed or produced." data-hotkey="l"/>
<field name="show_serial_mass_produce" invisible="1"/>
<button name="action_serial_mass_produce_wizard" attrs="{'invisible': [('show_serial_mass_produce', '=', False)]}" string="Mass Produce" type="object"/>
<button name="action_cancel" type="object" string="Cancel" data-hotkey="z"
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', True)]}"/>
<button name="action_cancel" type="object" string="Cancel" data-hotkey="z"
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', False)]}"
confirm="Some product moves have already been confirmed, this manufacturing order can't be completely cancelled. Are you still sure you want to process ?"/>
<button name="button_unbuild" type="object" string="Unbuild" attrs="{'invisible': [('state', '!=', 'done')]}" data-hotkey="shift+v"/>
</header>
<sheet>
<field name="reservation_state" invisible="1"/>
<field name="date_planned_finished" invisible="1"/>
<field name="is_locked" invisible="1"/>
<field name="qty_produced" invisible="1"/>
<field name="unreserve_visible" invisible="1"/>
<field name="reserve_visible" invisible="1"/>
<field name="consumption" invisible="1"/>
<field name="is_planned" invisible="1"/>
<field name="show_allocation" invisible="1"/>
<field name="workorder_ids" invisible="1"/>
<div class="oe_button_box" name="button_box">
<button name="action_view_reception_report" string="Allocation" type="object"
class="oe_stat_button" icon="fa-list"
attrs="{'invisible': [('show_allocation', '=', False)]}"
groups="mrp.group_mrp_reception_report"/>
<button class="oe_stat_button" name="action_view_mrp_production_childs" type="object" icon="fa-wrench" attrs="{'invisible': [('mrp_production_child_count', '=', 0)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="mrp_production_child_count"/></span>
<span class="o_stat_text">Child MO</span>
</div>
</button>
<button class="oe_stat_button" name="action_view_mrp_production_sources" type="object" icon="fa-wrench" attrs="{'invisible': [('mrp_production_source_count', '=', 0)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="mrp_production_source_count"/></span>
<span class="o_stat_text">Source MO</span>
</div>
</button>
<button class="oe_stat_button" name="action_view_mrp_production_backorders" type="object" icon="fa-wrench" attrs="{'invisible': [('mrp_production_backorder_count', '&lt;', 2)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="mrp_production_backorder_count"/></span>
<span class="o_stat_text">Backorders</span>
</div>
</button>
<button class="oe_stat_button" name="action_view_mrp_production_unbuilds" type="object" icon="fa-undo" attrs="{'invisible': [('unbuild_count', '=', 0)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="unbuild_count"/></span>
<span class="o_stat_text">Unbuilds</span>
</div>
</button>
<button class="oe_stat_button" name="action_see_move_scrap" type="object" icon="fa-arrows-v" attrs="{'invisible': [('scrap_count', '=', 0)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="scrap_count"/></span>
<span class="o_stat_text">Scraps</span>
</div>
</button>
<button type="object" name="action_view_mo_delivery" class="oe_stat_button" icon="fa-truck" groups="base.group_user" attrs="{'invisible': [('delivery_count', '=', 0)]}">
<field name="delivery_count" widget="statinfo" string="Transfers"/>
</button>
<button name="%(stock.action_stock_report)d" icon="fa-arrow-up" class="oe_stat_button" string="Traceability" type="action" states="done" groups="stock.group_production_lot"/>
<button name="%(action_mrp_production_moves)d" type="action" string="Product Moves" class="oe_stat_button" icon="fa-exchange" attrs="{'invisible': [('state', 'not in', ('progress', 'done'))]}"/>
</div>
<div class="oe_title">
<h1 class="d-flex">
<field name="priority" widget="priority" class="me-3"/>
<field name="name" placeholder="Manufacturing Reference" nolabel="1"/>
</h1>
</div>
<group>
<group>
<field name="id" invisible="1"/>
<field name="use_create_components_lots" invisible="1"/>
<field name="show_lot_ids" invisible="1"/>
<field name="product_tracking" invisible="1"/>
<field name="product_id" context="{'default_detailed_type': 'product'}" attrs="{'readonly': [('state', '!=', 'draft')]}" default_focus="1"/>
<field name="product_tmpl_id" invisible="1"/>
<field name="forecasted_issue" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="product_description_variants" attrs="{'invisible': [('product_description_variants', 'in', (False, ''))], 'readonly': [('state', '!=', 'draft')]}"/>
<label for="bom_id" name="bom_label"/>
<div class='o_row' name="bom_div">
<field name="bom_id"
context="{'default_product_tmpl_id': product_tmpl_id}" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
</div>
<label for="product_qty" string="Quantity"/>
<div class="d-flex flex-row align-items-start">
<field name="qty_producing" class="w-auto" attrs="{'readonly': ['|', ('state', '=', 'cancel'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)], 'invisible': [('state', '=', 'draft')]}"/>
<span attrs="{'invisible': [('state', '=', 'draft')]}">/</span>
<field name="product_qty" class="oe_inline text-start" attrs="{'readonly': [('state', '!=', 'draft')], 'invisible': [('state', 'not in', ('draft', 'done'))]}"/>
<button type="action" name="%(mrp.action_change_production_qty)d"
context="{'default_mo_id': id}" class="oe_link oe_inline py-0" style="margin: 0px; padding: 0px;" attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done','cancel')), ('id', '=', False)]}">
<field name="product_qty" class="oe_inline" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
</button>
<label for="product_uom_id" string="" class="oe_inline flex-grow-1"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="product_uom_id" groups="!uom.group_uom" invisible="1"/>
<field name="product_uom_id" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<span class='fw-bold text-nowrap'>To Produce</span>
<button type="object" name="action_product_forecast_report" title="Forecast Report" icon="fa-area-chart" attrs="{'invisible': [('forecasted_issue', '=', True)]}" class="py-0" />
<button type="object" name="action_product_forecast_report" title="Forecast Report" icon="fa-area-chart" attrs="{'invisible': [('forecasted_issue', '=', False)]}" class="text-danger py-0"/>
</div>
<label for="lot_producing_id" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('product_tracking', 'in', ('none', False))]}"/>
<div class="o_row" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('product_tracking', 'in', ('none', False))]}">
<field name="lot_producing_id"
context="{'default_product_id': product_id, 'default_company_id': company_id}" attrs="{'invisible': [('product_tracking', 'in', ('none', False))]}"/>
<button name="action_generate_serial" type="object" class="btn btn-primary fa fa-plus-square-o" aria-label="Creates a new serial/lot number" title="Creates a new serial/lot number" role="img" attrs="{'invisible': ['|', ('product_tracking', 'in', ('none', False)), ('lot_producing_id', '!=', False)]}"/>
</div>
</group>
<group name="group_extra_info">
<label for="date_planned_start"/>
<div class="o_row">
<field name="date_planned_start"
attrs="{'readonly': [('state', 'in', ['done', 'cancel'])]}"
decoration-warning="state not in ('done', 'cancel') and date_planned_start &lt; now"
decoration-danger="state not in ('done', 'cancel') and date_planned_start &lt; current_date"
decoration-bf="state not in ('done', 'cancel') and (date_planned_start &lt; current_date or date_planned_start &lt; now)"/>
<field name="delay_alert_date" invisible="1"/>
<field nolabel="1" name="json_popover" widget="stock_rescheduling_popover" attrs="{'invisible': [('json_popover', '=', False)]}"/>
</div>
<field name="components_availability_state" invisible="1"/>
<field name="components_availability" attrs="{'invisible': [('state', 'not in', ['confirmed', 'progress'])]}"
decoration-success="reservation_state == 'assigned' or components_availability_state == 'available'"
decoration-warning="reservation_state != 'assigned' and components_availability_state in ('expected', 'available')"
decoration-danger="reservation_state != 'assigned' and components_availability_state == 'late'"/>
<field name="user_id"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" attrs="{'readonly': [('state', '!=', 'draft')]}" force_save="1"/>
<field name="show_final_lots" invisible="1"/>
<field name="production_location_id" invisible="1" readonly="1"/>
<field name="move_finished_ids" invisible="1" attrs="{'readonly': ['|', ('state', '=', 'cancel'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}">
<tree editable="bottom">
<field name="product_id"/>
<field name="product_uom_qty"/>
<field name="product_uom"/>
<field name="operation_id"/>
<field name="byproduct_id"/>
<field name="name"/>
<field name="date_deadline"/>
<field name="picking_type_id"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="company_id"/>
<field name="warehouse_id"/>
<field name="origin"/>
<field name="group_id"/>
<field name="propagate_cancel"/>
<field name="move_dest_ids"/>
<field name="state"/>
<!-- Useless as the editable in tree declaration -> For Form Test-->
<field name="product_uom_category_id"/>
<field name="allowed_operation_ids"/>
<!--
Required for test_00_mrp_byproduct
when changing the mrp.production product_qty
`_onchange_producing` is called,
calling `_set_qty_producing`,
which changes the `quantity_done` of byproducts
If byproducts are not in the view (`groups="mrp.group_mrp_byproducts"`)
and `quantity_done` is not within the finished move views,
(byproduct moves are a subset of finished moves)
the `quantity_done` of byproducts is not updated correctly with the onchange
Another solution is to add `self.env.user.groups_id += self.env.ref('mrp.group_mrp_byproducts')`
to the test `test_00_mrp_byproduct`, which could makes sense as it's a test testing the byproducts features,
for which you should have the byproducts group to have access to,
but it seemed better to keep the feature working even if you do not see the byproducts features with your user.
That being said, the best would be to have the byproducts feature working without relying on anything in the view,
e.g. so the byproducts feature works with xmlrpc calls.
-->
<field name="quantity_done"/>
<!-- Required for test_fifo_byproduct -->
<field name="cost_share"/>
</tree>
</field>
</group>
</group>
<notebook>
<page string="Components" name="components">
<field name="move_raw_ids"
widget="mrp_production_components_x2many"
context="{'default_date': date_planned_start, 'default_date_deadline': date_planned_start, 'default_location_id': location_src_id, 'default_location_dest_id': production_location_id,
'default_warehouse_id': warehouse_id, 'default_state': 'draft', 'default_raw_material_production_id': id, 'default_picking_type_id': picking_type_id, 'default_company_id': company_id}"
attrs="{'readonly': ['|', ('state', '=', 'cancel'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" options="{'delete': [('state', '=', 'draft')]}">
<tree default_order="is_done, manual_consumption desc, sequence" editable="bottom">
<field name="product_id" force_save="1" required="1" context="{'default_detailed_type': 'product'}" attrs="{'readonly': ['|', '|', ('move_lines_count', '&gt;', 0), ('state', '=', 'cancel'), '&amp;', ('state', '!=', 'draft'), ('additional', '=', False) ]}"/>
<field name="location_id" string="From" readonly="1" force_save="1" groups="stock.group_stock_multi_locations" optional="show"/>
<!-- test_immediate_validate_uom_2, test_product_produce_different_uom -->
<field name="product_uom" invisible="1"/>
<field name="propagate_cancel" invisible="1"/>
<field name="price_unit" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="name" invisible="1"/>
<field name="allowed_operation_ids" invisible="1"/>
<field name="unit_factor" invisible="1"/>
<field name="date_deadline" invisible="1" force_save="1"/>
<field name="date" invisible="1"/>
<field name="additional" invisible="1"/>
<field name="picking_type_id" invisible="1"/>
<field name="has_tracking" invisible="1"/>
<field name="operation_id" invisible="1"/>
<field name="is_done" invisible="1"/>
<field name="bom_line_id" invisible="1"/>
<field name="sequence" invisible="1"/>
<field name="warehouse_id" invisible="1"/>
<field name="is_locked" invisible="1"/>
<field name="move_lines_count" invisible="1"/>
<field name="location_dest_id" domain="[('id', 'child_of', parent.location_dest_id)]" invisible="1"/>
<field name="state" invisible="1" force_save="1"/>
<field name="should_consume_qty" invisible="1"/>
<field name="product_uom_qty" widget="mrp_should_consume" force_save="1" string="To Consume" attrs="{'readonly': ['&amp;', ('parent.state', '!=', 'draft'), '|', '&amp;', ('parent.state', 'not in', ('confirmed', 'progress', 'to_close')), ('parent.is_planned', '!=', True), '&amp;', ('state', '!=', 'draft'), ('parent.is_locked', '=', True)]}" width="1"/>
<field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('id', '!=', False)]}" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom"/>
<field name="product_type" invisible="1"/>
<field name="product_qty" invisible="1" readonly="1"/>
<field name="reserved_availability" invisible="1"/>
<field name="forecast_expected_date" invisible="1"/>
<!-- Button are used in state draft to doesn't have the name of the column "Reserved"-->
<button type="object" name="action_product_forecast_report" title="Forecast Report" icon="fa-area-chart" attrs="{'column_invisible': [('parent.state', '!=', 'draft')], 'invisible': [('forecast_availability', '&lt;', 0)]}"/>
<button type="object" name="action_product_forecast_report" title="Forecast Report" icon="fa-area-chart text-danger" attrs="{'column_invisible': [('parent.state', '!=', 'draft')], 'invisible': [('forecast_availability', '&gt;=', 0)]}"/>
<field name="forecast_availability" string="Reserved" attrs="{'column_invisible': [('parent.state', 'in', ('draft', 'done'))]}" widget="forecast_widget"/>
<field name="quantity_done" string="Consumed"
decoration-success="not is_done and (quantity_done - should_consume_qty == 0)"
decoration-warning="not is_done and (quantity_done - should_consume_qty &gt; 0.0001)"
attrs="{'column_invisible': [('parent.state', '=', 'draft')], 'readonly': [('has_tracking', '!=','none')]}"
force_save="1" widget="mrp_consumed"/>
<field name="manual_consumption" invisible="1" force_save="1"/>
<field name="show_details_visible" invisible="1"/>
<field name="lot_ids" widget="many2many_tags"
optional="hide"
readonly="1"
string="Lot/Serial Numbers"
help="Displays the consumed Lot/Serial Numbers."
groups="stock.group_production_lot"
attrs="{'invisible': ['|', ('show_details_visible', '=', False), ('parent.state', '=', 'draft')],
'column_invisible': [('parent.show_lot_ids', '=', False)]}"
options="{'create': [('parent.use_create_components_lots', '!=', False)]}"
context="{'default_company_id': company_id, 'default_product_id': product_id}"
domain="[('product_id','=',product_id)]"
/>
<field name="group_id" invisible="1"/>
<button name="action_show_details" type="object" title="Show Details" icon="fa-list" context="{'default_product_uom_qty': 0}" attrs="{'invisible': ['|', ('show_details_visible', '=', False), ('has_tracking', '=','none')]}"/>
<button class="o_optional_button btn btn-light" name="action_show_details" type="object" title="Show Details" icon="fa-list" context="{'default_product_uom_qty': 0}" attrs="{'invisible': ['|', ('has_tracking', '!=','none'), ('show_details_visible', '=', False)]}"/>
</tree>
</field>
</page>
<page string="Work Orders" name="operations" groups="mrp.group_mrp_routings">
<field name="workorder_ids" attrs="{'readonly': ['|', ('state', '=', 'cancel'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'tree_view_ref': 'mrp.mrp_production_workorder_tree_editable_view', 'default_product_uom_id': product_uom_id, 'from_manufacturing_order': True}"/>
</page>
<page string="By-Products" name="finished_products" groups="mrp.group_mrp_byproducts">
<field name="move_byproduct_ids" context="{'default_date': date_planned_finished, 'default_warehouse_id': warehouse_id, 'default_date_deadline': date_deadline, 'default_location_id': production_location_id, 'default_location_dest_id': location_dest_id, 'default_state': 'draft', 'default_production_id': id, 'default_picking_type_id': picking_type_id, 'default_company_id': company_id}" attrs="{'readonly': ['|', ('state', '=', 'cancel'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" options="{'delete': [('state', '=', 'draft')]}">
<tree default_order="is_done,sequence" decoration-muted="is_done" editable="bottom">
<field name="product_id" context="{'default_detailed_type': 'product'}" domain="[('id', '!=', parent.product_id)]" required="1" force_save="1" attrs="{'readonly': ['|', '|', ('move_lines_count', '&gt;', 0), ('state', '=', 'cancel'), '&amp;', ('state', '!=', 'draft'), ('additional', '=', False) ]}"/>
<field name="location_dest_id" string="To" readonly="1" force_save="1" groups="stock.group_stock_multi_locations"/>
<field name="company_id" invisible="1"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="name" invisible="1"/>
<field name="allowed_operation_ids" invisible="1"/>
<field name="unit_factor" invisible="1"/>
<field name="date" invisible="1"/>
<field name="date_deadline" invisible="1" force_save="1"/>
<field name="additional" invisible="1"/>
<field name="picking_type_id" invisible="1"/>
<field name="has_tracking" invisible="1"/>
<field name="operation_id" invisible="1"/>
<field name="is_done" invisible="1"/>
<field name="bom_line_id" invisible="1"/>
<field name="sequence" invisible="1"/>
<field name="location_id" invisible="1"/>
<field name="warehouse_id" invisible="1"/>
<field name="is_locked" invisible="1"/>
<field name="move_lines_count" invisible="1"/>
<field name="state" invisible="1" force_save="1"/>
<field name="product_uom_qty" string="To Produce" force_save="1" attrs="{'readonly': ['&amp;', ('parent.state', '!=', 'draft'), '|', '&amp;', ('parent.state', 'not in', ('confirmed', 'progress', 'to_close')), ('parent.is_planned', '!=', True), ('parent.is_locked', '=', True)]}"/>
<field name="quantity_done" string="Produced" attrs="{'column_invisible': [('parent.state', '=', 'draft')], 'readonly': [('has_tracking', '=', True)]}"/>
<field name="product_uom" groups="uom.group_uom"/>
<field name="cost_share" optional="hide"/>
<field name="show_details_visible" invisible="1"/>
<field name="lot_ids" widget="many2many_tags"
groups="stock.group_production_lot"
attrs="{'invisible': ['|', '|', ('show_details_visible', '=', False), ('has_tracking', '!=', 'serial'), ('parent.state', '=', 'draft')]}"
options="{'create': [('parent.use_create_components_lots', '!=', False)]}"
context="{'default_company_id': company_id, 'default_product_id': product_id}"
domain="[('product_id','=',product_id)]"
/>
<button name="action_show_details" type="object" title="Show Details" icon="fa-list" attrs="{'invisible': ['|', ('has_tracking', '=','none'), ('show_details_visible', '=', False)]}"/>
<button class="o_optional_button btn btn-light" name="action_show_details" type="object" title="Show Details" icon="fa-list" attrs="{'invisible': ['|', ('has_tracking', '!=','none'), ('show_details_visible', '=', False)]}"/>
</tree>
</field>
</page>
<page string="Miscellaneous" name="miscellaneous">
<group>
<group>
<field name="picking_type_id" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="location_src_id" groups="stock.group_stock_multi_locations" options="{'no_create': True}" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="location_src_id" groups="!stock.group_stock_multi_locations" invisible="1"/>
<field name="warehouse_id" invisible="1"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations" options="{'no_create': True}" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="location_dest_id" groups="!stock.group_stock_multi_locations" invisible="1"/>
</group>
<group>
<field name="origin"/>
<field name="date_deadline"
attrs="{'invisible': ['|', ('state', 'in', ('done', 'cancel')), ('date_deadline', '=', False)]}"
decoration-danger="date_deadline and date_deadline &lt; current_date"
decoration-bf="date_deadline and date_deadline &lt; current_date"/>
</group>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<record id="mrp_production_kanban_view" model="ir.ui.view">
<field name="name">mrp.production.kanban</field>
<field name="model">mrp.production</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1">
<field name="name"/>
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom_id" options="{'no_open':True,'no_create':True}"/>
<field name="date_planned_start"/>
<field name="state"/>
<field name="activity_state"/>
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_record_top">
<field name="priority" widget="priority"/>
<div class="o_kanban_record_headings mt4 ms-1">
<strong class="o_kanban_record_title"><span><t t-esc="record.product_id.value"/></span></strong>
</div>
<span class="float-end text-end"><t t-esc="record.product_qty.value"/> <small><t t-esc="record.product_uom_id.value"/></small></span>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left text-muted">
<span><t t-esc="record.name.value"/> <t t-esc="record.date_planned_start.value and record.date_planned_start.value.split(' ')[0] or False"/></span>
<field name="activity_ids" widget="kanban_activity"/>
<field name="delay_alert_date" invisible="1"/>
<field nolabel="1" name="json_popover" widget="stock_rescheduling_popover" attrs="{'invisible': [('json_popover', '=', False)]}"/>
</div>
<div class="oe_kanban_bottom_right">
<span t-attf-class="badge #{['cancel'].indexOf(record.state.raw_value) > -1 ? 'bg-danger' : ['draft'].indexOf(record.state.raw_value) > -1 ? 'bg-200' : ['progress'].indexOf(record.state.raw_value) > -1 ? 'bg-warning text-dark' : ['done', 'to_close'].indexOf(record.state.raw_value) > -1 ? 'bg-success' : 'bg-primary'}"><t t-esc="record.state.value"/></span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_production_calendar" model="ir.ui.view">
<field name="name">mrp.production.calendar</field>
<field name="model">mrp.production</field>
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<calendar date_start="date_planned_start" date_stop="date_planned_finished"
string="Manufacturing Orders" event_limit="5" quick_add="False">
<field name="user_id" avatar_field="avatar_128"/>
<field name="product_id"/>
<field name="product_qty"/>
</calendar>
</field>
</record>
<record id="view_production_pivot" model="ir.ui.view">
<field name="name">mrp.production.pivot</field>
<field name="model">mrp.production</field>
<field name="arch" type="xml">
<pivot string="Manufacturing Orders" sample="1">
<field name="date_planned_start" type="row"/>
</pivot>
</field>
</record>
<record id="view_production_graph" model="ir.ui.view">
<field name="name">mrp.production.graph</field>
<field name="model">mrp.production</field>
<field name="arch" type="xml">
<graph string="Manufacturing Orders" stacked="0" sample="1">
<field name="date_planned_finished"/>
<field name="product_uom_qty" type="measure"/>
<field name="backorder_sequence" invisible="1"/>
<field name="qty_producing" string="Quantity Produced"/>
<field name="product_uom_qty" string= "Product Quantity"/>
</graph>
</field>
</record>
<record id="view_mrp_production_filter" model="ir.ui.view">
<field name="name">mrp.production.select</field>
<field name="model">mrp.production</field>
<field name="arch" type="xml">
<search string="Search Production">
<field name="name" string="Manufacturing Order" filter_domain="['|', ('name', 'ilike', self), ('origin', 'ilike', self)]"/>
<field name="product_id"/>
<field name="product_variant_attributes"/>
<field name="move_raw_ids" string="Component" filter_domain="[('move_raw_ids.product_id', 'ilike', self)]"/>
<field name="name" string="Work Center" filter_domain="[('bom_id.operation_ids.workcenter_id', 'ilike', self)]"/>
<field name="origin"/>
<filter string="To Do" name="todo" domain="[('state', 'in', ('draft', 'confirmed', 'progress', 'to_close'))]"
help="Manufacturing Orders which are in confirmed state."/>
<filter string="Starred" name="starred" domain="[('priority', '=', '1')]"/>
<filter string="Unbuilt" name="filter_unbuilt" domain="[('unbuild_ids.state', '=', 'done')]"/>
<separator/>
<filter string="Draft" name="filter_draft" domain="[('state', '=', 'draft')]"/>
<filter string="Confirmed" name="filter_confirmed" domain="[('state', '=', 'confirmed')]"/>
<filter string="Planned" name="filter_planned" domain="[('is_planned', '=', True)]" groups="mrp.group_mrp_routings"/>
<filter string="In Progress" name="filter_in_progress" domain="[('state', '=', 'progress')]"/>
<filter string="To Close" name="filter_to_close" domain="[('state', '=', 'to_close')]"/>
<filter string="Done" name="filter_done" domain="[('state', '=', 'done')]"/>
<filter string="Cancelled" name="filter_cancel" domain="[('state', '=', 'cancel')]"/>
<separator/>
<filter string="Waiting" name="waiting" domain="[('reservation_state', 'in', ('waiting', 'confirmed'))]"/>
<filter string="Ready" name="filter_ready" domain="[('reservation_state', '=', 'assigned')]"/>
<separator/>
<filter string="Planning Issues" name="planning_issues" help="Late MO or Late delivery of components"
domain="['|', ('delay_alert_date', '!=', False), '&amp;', ('date_deadline', '&lt;', current_date), ('state', '=', 'confirmed')]"/>
<separator/>
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
<filter name="filter_date_planned_start" string="Scheduled Date" date="date_planned_start"/>
<filter name="filter_plan_date" invisible="1" string="Scheduled Date: Last 365 Days" domain="[('date_planned_start', '>', (datetime.datetime.now() + relativedelta(days=-365)).to_utc().strftime('%Y-%m-%d %H:%M:%S'))]"/>
<separator/>
<filter string="Warnings" name="activities_exception"
domain="[('activity_exception_decoration', '!=', False)]"/>
<group expand="0" string="Group By...">
<filter string="Product" name="product" domain="[]" context="{'group_by': 'product_id'}"/>
<filter string="Status" name="status" domain="[]" context="{'group_by': 'state'}"/>
<filter string="Material Availability" name="groupby_reservation_state" domain="[]" context="{'group_by': 'reservation_state'}"/>
<filter string="Procurement Group" name="procurement_group_id" domain="[]" context="{'group_by': 'procurement_group_id'}"/>
<filter string="Scheduled Date" name="scheduled_date" domain="[]" context="{'group_by': 'date_planned_start'}" help="Scheduled Date by Month"/>
</group>
</search>
</field>
</record>
<record id="mrp_production_action" model="ir.actions.act_window">
<field name="name">Manufacturing Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_mrp_production_filter"/>
<field name="context">{'search_default_todo': True, 'default_company_id': allowed_company_ids[0]}</field>
<field name="domain">[('picking_type_id.active', '=', True)]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No manufacturing order found. Let's create one.
</p><p>
Consume <a name="%(product.product_template_action)d" type='action' tabindex="-1">components</a> and build finished products using <a name="%(mrp_bom_form_action)d" type='action' tabindex="-1">bills of materials</a>
</p>
</field>
</record>
<record id="mrp_production_action_picking_deshboard" model="ir.actions.act_window">
<field name="name">Manufacturing Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_mrp_production_filter"/>
<field name="domain">[('picking_type_id', '=', active_id)]</field>
<field name="context">{'default_picking_type_id': active_id}</field>
</record>
<record id="mrp_production_action_unreserve_tree" model="ir.actions.server">
<field name="name">Unreserve</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">
if records:
records.do_unreserve()
</field>
</record>
<menuitem action="mrp_production_action"
id="menu_mrp_production_action"
parent="menu_mrp_manufacturing"
sequence="1"/>
<record id="mrp_production_report" model="ir.actions.act_window">
<field name="name">Manufacturing Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production</field>
<field name="view_mode">graph,pivot,form</field>
<field name="target">current</field>
<field name="context">{
'search_default_product': 1,
'search_default_scheduled_date': 2,
'search_default_filter_confirmed': True,
'search_default_filter_planned': True,
'default_company_id': allowed_company_ids[0],
'allowed_company_ids': allowed_company_ids
}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No data yet!
</p><p>
Create a new manufacturing order
</p>
</field>
</record>
<menuitem id="menu_mrp_workorder_todo"
name="Work Orders"
action="mrp_workorder_todo"
parent="menu_mrp_manufacturing"
groups="group_mrp_routings"/>
<menuitem id="menu_mrp_production_report"
name="Manufacturing Orders"
parent="menu_mrp_reporting"
action="mrp_production_report"
sequence="11"/>
<menuitem id="menu_mrp_work_order_report"
name="Work Orders"
parent="menu_mrp_reporting"
action="mrp_workorder_report"
groups="group_mrp_routings"
sequence="10"/>
<record id="action_mrp_production_form" model="ir.actions.act_window">
<field name="name">Manufacturing Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.production</field>
<field name="view_mode">form</field>
</record>
</data>
</odoo>

View file

@ -0,0 +1,174 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Routings Workcenter -->
<record id="mrp_routing_workcenter_tree_view" model="ir.ui.view">
<field name="name">mrp.routing.workcenter.tree</field>
<field name="model">mrp.routing.workcenter</field>
<field name="arch" type="xml">
<tree string="Routing Work Centers" multi_edit="1">
<field name="company_id" invisible="1"/>
<field name="name"/>
<field name="bom_id"/>
<field name="workcenter_id"/>
<field name="time_mode" optional="show"/>
<field name="time_computed_on" optional="hide"/>
<field name="time_cycle" widget="float_time" string="Duration (minutes)" width="1.5"/>
<field name="company_id" optional="hide" groups="base.group_multi_company"/>
<field name="possible_bom_product_template_attribute_value_ids" invisible="1"/>
<field name="bom_product_template_attribute_value_ids" optional="hide" widget="many2many_tags" options="{'no_create': True}" groups="product.group_product_variant"/>
<field name="blocked_by_operation_ids" widget="many2many_tags" optional="hide" groups="mrp.group_mrp_workorder_dependencies"/>
</tree>
</field>
</record>
<record id="mrp_routing_workcenter_bom_tree_view" model="ir.ui.view">
<field name="name">mrp.routing.workcenter.bom.tree</field>
<field name="model">mrp.routing.workcenter</field>
<field name="inherit_id" ref="mrp_routing_workcenter_tree_view"/>
<field name="priority">1000</field>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="delete">0</attribute>
</xpath>
<xpath expr="//tree" position="inside">
<control>
<create string="Add a line"/>
<button name="copy_existing_operations" class="btn-link" type="object" string="Copy Existing Operations" context="{'bom_id': parent.id}"/>
</control>
</xpath>
<xpath expr="//field[@name='name']" position="before">
<field name="sequence" widget="handle"/>
</xpath>
<xpath expr="//field[@name='bom_id']" position="replace"/>
<xpath expr="//field[@name='time_cycle']" position="attributes">
<attribute name="sum">Total Duration</attribute>
</xpath>
<xpath expr="//field[@name='bom_product_template_attribute_value_ids']" position="attributes">
<attribute name="attrs">{'column_invisible': [('parent.product_id', '!=', False)]}</attribute>
</xpath>
<xpath expr="//field[@name='bom_product_template_attribute_value_ids']" position="after">
<button name="action_archive" class="oe_right" type="object" string="Archive Operation"/>
</xpath>
<xpath expr="//field[@name='blocked_by_operation_ids']" position="replace">
</xpath>
<xpath expr="//field[@name='name']" position="after">
<field name="bom_id" invisible="1"/>
<field name="blocked_by_operation_ids" widget="many2many_tags" optional="hide" attrs="{'column_invisible': [('parent.allow_operation_dependencies', '=', False)]}"/>
</xpath>
</field>
</record>
<record id="mrp_routing_workcenter_copy_to_bom_tree_view" model="ir.ui.view">
<field name="name">mrp.routing.workcenter.copy_to_bom.tree</field>
<field name="model">mrp.routing.workcenter</field>
<field name="inherit_id" ref="mrp_routing_workcenter_tree_view"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="create">0</attribute>
<attribute name="delete">0</attribute>
<attribute name="export_xlsx">0</attribute>
<attribute name="multi_edit">0</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="before">
<header>
<button name="copy_to_bom" type="object" string="Copy selected operations"/>
</header>
</xpath>
</field>
</record>
<record id="mrp_routing_workcenter_form_view" model="ir.ui.view">
<field name="name">mrp.routing.workcenter.form</field>
<field name="model">mrp.routing.workcenter</field>
<field name="arch" type="xml">
<form string="Routing Work Centers">
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<group>
<group name="description">
<field name="active" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="name"/>
<field name="bom_id" invisible="context.get('bom_id_invisible', False)" domain="[]" readonly="context.get('default_bom_id', False)"/>
<field name="workcenter_id" context="{'default_company_id': company_id}"/>
<field name="possible_bom_product_template_attribute_value_ids" invisible="1"/>
<field name="bom_product_template_attribute_value_ids" widget="many2many_tags" options="{'no_create': True}" groups="product.group_product_variant"/>
<field name="allow_operation_dependencies" invisible="1"/>
<field name="blocked_by_operation_ids" widget="many2many_tags" context="{'default_bom_id':bom_id}" attrs="{'invisible': [('allow_operation_dependencies', '=', False)]}"/>
</group><group name="workorder">
<field name="workorder_count" invisible="1"/>
<field name="time_mode" widget="radio"/>
<label for="time_mode_batch" attrs="{'invisible': [('time_mode', '=', 'manual')]}"/>
<div attrs="{'invisible': [('time_mode', '=', 'manual')]}">
last
<field name="time_mode_batch" class="oe_inline"/>
work orders
</div>
<label for="time_cycle_manual" attrs="{'invisible': [('time_mode', '=', 'auto'), ('workorder_count', '!=' , 0)]}" string="Default Duration"/>
<div attrs="{'invisible': [('time_mode', '=', 'auto'), ('workorder_count', '!=' , 0)]}">
<field name="time_cycle_manual" widget="float_time" class="oe_inline"/> minutes
</div>
<field name="time_cycle" invisible="1"/>
<field name="company_id" groups="base.group_multi_company" />
</group>
</group>
<notebook>
<page string="Work Sheet" name="worksheet">
<group>
<field name="worksheet_type" widget="radio"/>
<field name="worksheet" help="Upload your PDF file." widget="pdf_viewer" attrs="{'invisible': [('worksheet_type', '!=', 'pdf')], 'required': [('worksheet_type', '=', 'pdf')]}"/>
<field name="worksheet_google_slide" placeholder="Google Slide Link" widget="embed_viewer" attrs="{'invisible': [('worksheet_type', '!=', 'google_slide')], 'required': [('worksheet_type', '=', 'google_slide')]}"/>
<field name="note" attrs="{'invisible': [('worksheet_type', '!=', 'text')]}"/>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="mrp_routing_action" model="ir.actions.act_window">
<field name="name">Operations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.routing.workcenter</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="mrp_routing_workcenter_tree_view"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new operation
</p><p>
Operation define that need to be done to realize a Work Order.
Each operation is done at a specific Work Center and has a specific duration.
</p>
</field>
<field name="domain">['|', ('bom_id', '=', False), ('bom_id.active', '=', True)]</field>
</record>
<record id="mrp_routing_workcenter_filter" model="ir.ui.view">
<field name="name">mrp.routing.workcenter.filter</field>
<field name="model">mrp.routing.workcenter</field>
<field name="arch" type="xml">
<search string="Operations Search Filters">
<field name="name"/>
<field name="bom_id"/>
<field name="workcenter_id"/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<group>
<filter string="Bill of Material" name="bom" context="{'group_by': 'bom_id'}"/>
<filter string="Workcenter" name="workcenter" context="{'group_by': 'workcenter_id'}"/>
</group>
</search>
</field>
</record>
<menuitem id="menu_mrp_routing_action"
action="mrp_routing_action"
parent="menu_mrp_configuration"
groups="group_mrp_routings"
sequence="100"/>
</data>
</odoo>

View file

@ -0,0 +1,213 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Unbuild and scrap menu -->
<record id="action_mrp_unbuild_moves" model="ir.actions.act_window">
<field name="name">Stock Moves</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.move.line</field>
<field name="view_mode">tree,form</field>
<field name="domain">['|', ('move_id.unbuild_id', '=', active_id), ('move_id.consume_unbuild_id', '=', active_id)]</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
There's no product move yet
</p><p>
This menu gives you the full traceability of inventory operations on a specific product.
You can filter on the product to see all the past movements for the product.
</p>
</field>
</record>
<record id="mrp_unbuild_search_view" model="ir.ui.view">
<field name="name">mrp.unbuild.search</field>
<field name="model">mrp.unbuild</field>
<field name="arch" type="xml">
<search string="Search">
<field name="product_id"/>
<field name="mo_id"/>
<group expand="0" string="Filters">
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]"/>
<filter name="done" string="Done" domain="[('state', '=', 'done')]"/>
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
</group>
<group expand='0' string='Group by...'>
<filter string='Product' name="productgroup" context="{'group_by': 'product_id'}"/>
<filter string="Manufacturing Order" name="mogroup" context="{'group_by': 'mo_id'}"/>
</group>
</search>
</field>
</record>
<record id="mrp_unbuild_kanban_view" model="ir.ui.view">
<field name="name">mrp.unbuild.kanban</field>
<field name="model">mrp.unbuild</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1">
<field name="name"/>
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom_id"/>
<field name="state"/>
<field name="location_id"/>
<field name="activity_state"/>
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings mt4">
<strong class="o_kanban_record_title"><span><field name="name"/></span></strong>
</div>
<strong><t t-esc="record.product_qty.value"/> <small><t t-esc="record.product_uom_id.value"/></small></strong>
</div>
<div class="row">
<div class="col-8 text-muted">
<span><t t-esc="record.product_id.value"/></span>
</div>
<div class="col-4">
<span class="float-end text-end">
<field name="state" widget="label_selection" options="{'classes': {'draft': 'default', 'done': 'success'}}" readonly="1"/>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="mrp_unbuild_form_view" model="ir.ui.view">
<field name="name">mrp.unbuild.form</field>
<field name="model">mrp.unbuild</field>
<field name="arch" type="xml">
<form string="Unbuild Orders">
<field name="company_id" invisible="1"/>
<header>
<button name="action_validate" string="Unbuild" type="object" states="draft" class="oe_highlight" data-hotkey="v"/>
<field name="state" widget="statusbar" statusbar_visible="draft,done"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" name="%(action_mrp_unbuild_moves)d"
string="Product Moves" type="action" icon="fa-exchange" states="done"/>
</div>
<div class="oe_title">
<h1><field name="name" placeholder="Unbuild Order" nolabel="1"/></h1>
</div>
<group>
<group>
<field name="product_id" attrs="{'readonly':['|', ('mo_id','!=',False), ('state', '=', 'done')]}" force_save="1"/>
<field name="mo_bom_id" invisible="1"/>
<field name="bom_id" attrs="{'required': [('mo_id', '=', False)], 'readonly':['|', ('mo_id','!=',False), ('state', '=', 'done')], 'invisible': [('mo_id', '!=', False), ('mo_bom_id', '=', False)]}" force_save="1"/>
<label for="product_qty"/>
<div class="o_row">
<field name="product_qty" attrs="{'readonly': ['|', ('has_tracking', '=', 'serial'), ('state', '=', 'done')]}"/>
<field name="product_uom_id" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom" attrs="{'readonly': ['|', ('mo_id', '!=', False), ('state', '=', 'done')]}" force_save="1"/>
</div>
</group>
<group>
<field name="mo_id"/>
<field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
<field name="location_dest_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
<field name="has_tracking" invisible="1"/>
<field name="lot_id" attrs="{'invisible': [('has_tracking', '=', 'none')], 'required': [('has_tracking', '!=', 'none')], 'readonly':['|', ('mo_id','!=',False), ('state', '=', 'done')]}" groups="stock.group_production_lot" force_save="1"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<!-- simplified version of unbuild form for unbuild button via manufacturing order,
expects required fields to be filled in via 'default_' values -->
<record id="mrp_unbuild_form_view_simplified" model="ir.ui.view">
<field name="name">mrp.unbuild.form.simplified</field>
<field name="model">mrp.unbuild</field>
<field name="arch" type="xml">
<form string="Unbuild Order">
<sheet>
<group>
<group>
<field name="company_id" invisible="1"/>
<field name="state" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="bom_id" invisible="1"/>
<label for="product_qty"/>
<div class="o_row">
<field name="product_qty" attrs="{'readonly': [('has_tracking', '=', 'serial')]}"/>
<field name="product_uom_id" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom" attrs="{'readonly': [('mo_id', '!=', False)]}" force_save="1"/>
</div>
</group>
<group>
<field name="mo_id" invisible="1"/>
<field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
<field name="location_dest_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
<field name="has_tracking" invisible="1"/>
<field name="lot_id" readonly="1" attrs="{'invisible': [('has_tracking', '=', 'none')], 'required': [('has_tracking', '!=', 'none')]}" groups="stock.group_production_lot"/>
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
</group>
</group>
</sheet>
<footer class="oe_edit_only">
<button name="action_validate" string="Unbuild" type="object" states="draft" class="oe_highlight" data-hotkey="q"/>
<button string="Discard" special="cancel" data-hotkey="z"/>
</footer>
</form>
</field>
</record>
<record id="mrp_unbuild_tree_view" model="ir.ui.view">
<field name="name">mrp.unbuild.tree</field>
<field name="model">mrp.unbuild</field>
<field name="arch" type="xml">
<tree sample="1">
<field name="name" decoration-bf="1"/>
<field name="product_id"/>
<field name="bom_id"/>
<field name="mo_id"/>
<field name="lot_id" groups="stock.group_production_lot"/>
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom"/>
<field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="state" widget='badge' decoration-success="state == 'done'" decoration-info="state == 'draft'"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="mrp_unbuild">
<field name="name">Unbuild Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.unbuild</field>
<field name="view_mode">tree,kanban,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No unbuild order found
</p><p>
An unbuild order is used to break down a finished product into its components.
</p>
</field>
</record>
<menuitem id="menu_mrp_unbuild"
name="Unbuild Orders"
parent="menu_mrp_manufacturing"
action="mrp_unbuild"
sequence="20"/>
</odoo>

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem id="menu_mrp_root"
name="Manufacturing"
groups="group_mrp_user,group_mrp_manager"
web_icon="mrp,static/description/icon.svg"
sequence="145">
<menuitem id="menu_mrp_manufacturing"
name="Operations"
sequence="10"/>
<menuitem id="mrp_planning_menu_root"
name="Planning"
sequence="15"/>
<menuitem id="menu_mrp_bom"
name="Products"
sequence="20"/>
<menuitem id="menu_mrp_reporting"
name="Reporting"
sequence="25"/>
<menuitem id="menu_mrp_configuration"
name="Configuration"
groups="group_mrp_manager"
sequence="100"/>
</menuitem>
</odoo>

View file

@ -0,0 +1,644 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="act_product_mrp_production_workcenter" model="ir.actions.act_window">
<field name="context">{'search_default_confirmed': 1}</field>
<field name="name">Manufacturing Orders</field>
<field name="res_model">mrp.production</field>
<field name="view_mode">tree,kanban,form</field>
<field name="domain">[('bom_id', '!=', False), ('bom_id.operation_ids.workcenter_id', '=', active_id)]</field>
</record>
<record id="action_work_orders" model="ir.actions.act_window">
<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">tree,form,gantt,pivot,graph,calendar</field>
<field name="search_view_id" ref="view_mrp_production_work_order_search"/>
<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_smiling_face">
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>
</field>
</record>
<!-- Work Centers -->
<record id="mrp_workcenter_tree_view" model="ir.ui.view">
<field name="name">mrp.workcenter.tree</field>
<field name="model">mrp.workcenter</field>
<field name="arch" type="xml">
<tree string="Work Center" multi_edit="1">
<field name="company_id" invisible="1"/>
<field name="sequence" widget="handle"/>
<field name="name" optional="show"/>
<field name="code" optional="show"/>
<field name="tag_ids" widget="many2many_tags" options="{'no_create': True, 'color_field': 'color'}" optional="show"/>
<field name="alternative_workcenter_ids" widget="many2many_tags" optional="show"/>
<field name="productive_time" optional="hide"/>
<field name="costs_hour" optional="show"/>
<field name="default_capacity" optional="show"/>
<field name="time_efficiency" optional="show"/>
<field name="oee_target" optional="show"/>
<field name="time_start" optional="hide"/>
<field name="time_stop" optional="hide"/>
<field name="company_id" groups="base.group_multi_company" optional="hide"/>
<field name="active" invisible="1"/>
</tree>
</field>
</record>
<record id="mrp_workcenter_view_kanban" model="ir.ui.view">
<field name="name">mrp.workcenter.kanban</field>
<field name="model">mrp.workcenter</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_content oe_kanban_global_click">
<div class="row">
<div class="col-12">
<strong><field name="name"/></strong>
</div>
<div class="col-12">
<span>Code <field name="code"/></span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="oee_pie_view" model="ir.ui.view">
<field name="name">mrp.workcenter.productivity.graph</field>
<field name="model">mrp.workcenter.productivity</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<graph string="Workcenter Productivity" type="pie" sample="1">
<field name="loss_id"/>
<field name="duration" type="measure" string="Duration (minutes)"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="mrp_workcenter_productivity_report_oee">
<field name="name">Overall Equipment Effectiveness</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workcenter.productivity</field>
<field name="view_id" eval="oee_pie_view"/>
<field name="view_mode">graph,pivot,tree,form</field>
<field name="domain">[('workcenter_id','=',active_id)]</field>
<field name="context">{'search_default_thismonth':True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Overall Equipment Effectiveness: no working or blocked time
</p>
</field>
</record>
<record model="ir.actions.act_window" id="mrp_workcenter_productivity_report_blocked">
<field name="name">Productivity Losses</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workcenter.productivity</field>
<field name="view_mode">tree,form,graph,pivot</field>
<field name="context">{'search_default_availability': '1',
'search_default_performance': '1',
'search_default_quality': '1',
'default_workcenter_id': active_id,
'search_default_workcenter_id': [active_id]}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
No productivity loss for this equipment
</p>
</field>
</record>
<record model="ir.actions.act_window" id="mrp_workorder_workcenter_report">
<field name="name">Work Orders Performance</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workorder</field>
<field name="domain">[('workcenter_id','=', active_id),('state','=','done')]</field>
<field name="view_mode">graph,pivot,tree,form,gantt</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new work orders performance
</p>
</field>
</record>
<record model="ir.actions.act_window" id="mrp_workorder_report">
<field name="name">Work Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workorder</field>
<field name="domain">[]</field>
<field name="context">{'search_default_workcenter': 1,
'search_default_ready': True,
'search_default_waiting': True,
'search_default_pending': True,
'search_default_progress': True,}</field>
<field name="view_mode">graph,pivot,tree,form,gantt</field>
<field name="search_view_id" ref="view_mrp_production_work_order_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new work orders performance
</p>
</field>
</record>
<!-- Workcenter Kanban view-->
<record model="ir.ui.view" id="mrp_workcenter_kanban">
<field name="name">mrp.workcenter.kanban</field>
<field name="model">mrp.workcenter</field>
<field name="arch" type="xml">
<kanban class="oe_background_grey o_kanban_dashboard o_workcenter_kanban" create="0" sample="1">
<field name="name"/>
<field name="color"/>
<field name="workorder_count"/>
<field name="working_state"/>
<field name="oee_target"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''}">
<div t-attf-class="o_kanban_card_header o_kanban_record_top">
<div class="o_kanban_record_headings o_kanban_card_header_title">
<span class="o_primary ml8" style="display: inline-block">
<field name="name"/>
</span>
</div>
<div class="o_kanban_manage_button_section">
<a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
</div>
</div>
<div class="container o_kanban_card_content">
<div class="row mb16">
<div class="col-6 o_kanban_primary_left">
<div class="btn-group" name="o_wo">
<t t-if="record.workorder_count.raw_value &gt; 0">
<button class="btn btn-primary" name="action_work_order" type="object" context="{'search_default_ready': 1, 'search_default_progress': 1}">
<span>WORK ORDERS</span>
</button>
</t>
<t t-if="record.workorder_count.raw_value &lt;= 0">
<button class="btn btn-warning" name="%(act_product_mrp_production_workcenter)d" type="action">
<span>PLAN ORDERS</span>
</button>
</t>
</div>
</div>
<div class="col-6 o_kanban_primary_right">
<div class="row" t-if="record.workorder_ready_count.raw_value &gt; 0">
<div class="col-8">
<a name="action_work_order" type="object" context="{'search_default_ready': 1}">
To Launch
</a>
</div>
<div class="col-4 text-end">
<field name="workorder_ready_count"/>
</div>
</div>
<div class="row" t-if="record.workorder_progress_count.raw_value &gt; 0">
<div class="col-8">
<a name="action_work_order" type="object" context="{'search_default_progress': 1}">
In Progress
</a>
</div>
<div class="col-4 text-end">
<field name="workorder_progress_count"/>
</div>
</div>
<div class="row" t-if="record.workorder_late_count.raw_value &gt; 0">
<div class="col-8">
<a name="action_work_order" type="object" context="{'search_default_late': 1}">
Late
</a>
</div>
<div class="col-4 text-end">
<field name="workorder_late_count"/>
</div>
</div>
<div class="row" t-if="record.oee.raw_value &gt; 0">
<div class="col-6">
<a name="%(mrp_workcenter_productivity_report_oee)d" type="action">
OEE
</a>
</div>
<div class="col-6 text-end">
<span t-att-class="record.oee_target.raw_value and (record.oee.raw_value &lt; record.oee_target.raw_value) and 'text-danger' or (record.oee.raw_value &gt; record.oee_target.raw_value) and 'text-success' or 'text-warning'">
<strong>
<field name="oee" widget="integer"/>%
</strong>
</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 o_kanban_primary_left" style="position:absolute; bottom:10px;" name="wc_stages">
<a name="%(act_mrp_block_workcenter)d" type="action" class="o_status float-end"
title="No workorder currently in progress. Click to mark work center as blocked."
aria-label="No workorder currently in progress. Click to mark work center as blocked."
attrs="{'invisible': [('working_state','in',('blocked','done'))]}"/>
<a name="unblock" type="object" class=" o_status o_status_red float-end"
title="Workcenter blocked, click to unblock."
aria-label="Workcenter blocked, click to unblock."
attrs="{'invisible': [('working_state','in',('normal','done'))]}"/>
<a name="%(act_mrp_block_workcenter)d" type="action" class="o_status o_status_green float-end"
title="Work orders in progress. Click to block work center."
aria-label="Work orders in progress. Click to block work center."
attrs="{'invisible': [('working_state','in',('normal','blocked'))]}"/>
</div>
</div>
</div><div class="container o_kanban_card_manage_pane dropdown-menu" role="menu">
<div class="row">
<div class="col-6 o_kanban_card_manage_section o_kanban_manage_view">
<div role="menuitem" class="o_kanban_card_manage_title">
<span>Actions</span>
</div>
<div role="menuitem" name="plan_order">
<a name="action_work_order" type="object">Plan Orders</a>
</div>
</div>
<div class="col-6 o_kanban_card_manage_section o_kanban_manage_new">
<div role="menuitem" class="o_kanban_card_manage_title">
<span>Reporting</span>
</div>
<div role="menuitem">
<a name="%(mrp_workcenter_productivity_report_oee)d" type="action">OEE</a>
</div>
<div role="menuitem">
<a name="%(mrp_workorder_workcenter_report)d" type="action" context="{'search_default_thisyear':True}">
Performance
</a>
</div>
<div role="menuitem">
<a name="action_work_order" type="object" context="{'search_default_waiting': 1}">Waiting Availability</a>
</div>
</div>
</div>
<div t-if="widget.editable" class="o_kanban_card_manage_settings row">
<div role="menuitem" aria-haspopup="true" class="col-8">
<ul role="menu" class="oe_kanban_colorpicker" data-field="color"/>
</div>
<div role="menuitem" class="col-4">
<a type="edit">Settings</a>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="mrp_workcenter_view" model="ir.ui.view">
<field name="name">mrp.workcenter.form</field>
<field name="model">mrp.workcenter</field>
<field name="arch" type="xml">
<form string="Work Center">
<sheet>
<div class="oe_button_box" name="button_box">
<field name="routing_line_ids" invisible="1"/>
<button string="Operations" type="object"
name="action_show_operations"
attrs="{'invisible': [('routing_line_ids', '=', [])]}"
context="{'default_workcenter_id': active_id}"
class="oe_stat_button" icon="fa-cog"/>
<button name="%(mrp_workcenter_productivity_report_oee)d" type="action" class="oe_stat_button" icon="fa-pie-chart">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="oee" widget="statinfo" nolabel="1"/>%</span>
<span class="o_stat_text">OEE</span>
</div>
</button>
<button name="%(mrp_workcenter_productivity_report_blocked)d" type="action" class="oe_stat_button" icon="fa-bar-chart">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="blocked_time" widget="statinfo" nolabel="1"/> Hours</span>
<span class="o_stat_text">Lost</span>
</div>
</button>
<button name="%(action_mrp_workcenter_load_report_graph)d" type="action" class="oe_stat_button" icon="fa-bar-chart"
context="{'search_default_workcenter_id': id,
'search_default_ready': True,
'search_default_waiting': True,
'search_default_pending': True,
'search_default_progress': True}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="workcenter_load" widget="statinfo" nolabel="1"/> Minutes</span>
<span class="o_stat_text">Load</span>
</div>
</button>
<button name="%(mrp_workorder_report)d" type="action" class="oe_stat_button" icon="fa-bar-chart" context="{'search_default_workcenter_id': id, 'search_default_thisyear': True}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="performance" widget="statinfo" nolabel="1"/>%</span>
<span class="o_stat_text">Performance</span>
</div>
</button>
</div>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<group>
<group>
<field name="active" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="name" string="Work Center Name" required="True"/>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field
name="alternative_workcenter_ids"
widget="many2many_tags"
/>
</group>
<group>
<field name="code"/>
<field name="resource_calendar_id" required="1"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
</group>
</group>
<notebook>
<page string="General Information" name="general_info">
<group>
<group string="Production Information" name="capacity">
<label for="time_efficiency"/>
<div class="o_row">
<field name="time_efficiency"/> %
</div>
<field name="default_capacity"/>
<label for="oee_target"/>
<div class="o_row">
<field name="oee_target"/> %
</div>
</group>
<group string="Costing Information" name="costing">
<label for="costs_hour"/>
<div id="costs_hour">
<field name="costs_hour" widget="monetary" class="oe_inline"/> per workcenter
</div>
</group>
<group>
<label for="time_start"/>
<div>
<field name="time_start" widget="float_time" class="oe_inline"/> minutes
</div>
<label for="time_stop"/>
<div>
<field name="time_stop" widget="float_time" class="oe_inline"/> minutes
</div>
</group>
</group>
<separator string="Description"/>
<field name="note" nolabel="1" placeholder="Description of the work center..."/>
</page>
<page string="Specific Capacities" name="capacity">
<field name="capacity_ids" context="{'default_workcenter_id': id}">
<tree editable="bottom">
<field name="product_id"/>
<field name="product_uom_id" groups="uom.group_uom"/>
<field name="capacity"/>
<field name="time_start" optional="hide"/>
<field name="time_stop" optional="hide"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_mrp_workcenter_search" model="ir.ui.view">
<field name="name">mrp.workcenter.search</field>
<field name="model">mrp.workcenter</field>
<field name="arch" type="xml">
<search string="Search for mrp workcenter">
<field name="name" string="Work Center" filter_domain="['|', ('name', 'ilike', self), ('code', 'ilike', self)]"/>
<filter name="archived" string="Archived" domain="[('active', '=', False)]"/>
<group expand="0" string="Group By...">
<filter string="Company" name="company" domain="[]" context="{'group_by': 'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
</field>
</record>
<record id="mrp_workcenter_action" model="ir.actions.act_window">
<field name="name">Work Centers</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workcenter</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_id" ref="mrp_workcenter_tree_view"/>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('mrp_workcenter_tree_view')}),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('mrp_workcenter_view_kanban')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('mrp_workcenter_view')})]"/>
<field name="search_view_id" ref="view_mrp_workcenter_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new work center
</p><p>
Manufacturing operations are processed at Work Centers. A Work Center can be composed of
workers and/or machines, they are used for costing, scheduling, capacity planning, etc.
</p>
</field>
</record>
<record id="mrp_workcenter_kanban_action" model="ir.actions.act_window">
<field name="name">Work Centers Overview</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workcenter</field>
<field name="view_mode">kanban,form</field>
<field name="view_id" ref="mrp_workcenter_kanban"/>
<field name="search_view_id" ref="view_mrp_workcenter_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new work center
</p><p>
Manufacturing operations are processed at Work Centers. A Work Center can be composed of
workers and/or machines, they are used for costing, scheduling, capacity planning, etc.
They can be defined via the configuration menu.
</p>
</field>
</record>
<menuitem id="menu_view_resource_search_mrp"
action="mrp_workcenter_action"
groups="group_mrp_routings"
parent="menu_mrp_configuration"
sequence="90"/>
<record id="oee_loss_form_view" model="ir.ui.view">
<field name="name">mrp.workcenter.productivity.loss.form</field>
<field name="model">mrp.workcenter.productivity.loss</field>
<field name="arch" type="xml">
<form string="Workcenter Productivity Loss">
<sheet>
<group>
<field name="name"/>
<field name="loss_id" options="{'no_open': True, 'no_create': True}"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="oee_loss_tree_view" model="ir.ui.view">
<field name="name">mrp.workcenter.productivity.loss.tree</field>
<field name="model">mrp.workcenter.productivity.loss</field>
<field name="arch" type="xml">
<tree string="Workcenter Productivity Loss" editable='bottom'>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="loss_type" string="Category"/>
</tree>
</field>
</record>
<record id="view_mrp_workcenter_productivity_loss_kanban" model="ir.ui.view">
<field name="name">mrp.workcenter.productivity.loss.kanban</field>
<field name="model">mrp.workcenter.productivity.loss</field>
<field name="arch" type="xml">
<kanban>
<field name="name"/>
<field name="manual"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div>
<strong>Reason: </strong><field name="name"/>
</div>
<div>
<strong>Effectiveness Category: </strong><field name="loss_type"/>
</div>
<div>
<strong>Is a Blocking Reason? </strong>
<span class="float-end" title="Is a Blocking Reason?">
<field name="manual" widget="boolean"/>
</span>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="oee_loss_search_view" model="ir.ui.view">
<field name="name">mrp.workcenter.productivity.loss.search</field>
<field name="model">mrp.workcenter.productivity.loss</field>
<field name="arch" type="xml">
<search string="Operations">
<field name="name"/>
</search>
</field>
</record>
<record id="oee_search_view" model="ir.ui.view">
<field name="name">mrp.workcenter.productivity.search</field>
<field name="model">mrp.workcenter.productivity</field>
<field name="arch" type="xml">
<search string="Operations">
<field name="workcenter_id"/>
<field name="loss_id"/>
<separator/>
<filter name="availability" string="Availability Losses" domain="[('loss_type','=','availability')]"/>
<filter name="performance" string="Performance Losses" domain="[('loss_type','=','performance')]"/>
<filter name="quality" string="Quality Losses" domain="[('loss_type','=','quality')]"/>
<filter name="productive" string="Fully Productive" domain="[('loss_type','=','productive')]"/>
<filter name="filter_date_start" string="Date" date="date_start"/>
<separator/>
<group expand='0' string='Group by...'>
<filter string="User" name="user" context="{'group_by': 'create_uid'}"/>
<filter string='Workcenter' name="workcenter_group" context="{'group_by': 'workcenter_id'}"/>
<filter string="Loss Reason" name="loss_group" context="{'group_by': 'loss_id'}"/>
</group>
</search>
</field>
</record>
<record id="oee_form_view" model="ir.ui.view">
<field name="name">mrp.workcenter.productivity.form</field>
<field name="model">mrp.workcenter.productivity</field>
<field name="priority">5</field>
<field name="arch" type="xml">
<form string="Workcenter Productivity">
<group>
<group>
<field name="production_id"/>
<field name="workorder_id"/>
<field name="workcenter_id"/>
<field name="loss_id"/>
<field name="company_id" invisible="1"/>
</group><group>
<field name="date_start"/>
<field name="date_end"/>
<field name="duration"/>
<field name="company_id"/>
</group>
<field name="description"/>
</group>
</form>
</field>
</record>
<record id="oee_tree_view" model="ir.ui.view">
<field name="name">mrp.workcenter.productivity.tree</field>
<field name="model">mrp.workcenter.productivity</field>
<field name="arch" type="xml">
<tree string="Workcenter Productivity">
<field name="date_start"/>
<field name="date_end"/>
<field name="workcenter_id"/>
<field name="user_id"/>
<field name="loss_id"/>
<field name="duration" string="Duration (minutes)" sum="Duration"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="oee_graph_view" model="ir.ui.view">
<field name="name">mrp.workcenter.productivity.graph</field>
<field name="model">mrp.workcenter.productivity</field>
<field name="arch" type="xml">
<graph string="Workcenter Productivity" sample="1">
<field name="workcenter_id"/>
<field name="loss_id"/>
<field name="duration" type="measure" string="Duration (minutes)"/>
</graph>
</field>
</record>
<record id="oee_pivot_view" model="ir.ui.view">
<field name="name">mrp.workcenter.productivity.pivot</field>
<field name="model">mrp.workcenter.productivity</field>
<field name="arch" type="xml">
<pivot string="Workcenter Productivity" sample="1">
<field name="date_start" type="row" interval="day"/>
<field name="loss_type" type="col"/>
<field name="duration" type="measure" string="Duration (minutes)"/>
</pivot>
</field>
</record>
<record model="ir.actions.act_window" id="mrp_workcenter_productivity_report">
<field name="name">Overall Equipment Effectiveness</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workcenter.productivity</field>
<field name="view_mode">graph,pivot,tree,form</field>
<field name="domain">[]</field>
<field name="context">{'search_default_workcenter_group': 1, 'search_default_loss_group': 2, 'create':False,'edit':False}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Overall Equipment Effectiveness: no working or blocked time
</p>
</field>
</record>
<menuitem id="menu_mrp_workcenter_productivity_report"
parent="menu_mrp_reporting"
action="mrp_workcenter_productivity_report"
groups="group_mrp_routings"
sequence="12"/>
</data>
</odoo>

View file

@ -0,0 +1,561 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_mrp_production_work_order_search" model="ir.ui.view">
<field name="name">mrp.production.work.order.search</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<search>
<field name="production_id"/>
<field name="workcenter_id"/>
<field name="product_id"/>
<filter string="Ready" name="ready" domain="[('state','=','ready')]"/>
<filter string="Waiting" name="waiting" domain="[('state','=','waiting')]"/>
<filter string="Pending" name="pending" domain="[('state','=','pending')]"/>
<filter string="In Progress" name="progress" domain="[('state','=','progress')]"/>
<filter string="Done" name="done" domain="[('state','=', 'done')]"/>
<filter string="Late" name="late" domain="[('date_planned_start','&lt;=',time.strftime('%Y-%m-%d'))]"/>
<separator/>
<filter string="Start Date" name="date_start_filter" date="date_start"/>
<group expand="0" string="Group By...">
<filter string="Work center" name="workcenter" domain="[]" context="{'group_by': 'workcenter_id'}"/>
<filter string="Product" name="product" domain="[]" context="{'group_by': 'product_id'}"/>
</group>
</search>
</field>
</record>
<record id="action_mrp_routing_time" model="ir.actions.act_window">
<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">graph,pivot,tree,form,gantt,calendar</field>
<field name="context">{'search_default_done': True}</field>
<field name="search_view_id" ref="view_mrp_production_work_order_search"/>
<field name="domain">[('operation_id.bom_id', '=', active_id), ('state', '=', 'done')]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No data yet!
</p><p>
Get statistics about the work orders duration related to this routing.
</p>
</field>
</record>
<record model="ir.actions.act_window" id="action_mrp_workorder_production_specific">
<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">tree,form,gantt,calendar,pivot,graph</field>
<field name="domain">[('production_id', '=', active_id)]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
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>
</field>
</record>
<record model="ir.ui.view" id="mrp_production_workorder_tree_editable_view">
<field name="name">mrp.production.work.order.tree.editable</field>
<field name="model">mrp.workorder</field>
<field name="priority" eval="100"/>
<field name="arch" type="xml">
<tree editable="bottom" multi_edit="1">
<field name="consumption" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="is_produced" invisible="1"/>
<field name="is_user_working" invisible="1"/>
<field name="product_uom_id" invisible="1" readonly="0"/>
<field name="production_state" invisible="1"/>
<field name="production_bom_id" invisible="1"/>
<field name="qty_producing" invisible="1"/>
<field name="time_ids" invisible="1"/>
<field name="working_state" invisible="1"/>
<field name="operation_id" invisible="1" domain="['|', ('bom_id', '=', production_bom_id), ('bom_id', '=', False)]" context="{'default_workcenter_id': workcenter_id, 'default_company_id': company_id}"/>
<field name="name" string="Operation"/>
<field name="workcenter_id"/>
<field name="product_id" optional="show"/>
<field name="qty_remaining" optional="show" string="Remaining Quantity " attrs="{'column_invisible': [('parent.state', '=', 'done')]}"/>
<field name="qty_produced" optional="show" string="Produced Quantity" attrs="{'column_invisible': [('parent.state', '!=', 'done')]}"/>
<field name="finished_lot_id" optional="hide" string="Lot/Serial"/>
<field name="date_planned_start" optional="show"/>
<field name="date_planned_finished" optional="hide"/>
<field name="date_start" optional="hide" readonly="1"/>
<field name="date_finished" optional="hide" readonly="1"/>
<field name="duration_expected" widget="float_time" sum="expected duration"/>
<field name="duration" widget="mrp_timer"
attrs="{'invisible': [('production_state','=', 'draft')], 'readonly': [('is_user_working', '=', True)]}" sum="real duration"/>
<field name="state" widget="badge" decoration-warning="state == 'progress'" decoration-success="state == 'done'" decoration-danger="state == 'cancel'" decoration-info="state not in ('progress', 'done', 'cancel')"
attrs="{'invisible': [('production_state', '=', 'draft')], 'column_invisible': [('parent.state', '=', 'draft')]}"/>
<button name="button_start" type="object" string="Start" class="btn-success"
attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}"/>
<button name="button_pending" type="object" string="Pause" class="btn-warning"
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
<button name="button_finish" type="object" string="Done" class="btn-success"
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="Block" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}"/>
<button name="button_unblock" type="object" string="Unblock" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>
<button name="action_open_wizard" type="object" icon="fa-external-link" class="oe_edit_only"
title="Open Work Order"
context="{'default_workcenter_id': workcenter_id}"/>
<field name="show_json_popover" invisible="1"/>
<field name="json_popover" widget="mrp_workorder_popover" string=" " width="0.1" attrs="{'invisible': [('show_json_popover', '=', False)]}"/>
</tree>
</field>
</record>
<record id="mrp_production_workorder_tree_view" model="ir.ui.view">
<field name="name">mrp.production.work.order.tree</field>
<field name="model">mrp.workorder</field>
<field name="mode">primary</field>
<field name="priority" eval="10"/>
<field name="inherit_id" ref="mrp.mrp_production_workorder_tree_editable_view"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="create">0</attribute>
<attribute name="sample">1</attribute>
</xpath>
<field name="workcenter_id" position="after">
<field name="production_id"/>
</field>
<field name="state" position="attributes">
<attribute name="attrs">{'invisible': [('production_state', '=', 'draft')]}</attribute>
</field>
</field>
</record>
<record model="ir.ui.view" id="mrp_production_workorder_form_view_inherit">
<field name="name">mrp.production.work.order.form</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<form string="Production Workcenter" delete="0" create="0">
<field name="is_user_working" invisible="1"/>
<field name="working_state" invisible="1"/>
<field name="production_state" invisible="1"/>
<header>
<field name="state" widget="statusbar" statusbar_visible="pending,waiting,ready,progress,done"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" name="action_see_move_scrap" type="object" icon="fa-arrows-v" attrs="{'invisible': [('scrap_count', '=', 0)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="scrap_count"/></span>
<span class="o_stat_text">Scraps</span>
</div>
</button>
</div>
<field name="workcenter_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="product_tracking" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="finished_lot_id" invisible="1"/>
<field name="qty_producing" invisible="1"/>
<group>
<group attrs="{'invisible': [('date_planned_start', '=', False)]}">
<label for="date_planned_start" string="Planned Date"/>
<div class="oe_inline">
<field name="is_planned" invisible="1"/>
<field name="date_planned_start" class="mr8 oe_inline" attrs="{'required': [('is_planned', '=', True)]}"/>
<strong class="mr8 oe_inline">to</strong>
<field name="date_planned_finished" class="oe_inline" attrs="{'required': [('is_planned', '=', True)]}"/>
<field name="show_json_popover" invisible="1"/>
<field name="json_popover" widget="mrp_workorder_popover" class="oe_inline mx-2" attrs="{'invisible': [('show_json_popover', '=', False)]}"/>
</div>
<label for="duration_expected"/>
<div class="o_row">
<field name="duration_expected" widget="float_time"/>
<span>minutes</span>
</div>
</group>
<group>
<field name="production_id"/>
</group>
</group>
<notebook>
<page string="Components" name="components">
<field name="move_raw_ids" readonly="1">
<tree>
<field name="state" invisible="1"/>
<field name="product_type" invisible="1"/>
<field name="product_id"/>
<field name="product_qty" string="To Consume"/>
<field name="reserved_availability" string ="Reserved"/>
<field name="quantity_done" string="Consumed"/>
<field name="product_qty_available" string="On Hand" attrs="{'invisible': [('product_type', '!=', 'product')]}"/>
<field name="product_virtual_available" string="Forecasted" attrs="{'invisible': [('product_type', '!=', 'product')]}"/>
</tree>
</field>
</page>
<page string="Time Tracking" name="time_tracking" groups="mrp.group_mrp_manager">
<field name="time_ids" nolabel="1" context="{'default_workcenter_id': workcenter_id, 'default_workorder_id': id}">
<tree editable="bottom">
<field name="user_id"/>
<field name="duration" widget="float_time" sum="Total duration"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="workcenter_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="loss_id" string="Productivity" optional="show"/>
</tree>
<form>
<group>
<group>
<field name="date_start"/>
<field name="date_end"/>
<field name="duration" widget="float_time"/>
<field name="company_id" invisible="1"/>
</group>
<group>
<field name="user_id"/>
<field name="workcenter_id"/>
<field name="company_id" invisible="1"/>
<field name="loss_id"/>
</group>
</group>
</form>
</field>
</page>
<page string="Work Instruction" name="workorder_page_work_instruction" attrs="{'invisible': [('worksheet', '=', False), ('worksheet_google_slide', '=', False), ('operation_note', '=', False)]}">
<field name="worksheet_type" invisible="1"/>
<field name="worksheet" widget="pdf_viewer" attrs="{'invisible': [('worksheet_type', '!=', 'pdf')]}"/>
<field name="worksheet_google_slide" widget="embed_viewer" attrs="{'invisible': [('worksheet_type', '!=', 'google_slide')]}"/>
<field name="operation_note" attrs="{'invisible': [('worksheet_type', '!=', 'text')]}"/>
</page>
<field name="allow_workorder_dependencies" invisible="1"/>
<page string="Blocked By" name="dependencies" attrs="{'invisible': [('allow_workorder_dependencies', '=', False)]}">
<field name="blocked_by_workorder_ids" nolabel="1">
<tree editable="bottom">
<field name="company_id" invisible="1"/>
<field name="name" string="Operation"/>
<field name="company_id" optional="hide" groups="base.group_multi_company"/>
<field name="workcenter_id"/>
<field name="date_planned_start" readonly="1"/>
<field name="date_planned_finished" readonly="1"/>
<field name="duration_expected" widget="float_time" sum="expected duration"/>
<field name="production_state" invisible="1"/>
<field name="state" widget="badge" decoration-warning="state == 'progress'" decoration-success="state == 'done'" decoration-info="state not in ('progress', 'done', 'cancel')"
attrs="{'invisible': [('production_state', '=', 'draft')], 'column_invisible': [('parent.state', '=', 'draft')]}"/>
<button class="oe_link float-end" string="View WorkOrder" name="action_open_wizard" type="object"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_mrp_production_workorder_form_view_filter" model="ir.ui.view">
<field name="name">mrp.production.work.order.select</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<search string="Search Work Orders">
<field name="name" string="Work Order"/>
<field name="workcenter_id"/>
<field name="production_id"/>
<field name="product_id"/>
<filter string="In Progress" name="progress" domain="[('state', '=', 'progress')]"/>
<filter string="Ready" name="ready" domain="[('state', '=', 'ready')]"/>
<filter string="Waiting" name="waiting" domain="[('state', '=', 'waiting')]"/>
<filter string="Pending" name="pending" domain="[('state', '=', 'pending'), ('production_state', '!=', 'draft')]"/>
<filter string="Draft" name="draft" domain="[('state', '=', 'pending'), ('production_state', '=', 'draft')]"/>
<filter string="Finished" name="finish" domain="[('state', '=', 'done')]"/>
<separator/>
<filter string="Late" name="late" domain="['&amp;', ('date_planned_start', '&lt;', current_date), ('state', '=', 'ready')]"
help="Production started late"/>
<group expand="0" string="Group By">
<filter string="Work Center" name="work_center" domain="[]" context="{'group_by': 'workcenter_id'}"/>
<filter string="Manufacturing Order" name="production" domain="[]" context="{'group_by': 'production_id'}"/>
<filter string="Status" name="status" domain="[]" context="{'group_by': 'state'}"/>
<filter string="Scheduled Date" name="scheduled_month" domain="[]" context="{'group_by': 'date_planned_start'}"/>
</group>
</search>
</field>
</record>
<record id="workcenter_line_calendar" model="ir.ui.view">
<field name="name">mrp.production.work.order.calendar</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<calendar date_stop="date_planned_finished" date_start="date_planned_start" string="Operations" color="workcenter_id" event_limit="5" delete="0" create="0">
<field name="workcenter_id" filters="1"/>
<field name="production_id"/>
<field name="state"/>
</calendar>
</field>
</record>
<record id="workcenter_line_graph" model="ir.ui.view">
<field name="name">mrp.production.work.order.graph</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<graph string="Operations" stacked="0" sample="1">
<field name="production_id"/>
<field name="duration" type="measure" string="Duration (minutes)"/>
<field name="duration_unit" type="measure"/>
<field name="duration_expected" type="measure"/>
</graph>
</field>
</record>
<record id="workcenter_line_pivot" model="ir.ui.view">
<field name="name">mrp.production.work.order.pivot</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<pivot string="Operations" sample="1">
<field name="date_start"/>
<field name="operation_id"/>
<field name="duration" type="measure" string="Duration (minutes)" widget="float_time"/>
<field name="duration_unit" type="measure" widget="float_time"/>
<field name="duration_expected" type="measure" widget="float_time"/>
</pivot>
</field>
</record>
<record id="workcenter_line_gantt_production" model="ir.ui.view">
<field name="name">mrp.production.work.order.gantt.production</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<gantt class="o_mrp_workorder_gantt" date_stop="date_planned_finished" date_start="date_planned_start" string="Operations" default_group_by="production_id" create="0" delete="0"
progress="progress" plan="0"
decoration-danger="json_popover and 'text-danger' in json_popover"
decoration-success="state == 'done'"
decoration-warning="state == 'cancel' or (json_popover and 'text-warning' in json_popover)"
color="workcenter_id"
display_unavailability="1"
sample="1"
form_view_id="%(mrp_production_workorder_form_view_inherit)d">
<field name="date_planned_start"/>
<field name="state"/>
<field name="workcenter_id"/>
<field name="json_popover"/>
<templates>
<div t-name="gantt-popover" class="container-fluid">
<div class="row g-0">
<div class="col">
<ul class="ps-1 mb-0 list-unstyled">
<li><strong>Start Date: </strong> <t t-out="userTimezoneStartDate.format('L LTS')"/></li>
<li><strong>Stop Date: </strong> <t t-out="userTimezoneStopDate.format('L LTS')"/></li>
<li><strong>Workcenter: </strong> <t t-out="workcenter_id[1]"/></li>
</ul>
</div>
</div>
</div>
</templates>
</gantt>
</field>
</record>
<record id="mrp_workorder_view_gantt" model="ir.ui.view">
<field name="name">mrp.workorder.view.gantt</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<gantt class="o_mrp_workorder_gantt" date_stop="date_planned_finished" date_start="date_planned_start" string="Operations" default_group_by="workcenter_id" create="0"
delete="0" sample="1"
progress="progress" plan="0"
decoration-danger="json_popover and 'text-danger' in json_popover"
decoration-success="state == 'done'"
decoration-warning="state == 'cancel' or (json_popover and 'text-warning' in json_popover)"
color="production_id"
display_unavailability="1"
progress_bar="workcenter_id"
form_view_id="mrp_production_workorder_form_view_inherit">
<field name="date_planned_start"/>
<field name="state"/>
<field name="workcenter_id"/>
<field name="json_popover"/>
<templates>
<div t-name="gantt-popover" class="container-fluid">
<div class="row g-0">
<div class="col">
<ul class="ps-1 mb-0 list-unstyled">
<li><strong>Start Date: </strong> <t t-out="userTimezoneStartDate.format('L LTS')"/></li>
<li><strong>Stop Date: </strong> <t t-out="userTimezoneStopDate.format('L LTS')"/></li>
<li><strong>Workcenter: </strong> <t t-out="workcenter_id[1]"/></li>
</ul>
</div>
</div>
</div>
</templates>
</gantt>
</field>
</record>
<record model="ir.ui.view" id="workcenter_line_kanban">
<field name="name">mrp.production.work.order.kanban</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<kanban class="oe_background_grey o_kanban_dashboard o_mrp_workorder_kanban" create="0" sample="1">
<field name="name"/>
<field name="production_id"/>
<field name="state" readonly="1"/>
<field name="is_user_working"/>
<field name="working_user_ids"/>
<field name="last_working_user_id"/>
<field name="working_state"/>
<field name="workcenter_id"/>
<field name="product_id"/>
<field name="qty_remaining"/>
<field name="qty_production"/>
<field name="date_planned_start"/>
<field name="production_date"/>
<field name="product_uom_id" force_save="1"/>
<field name="operation_id"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_card_header o_kanban_record_top">
<div class="o_kanban_workorder_title">
<h4 class="o_primary">
<span><t t-out="record.production_id.value"/></span> - <span><t t-out="record.name.value"/></span>
</h4>
</div>
<div class="o_kanban_workorder_date">
<h5><span class="d-flex" t-esc="record.date_planned_start.value or record.production_date.value"/></h5>
</div>
<div>
<h2 class="ml8">
<span t-attf-class="badge #{['progress'].indexOf(record.state.raw_value) > -1 ? 'text-bg-warning' : ['ready', 'waiting', 'pending'].indexOf(record.state.raw_value) > -1 ? 'text-bg-primary' : ['done'].indexOf(record.state.raw_value) > -1 ? 'text-bg-success' : 'text-bg-danger'}">
<t t-out="record.state.value"/>
</span>
</h2>
</div>
</div>
<div class="o_kanban_record_bottom">
<h5 class="oe_kanban_bottom_left">
<span><t t-out="record.product_id.value"/>, </span> <span><t t-out="record.qty_production.value"/> <t t-out="record.product_uom_id.value"/></span>
</h5>
<div class="o_kanban_workorder_status">
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_right" t-if="record.state.raw_value == 'progress'">
<span t-if="record.working_state.raw_value != 'blocked' and record.working_user_ids.raw_value.length > 0"><i class="fa fa-play" role="img" aria-label="Run" title="Run"/></span>
<span t-if="record.working_state.raw_value != 'blocked' and record.working_user_ids.raw_value.length == 0 and record.last_working_user_id.raw_value"><i class="fa fa-pause" role="img" aria-label="Pause" title="Pause"/></span>
<span t-if="record.working_state.raw_value == 'blocked' and (record.working_user_ids.raw_value.length == 0 or record.last_working_user_id.raw_value)"><i class="fa fa-stop" role="img" aria-label="Stop" title="Stop"/></span>
<t name="user_avatar" t-if="record.last_working_user_id.raw_value">
<img t-att-src="kanban_image('res.users', 'avatar_128', record.last_working_user_id.raw_value)" class="oe_kanban_avatar" alt="Avatar"/>
</t>
</div>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record model="ir.actions.act_window" id="action_mrp_workorder_workcenter">
<field name="name">Work Orders Planning</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workorder</field>
<field name="view_mode">gantt,tree,form,calendar,pivot,graph</field>
<field name="search_view_id" ref="view_mrp_production_workorder_form_view_filter"/>
<field name="view_id" ref="mrp_workorder_view_gantt"/>
<field name="context">{'search_default_work_center': True, 'search_default_ready': True, 'search_default_waiting': True, 'search_default_progress': True, 'search_default_pending': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
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>
</field>
</record>
<record model="ir.actions.act_window" id="action_mrp_workorder_production">
<field name="name">Work Orders Planning</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workorder</field>
<field name="domain">[('production_state','not in',('done','cancel'))]</field>
<field name="view_mode">gantt,tree,form,calendar,pivot,graph</field>
<field name="search_view_id" ref="view_mrp_production_workorder_form_view_filter"/>
<field name="view_id" ref="workcenter_line_gantt_production"/>
<field name="context">{'search_default_production': True, 'search_default_ready': True, 'search_default_waiting': True, 'search_default_progress': True, 'search_default_pending': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
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>
</field>
</record>
<record model="ir.actions.act_window" id="mrp_workorder_mrp_production_form">
<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">form</field>
<field name="target">new</field>
<field name="view_id" ref="mrp_production_workorder_form_view_inherit"/>
</record>
<record model="ir.actions.act_window" id="mrp_workorder_todo">
<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">tree,kanban,form,calendar,pivot,graph,gantt</field>
<field name="search_view_id" ref="view_mrp_production_workorder_form_view_filter"/>
<field name="context">{'search_default_ready': True, 'search_default_progress': True, 'search_default_pending': True, 'search_default_waiting': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
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>
</field>
</record>
<record id="view_workcenter_load_pivot" model="ir.ui.view">
<field name="name">report.workcenter.load.pivot</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<pivot string="Work Center Loads" sample="1">
<field name="duration_expected" type="measure" string="Expected Duration (minutes)"/>
<field name="workcenter_id" type="row"/>
<field name="production_date" type="row" interval="day"/>
</pivot>
</field>
</record>
<record id="view_work_center_load_graph" model="ir.ui.view">
<field name="name">report.workcenter.load.graph</field>
<field name="model">mrp.workorder</field>
<field name="arch" type="xml">
<graph string="Work Center load" sample="1">
<field name="production_date" interval="day"/>
<field name="workcenter_id"/>
<field name="duration_expected" type="measure" string="Expected Duration (minutes)"/>
</graph>
</field>
</record>
<record id="action_mrp_workcenter_load_report_graph" model="ir.actions.act_window">
<field name="name">Work Center Loads</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workorder</field>
<field name="view_mode">graph,pivot</field>
<field name="view_id" ref="view_workcenter_load_pivot"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No data yet!
</p>
</field>
</record>
<record id="action_mrp_workcenter_load_report_pivot" model="ir.actions.act_window.view">
<field name="view_mode">graph</field>
<field name="view_id" ref="view_work_center_load_graph"/>
<field name="act_window_id" ref="action_mrp_workcenter_load_report_graph"/>
</record>
</odoo>

View file

@ -0,0 +1,155 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Product Template -->
<record id="view_mrp_product_template_form_inherited" model="ir.ui.view">
<field name="name">product.form.mrp.inherited</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.view_template_property_form"/>
<field name="arch" type="xml">
<xpath expr="//label[@for='sale_delay']" position="before">
<field name="bom_count" string="Bill of Materials" invisible="1" groups="mrp.group_mrp_user"/>
<label for="produce_delay" string="Manuf. Lead Time" attrs="{'invisible':[('type','=','service')]}"/>
<div attrs="{'invisible':[('type','=','service')]}">
<field name="produce_delay" class="oe_inline"/> days
</div>
<label for="days_to_prepare_mo" attrs="{'invisible':[('type','=','service')]}"/>
<div attrs="{'invisible':[('type','=','service')]}">
<field name="days_to_prepare_mo" class="oe_inline"/> days
<button name="action_compute_bom_days" string="Compute from BoM" type="object" attrs="{'invisible':['|', ('type', '=', 'service'), ('bom_count', '=', 0)]}"
groups="mrp.group_mrp_user"
help="Compute the days required to resupply all components from BoM, by either buying or manufacturing the components and/or subassemblies.
Also note that purchase security lead times will be added when appropriate."
class="oe_link pt-0"/>
</div>
</xpath>
<xpath expr="//field[@name='product_variant_count']" position="after">
<field name="is_kits" invisible="1"/>
</xpath>
</field>
</record>
<record id="mrp_product_template_search_view" model="ir.ui.view">
<field name="name">mrp.product.template.search</field>
<field name="model">product.template</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='consumable']" position="after">
<separator/>
<filter string="Manufactured Products" name="manufactured_products" domain="[('bom_ids', '!=', False)]"/>
<filter string="BoM Components" name="components" domain="[('bom_line_ids', '!=', False)]"/>
</xpath>
</field>
</record>
<record id="mrp_product_product_search_view" model="ir.ui.view">
<field name="name">mrp.product.product.search</field>
<field name="model">product.product</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="product.product_search_form_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='consumable']" position="after">
<separator/>
<filter string="Manufactured Products" name="manufactured_products" domain="[('bom_ids', '!=', False)]"/>
<filter string="BoM Components" name="components" domain="[('bom_line_ids', '!=', False)]"/>
</xpath>
</field>
</record>
<record id="product_template_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.template</field>
<field name="search_view_id" ref="mrp_product_template_search_view"/>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{"search_default_consumable": 1, 'default_detailed_type': 'product'}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No product found. Let's create one!
</p><p>
Define the components and finished products you wish to use in
bill of materials and manufacturing orders.
</p>
</field>
</record>
<menuitem id="menu_mrp_product_form"
name="Products"
action="product_template_action"
parent="menu_mrp_bom" sequence="1"/>
<record id="mrp_product_variant_action" model="ir.actions.act_window">
<field name="name">Product Variants</field>
<field name="res_model">product.product</field>
<field name="search_view_id" ref="mrp_product_product_search_view"/>
<field name="view_mode">kanban,tree,form</field>
</record>
<menuitem id="product_variant_mrp" name="Product Variants"
action="mrp_product_variant_action"
parent="menu_mrp_bom" groups="product.group_product_variant" sequence="2"/>
<record id="product_template_form_view_bom_button" model="ir.ui.view">
<field name="name">product.template.procurement</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_open_product_lot']" position="after">
<button class="oe_stat_button" name="%(template_open_bom)d" type="action"
groups="mrp.group_mrp_user"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}" icon="fa-flask">
<field string="Bill of Materials" name="bom_count" widget="statinfo" />
</button>
<button class="oe_stat_button" name="action_used_in_bom" type="object"
groups="mrp.group_mrp_user"
attrs="{'invisible':['|',('type', 'not in', ['product', 'consu']), ('used_in_bom_count', '=', 0)]}" icon="fa-level-up">
<field string="Used In" name="used_in_bom_count" widget="statinfo" />
</button>
<button class="oe_stat_button" name="action_view_mos" type="object"
groups="mrp.group_mrp_user"
attrs="{'invisible': ['|', '|', ('type', 'not in', ['product', 'consu']), ('bom_count', '=', 0), ('mrp_product_qty', '=', 0)]}" icon="fa-list-alt" help="Manufactured in the last 365 days">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="mrp_product_qty" widget="statinfo" nolabel="1" class="mr4"/>
<field name="uom_name"/>
</span>
<span class="o_stat_text">Manufactured</span>
</div>
</button>
</xpath>
</field>
</record>
<record id="product_product_form_view_bom_button" model="ir.ui.view">
<field name="name">product.product.procurement</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="stock.product_form_view_procurement_button"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_open_product_lot']" position="after">
<button class="oe_stat_button" name="action_view_bom" type="object"
groups="mrp.group_mrp_user"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}" icon="fa-flask">
<field string="Bill of Materials" name="bom_count" widget="statinfo" />
</button>
<button class="oe_stat_button" name="action_used_in_bom" type="object"
groups="mrp.group_mrp_user"
attrs="{'invisible':['|',('type', 'not in', ['product', 'consu']), ('used_in_bom_count', '=', 0)]}" icon="fa-level-up">
<field string="Used In" name="used_in_bom_count" widget="statinfo" />
</button>
<button class="oe_stat_button" name="action_view_mos" type="object"
groups="mrp.group_mrp_user"
attrs="{'invisible': ['|', '|', ('type', 'not in', ['product', 'consu']), ('bom_count', '=', 0), ('mrp_product_qty', '=', 0)]}" icon="fa-list-alt" help="Manufactured in the last 365 days">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="mrp_product_qty" widget="statinfo" nolabel="1" class="mr4"/>
<field name="uom_name"/>
</span>
<span class="o_stat_text">Manufactured</span>
</div>
</button>
</xpath>
</field>
</record>
</data>
</odoo>

View file

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.mrp</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="35"/>
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div class="app_settings_block" data-string="Manufacturing" string="Manufacturing" data-key="mrp" groups="mrp.group_mrp_manager">
<h2>Operations</h2>
<div class="row mt16 o_settings_container" name="process_operations_setting_container">
<div class="col-lg-6 col-12 o_setting_box" id="work_order" title="Work Order Operations allow you to create and manage the manufacturing operations that should be followed within your work centers in order to produce a product. They are attached to bills of materials that will define the required components.">
<div class="o_setting_left_pane">
<field name="group_mrp_routings"/>
<field name="module_mrp_workorder" invisible="1"/>
</div>
<div class="o_setting_right_pane" id="workorder_settings">
<label for="group_mrp_routings" string="Work Orders"/>
<a href="https://www.odoo.com/documentation/16.0/applications/inventory_and_mrp/manufacturing/management/bill_configuration.html#adding-a-routing" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Process operations at specific work centers
</div>
<div id="workorder_settings_workcenters" class="content-group" attrs="{'invisible': [('group_mrp_routings','=',False)]}">
<div class="mt8">
<div>
<button name="%(mrp.mrp_workcenter_action)d" icon="fa-arrow-right" type="action" string="Work Centers" class="btn-link"/>
</div>
</div>
</div>
<div id="workorder_settings_dependencies" class="row mt-2" attrs="{'invisible': [('group_mrp_routings','=',False)]}">
<field name="group_mrp_workorder_dependencies" class="col flex-grow-0 ml16 mr0 pe-2"/>
<div class="col ps-0">
<label for="group_mrp_workorder_dependencies"/>
<div class="text-muted">
Set the order that work orders should be processed in. Activate the feature within each BoM's Miscellaneous tab
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-12 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_mrp_subcontracting"/>
</div>
<div class="o_setting_right_pane">
<label for="module_mrp_subcontracting"/>
<a href="https://www.odoo.com/documentation/16.0/applications/inventory_and_mrp/manufacturing/management/subcontracting.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Subcontract the production of some products
</div>
</div>
</div>
<div class="col-lg-6 col-12 o_setting_box" id="quality_control_mrp">
<div class="o_setting_left_pane">
<field name="module_quality_control" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label for="module_quality_control"/>
<div class="text-muted">
Add quality checks to your work orders
</div>
<div class="row mt-2" attrs="{'invisible': [('module_quality_control','=',False)]}">
<field name="module_quality_control_worksheet" widget="upgrade_boolean" class="col flex-grow-0 ml16 mr0 pe-2"/>
<div class="col ps-0">
<label for="module_quality_control_worksheet"/>
<div class="text-muted">
Create customizable worksheets for your quality checks
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-12 o_setting_box" id="mrp_lock">
<div class="o_setting_left_pane">
<field name="group_unlocked_by_default"/>
</div>
<div class="o_setting_right_pane">
<label for="group_unlocked_by_default"/>
<div class="text-muted">
Allow manufacturing users to modify quantities to consume, without the need for prior approval
</div>
</div>
</div>
<div class="col-lg-6 col-12 o_setting_box" id="mrp_byproduct" title="Add by-products to bills of materials. This can be used to get several finished products as well. Without this option you only do: A + B = C. With the option: A + B = C + D.">
<div class="o_setting_left_pane">
<field name="group_mrp_byproducts"/>
</div>
<div class="o_setting_right_pane">
<label for="group_mrp_byproducts"/>
<div class="text-muted">
Produce residual products (A + B -> C + D)
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="mrp_reception_report">
<div class="o_setting_left_pane">
<field name="group_mrp_reception_report"/>
</div>
<div class="o_setting_right_pane">
<label for="group_mrp_reception_report"/>
<div class="text-muted">
View and allocate manufactured quantities
</div>
</div>
</div>
</div>
<h2>Planning</h2>
<div class="row mt16 o_settings_container">
<div class="col-lg-6 col-12 o_setting_box" id="mrp_mps" title="Using a MPS report to schedule your reordering and manufacturing operations is useful if you have long lead time and if you produce based on sales forecasts.">
<div class="o_setting_left_pane">
<field name="module_mrp_mps" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label for="module_mrp_mps"/>
<a href="https://www.odoo.com/documentation/16.0/applications/inventory_and_mrp/manufacturing/management/use_mps.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Plan manufacturing or purchase orders based on forecasts
</div>
<div class="content-group" id="content_mrp_mps"/>
</div>
</div>
<div class="col-lg-6 col-12 o_setting_box" id="security_lead_time">
<div class="o_setting_left_pane">
<field name="use_manufacturing_lead"/>
</div>
<div class="o_setting_right_pane">
<label string="Security Lead Time" for="use_manufacturing_lead"/>
<a href="https://www.odoo.com/documentation/16.0/applications/inventory_and_mrp/inventory/management/planning/scheduled_dates.html" title="Documentation" class="me-2 o_doc_link" target="_blank"></a>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." role="img" aria-label="Values set here are company-specific." groups="base.group_multi_company"/>
<div class="text-muted">
Schedule manufacturing orders earlier to avoid delays
</div>
<div class="content-group" attrs="{'invisible': [('use_manufacturing_lead','=',False)]}">
<div class="mt16" >
<field name="manufacturing_lead" class="oe_inline"/> days
</div>
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
<record id="action_mrp_configuration" model="ir.actions.act_window">
<field name="name">Settings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config.settings</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'mrp', 'bin_size': False}</field>
</record>
<menuitem id="menu_mrp_config" name="Settings" parent="menu_mrp_configuration"
sequence="0" action="action_mrp_configuration" groups="base.group_system"/>
</data>
</odoo>

View file

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.actions.act_window" id="action_mrp_production_moves">
<field name="name">Inventory Moves</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.move.line</field>
<field name="view_mode">tree,form</field>
<field name="domain">['|', ('move_id.raw_material_production_id', '=', active_id), ('move_id.production_id', '=', active_id)]</field>
</record>
<record id="view_stock_move_operations_raw" model="ir.ui.view">
<field name="name">stock.move.operations.raw.form</field>
<field name="model">stock.move</field>
<field name="priority">1</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="stock.view_stock_move_operations" />
<field name="arch" type="xml">
<xpath expr="//label[@for='product_uom_qty']" position="attributes">
<attribute name="string">Total To Consume</attribute>
</xpath>
<xpath expr="//label[@for='quantity_done']" position="attributes">
<attribute name="string">Consumed</attribute>
</xpath>
</field>
</record>
<record id="view_stock_move_operations_finished" model="ir.ui.view">
<field name="name">stock.move.operations.finished.form</field>
<field name="model">stock.move</field>
<field name="priority">1</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="stock.view_stock_move_operations" />
<field name="arch" type="xml">
<xpath expr="//label[@for='product_uom_qty']" position="attributes">
<attribute name="string">To Produce</attribute>
</xpath>
<xpath expr="//label[@for='quantity_done']" position="attributes">
<attribute name="string">Produced</attribute>
</xpath>
</field>
</record>
<record id="view_stock_move_line_operation_tree_finished" model="ir.ui.view">
<field name="name">stock.move.line.operation.tree.finished</field>
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock.view_stock_move_line_operation_tree" />
<field name="arch" type="xml">
<xpath expr="//field[@name='lot_id']" position="attributes">
<attribute name="context">{
'active_mo_id': context.get('active_mo_id'),
'active_picking_id': picking_id,
'default_company_id': parent.company_id,
'default_product_id': parent.product_id,
}
</attribute>
</xpath>
</field>
</record>
<record id="stock_move_line_view_search" model="ir.ui.view">
<field name="name">stock.move.line.search</field>
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock.stock_move_line_view_search" />
<field name="arch" type="xml">
<filter name="manufacturing" position="attributes">
<attribute name="invisible">0</attribute>
<attribute name="domain">[('move_id.production_id', '!=', False)]</attribute>
</filter>
</field>
</record>
<menuitem id="menu_mrp_traceability"
name="Lots/Serial Numbers"
parent="menu_mrp_bom"
action="stock.action_production_lot_form"
groups="stock.group_production_lot"
sequence="15"/>
<menuitem id="menu_mrp_scrap"
name="Scrap"
parent="menu_mrp_manufacturing"
action="stock.action_stock_scrap"
sequence="25"/>
<menuitem id="menu_procurement_compute_mrp"
action="stock.action_procurement_compute"
parent="mrp_planning_menu_root"
groups="base.group_no_one"
sequence="135"/>
</odoo>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_warehouse_orderpoint_tree_editable_inherited_purchase" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.tree.editable.inherit.purchase</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="inherit_id" ref="stock.view_warehouse_orderpoint_tree_editable"/>
<field name="arch" type="xml">
<field name="route_id" position="after">
<field name="show_bom" invisible="1"/>
<field name="bom_id" optional="hide" attrs="{'invisible': [('show_bom', '=', False)]}" context="{'default_product_tmpl_id': product_tmpl_id}"/>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="stock_production_type_kanban" model="ir.ui.view">
<field name="name">stock.picking.type.kanban</field>
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.stock_picking_type_kanban"/>
<field name="arch" type="xml">
<field name="code" position="after">
<field name="count_mo_todo"/>
<field name="count_mo_waiting"/>
<field name="count_mo_late"/>
</field>
<xpath expr='//div[@name="stock_picking"]' position="after">
<div t-if="record.code.raw_value == 'mrp_operation'" t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''}">
<div>
<div t-attf-class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<div class="o_primary" t-if="!selection_mode">
<a type="object" name="get_mrp_stock_picking_action_picking_type">
<field name="name"/>
</a>
</div>
<span class="o_primary" t-if="selection_mode"><field name="name"/></span>
<div class="o_secondary"><field class="o_secondary" name="warehouse_id" readonly="1" groups="stock.group_stock_multi_warehouses"/></div>
</div>
<div class="o_kanban_manage_button_section" t-if="!selection_mode">
<a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
</div>
</div>
<div class="container o_kanban_card_content" t-if="!selection_mode">
<div class="row">
<div class="col-6 o_kanban_primary_left">
<button class="btn btn-primary" name="%(mrp_production_action_picking_deshboard)d" type="action" context="{'search_default_todo': 1, 'default_picking_type_id': active_id}">
<span t-if="record.code.raw_value =='mrp_operation'"><t t-esc="record.count_mo_todo.value"/> To Process</span>
</button>
</div>
<div class="col-6 o_kanban_primary_right">
<div t-if="record.count_mo_waiting.raw_value > 0" class="row">
<div class="col-9">
<a name="%(mrp_production_action_picking_deshboard)d" type="action" context="{'search_default_waiting': 1}">
Waiting
</a>
</div>
<div class="col-3">
<field name="count_mo_waiting"/>
</div>
</div>
<div t-if="record.count_mo_late.raw_value > 0" class="row">
<div class="col-9">
<a class="oe_kanban_stock_picking_type_list" name="%(mrp_production_action_picking_deshboard)d" type="action" context="{'search_default_planning_issues': 1, 'default_picking_type_id': active_id}">
Late
</a>
</div>
<div class="col-3">
<field name="count_mo_late"/>
</div>
</div>
</div>
</div>
</div><div class="container o_kanban_card_manage_pane dropdown-menu" role="menu">
<div class="row">
<div class="col-6 o_kanban_card_manage_section o_kanban_manage_view" name="picking_left_manage_pane">
<div role="menuitem" class="o_kanban_card_manage_title">
<span>Orders</span>
</div>
<div role="menuitem">
<a name="%(mrp_production_action_picking_deshboard)d" type="action">All</a>
</div>
<div role="menuitem">
<a name="%(mrp_production_action_picking_deshboard)d" type="action" context="{'search_default_inprogress': 1}">In Progress</a>
</div>
<div role="menuitem">
<a name="%(mrp_production_action_picking_deshboard)d" type="action" context="{'search_default_planned': 1}">Planned</a>
</div>
</div>
<div class="col-6 o_kanban_card_manage_section o_kanban_manage_new">
<div role="menuitem" class="o_kanban_card_manage_title">
<span>New</span>
</div>
<div role="menuitem">
<a name="%(action_mrp_production_form)d" context="{'default_picking_type_id': active_id}" type="action">Manufacturing Order</a>
</div>
</div>
</div>
<div t-if="widget.editable" class="o_kanban_card_manage_settings row">
<div role="menuitem" aria-haspopup="true" class="col-8">
<ul role="menu" class="oe_kanban_colorpicker" data-field="color"/>
</div>
<div class="col-4">
<a class="dropdown-item" role="menuitem" type="edit">Configuration</a>
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
<record id="view_picking_form_inherit_mrp" model="ir.ui.view">
<field name="name">view.picking.form.inherit.mrp</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='use_create_lots']" position="after">
<field name="has_kits" invisible="1"/>
</xpath>
<xpath expr="//field[@name='description_picking']" position="after">
<field name="description_bom_line" optional="show" attrs="{'column_invisible': [('parent.has_kits', '=', False)]}"/>
</xpath>
</field>
</record>
<record id="view_stock_move_line_detailed_operation_tree_mrp" model="ir.ui.view">
<field name="name">stock.move.line.operations.tree.mrp</field>
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="description_bom_line" optional="show" attrs="{'column_invisible': [('parent.has_kits', '=', False)]}"/>
</xpath>
</field>
</record>
<record id="view_picking_type_form_inherit_mrp" model="ir.ui.view">
<field name="name">Operation Types</field>
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_form"/>
<field name="arch" type="xml">
<field name="show_operations" position="attributes">
<attribute name="attrs">{"invisible": [("code", "=", "mrp_operation")]}</attribute>
</field>
<field name="create_backorder" position="attributes">
<attribute name="attrs">{"invisible": [("code", "=", "mrp_operation")]}</attribute>
</field>
<xpath expr="//group[@name='stock_picking_type_lot']" position="after">
<group attrs='{"invisible": [("code", "!=", "mrp_operation")]}' string="Traceability" groups="stock.group_production_lot">
<field name="use_create_components_lots"/>
<field name="use_auto_consume_components_lots"/>
</group>
</xpath>
<field name="auto_show_reception_report" position="after">
<field name="auto_show_reception_report" attrs="{'invisible': [('code', '!=', 'mrp_operation')]}" groups="mrp.group_mrp_reception_report"/>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="stock_scrap_view_form2_mrp_inherit_mrp" model="ir.ui.view">
<field name="name">stock.scrap.view.form2.inherit.mrp</field>
<field name="model">stock.scrap</field>
<field name="inherit_id" ref="stock.stock_scrap_form_view2"/>
<field name="arch" type="xml">
<field name="owner_id" position="after">
<field name="workorder_id" invisible="1"/>
<field name="production_id" invisible="1"/>
</field>
</field>
</record>
<record id="stock_scrap_view_form_mrp_inherit_mrp" model="ir.ui.view">
<field name="name">stock.scrap.view.form.inherit.mrp</field>
<field name="model">stock.scrap</field>
<field name="inherit_id" ref="stock.stock_scrap_form_view"/>
<field name="arch" type="xml">
<field name="owner_id" position="after">
<field name="workorder_id" domain="[('production_id', '=', product_id)]" attrs="{'invisible': [('workorder_id', '=', False)]}"/>
<field name="production_id" domain="[('company_id', '=', company_id)]" attrs="{'invisible': [('production_id', '=', False)]}"/>
</field>
</field>
</record>
<record id="stock_scrap_search_view_inherit_mrp" model="ir.ui.view">
<field name="name">stock.scrap.search.inherit.mrp</field>
<field name="model">stock.scrap</field>
<field name="inherit_id" ref="stock.stock_scrap_search_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='transfer']" position="after">
<filter string="Manufacturing Order" name="production_id" domain="[]" context="{'group_by':'production_id'}"/>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Warehouse -->
<record id="view_warehouse_inherit_mrp" model="ir.ui.view">
<field name="name">Stock Warehouse Inherit MRP</field>
<field name="model">stock.warehouse</field>
<field name="inherit_id" ref="stock.view_warehouse"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='resupply_wh_ids']" position="before">
<field name="manufacture_to_resupply"/>
<field name="manufacture_steps" attrs="{'invisible': [('manufacture_to_resupply', '=', False)]}" widget="radio" groups="stock.group_adv_location"/>
</xpath>
<xpath expr="//field[@name='out_type_id']" position="after">
<field name="manu_type_id" readonly="True"/>
</xpath>
<xpath expr="//group[@name='group_resupply']" position="attributes">
<attribute name="groups">stock.group_adv_location,stock.group_stock_multi_warehouses</attribute>
</xpath>
<xpath expr="//field[@name='wh_output_stock_loc_id']" position="after">
<field name="sam_loc_id" readonly="True"/>
<field name="pbm_loc_id" readonly="True"/>
</xpath>
<xpath expr="//field[@name='out_type_id']" position="after">
<field name="sam_type_id" readonly="True"/>
<field name="pbm_type_id" readonly="True"/>
</xpath>
</field>
</record>
</odoo>