diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/mrp_subcontracting/views | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/mrp_subcontracting/views')
8 files changed, 268 insertions, 0 deletions
diff --git a/addons/mrp_subcontracting/views/mrp_bom_views.xml b/addons/mrp_subcontracting/views/mrp_bom_views.xml new file mode 100644 index 00000000..dacf4362 --- /dev/null +++ b/addons/mrp_subcontracting/views/mrp_bom_views.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="mrp_bom_form_view" model="ir.ui.view"> + <field name="name">mrp.bom.form.view</field> + <field name="model">mrp.bom</field> + <field name="inherit_id" ref="mrp.mrp_bom_form_view" /> + <field name="arch" type="xml"> + <xpath expr="//field[@name='type']" position="after"> + <field name="subcontractor_ids" widget="many2many_tags" attrs="{'invisible': [('type', '!=', 'subcontract')], 'required': [('type', '=', 'subcontract')]}"/> + </xpath> + </field> + </record> +</odoo> + diff --git a/addons/mrp_subcontracting/views/mrp_production_views.xml b/addons/mrp_subcontracting/views/mrp_production_views.xml new file mode 100644 index 00000000..6284ae85 --- /dev/null +++ b/addons/mrp_subcontracting/views/mrp_production_views.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="mrp_production_subcontracting_form_view" model="ir.ui.view"> + <field name="name">mrp.production.subcontracting.form.view</field> + <field name="model">mrp.production</field> + <field name="mode">primary</field> + <field name="priority">1000</field> + <field name="inherit_id" ref="mrp.mrp_production_form_view" /> + <field name="arch" type="xml"> + <xpath expr="//header" position="replace"> + <field name="state" invisible="1"/> + </xpath> + <xpath expr="//div[@name='button_box']" position="replace"/> + <xpath expr="//group[@name='group_extra_info']" position="attributes"> + <attribute name="invisible">1</attribute> + </xpath> + <xpath expr="//page[@name='operations']" position="attributes"> + <attribute name="invisible">1</attribute> + </xpath> + <xpath expr="//field[@name='lot_producing_id']" position="attributes"> + <attribute name="attrs">{'invisible': [('product_tracking', 'in', ('none', False))], 'required': [('product_tracking', 'not in', ('none', False))]}</attribute> + </xpath> + <xpath expr="//page[@name='miscellaneous']" position="attributes"> + <attribute name="invisible">1</attribute> + </xpath> + <xpath expr="//field[@name='name']" position="attributes"> + <attribute name="invisible">1</attribute> + </xpath> + <xpath expr="//field[@name='priority']" position="attributes"> + <attribute name="invisible">1</attribute> + </xpath> + <xpath expr="//field[@name='bom_id']" position="attributes"> + <attribute name="invisible">1</attribute> + </xpath> + <xpath expr="//button[@name='action_generate_serial']" position="attributes"> + <attribute name="invisible">1</attribute> + </xpath> + <xpath expr="//field[@name='move_raw_ids']" position="attributes"> + <attribute name="invisible">1</attribute> + <attribute name="readonly">1</attribute> + </xpath> + <xpath expr="//field[@name='move_raw_ids']" position="after"> + <field name="move_line_raw_ids" force_save="1" + context="{'tree_view_ref': 'mrp_subcontracting.mrp_subcontracting_stock_move_line_tree_view', 'default_company_id': company_id, 'default_location_id': location_src_id, 'default_location_dest_id': production_location_id}" + /> + </xpath> + <xpath expr="//sheet" position="inside"> + <footer> + <button name="subcontracting_record_component" attrs="{'invisible': ['|', ('state', '=', 'to_close'), ('qty_producing', '<', 0.001)]}" string="Continue" type="object" class="oe_highlight"/> + <button name="subcontracting_record_component" attrs="{'invisible': [('state', '!=', 'to_close')]}" string="Record Production" type="object" class="oe_highlight"/> + <button string="Discard" special="cancel" /> + </footer> + </xpath> + </field> + </record> +</odoo> + diff --git a/addons/mrp_subcontracting/views/product_views.xml b/addons/mrp_subcontracting/views/product_views.xml new file mode 100644 index 00000000..6ef4b321 --- /dev/null +++ b/addons/mrp_subcontracting/views/product_views.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + <record id="mrp_subcontracting_product_template_search_view" model="ir.ui.view"> + <field name="name">mrp.subcontracting.product.template.search</field> + <field name="model">product.template</field> + <field name="inherit_id" ref="product.product_template_search_view" /> + <field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]"/> + <field name="arch" type="xml"> + <xpath expr="//filter[@name='filter_to_purchase']" position="after"> + <filter string="Can be Subcontracted" name="filter_can_be_subcontracted" domain="[('bom_ids.type', '=', 'subcontract')]" /> + </xpath> + </field> + </record> + </data> +</odoo> + diff --git a/addons/mrp_subcontracting/views/res_partner_views.xml b/addons/mrp_subcontracting/views/res_partner_views.xml new file mode 100644 index 00000000..5b1b95e9 --- /dev/null +++ b/addons/mrp_subcontracting/views/res_partner_views.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="view_partner_mrp_subcontracting_form" model="ir.ui.view"> + <field name="name">res.partner.mrp_subcontracting.property.form.inherit</field> + <field name="model">res.partner</field> + <field name="inherit_id" ref="stock.view_partner_stock_form"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='property_stock_supplier']" position="after"> + <field name="property_stock_subcontractor"/> + <separator/> + </xpath> + </field> + </record> + <record id="view_partner_mrp_subcontracting_filter" model="ir.ui.view"> + <field name="name">res.partner.select.inherit</field> + <field name="model">res.partner</field> + <field name="inherit_id" ref="base.view_res_partner_filter" /> + <field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]"/> + <field name="arch" type="xml"> + <xpath expr="//filter[@name='inactive']" position="before"> + <filter string="Subcontractors" name="type_subcontractors" domain="[('is_subcontractor', '=', True)]" /> + </xpath> + </field> + </record> +</odoo> diff --git a/addons/mrp_subcontracting/views/stock_move_views.xml b/addons/mrp_subcontracting/views/stock_move_views.xml new file mode 100644 index 00000000..e5019810 --- /dev/null +++ b/addons/mrp_subcontracting/views/stock_move_views.xml @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="mrp_subcontracting_stock_move_line_tree_view" model="ir.ui.view"> + <field name="name">mrp.subcontracting.stock.move.line.tree.view</field> + <field name="model">stock.move.line</field> + <field name="priority">1000</field> + <field name="arch" type="xml"> + <tree editable="bottom"> + <field name="company_id" invisible="1"/> + <field name="product_uom_category_id" invisible="1"/> + <field name="owner_id" invisible="1"/> + <field name="tracking" invisible="1"/> + <field name="package_id" invisible="1"/> + <field name="result_package_id" invisible="1"/> + <field name="location_id" invisible="1"/> + <field name="location_dest_id" invisible="1"/> + <field name="state" invisible="1"/> + <!-- Don't put move_id here to avoid that the framework send falsy move_id --> + <field name="id" invisible="1"/> + <field name="product_id" required="1"/> + <field name="lot_id" + attrs="{'invisible': [('tracking', 'not in', ('serial', 'lot'))], 'required': [('tracking', 'in', ('serial', 'lot'))]}" + context="{'default_product_id': product_id, 'default_company_id': company_id}"/> + <field name="product_uom_qty" readonly="1" force_save="1"/> + <field name="qty_done"/> + <field name="product_uom_id" groups="uom.group_uom"/> + </tree> + </field> + </record> + <record id="mrp_subcontracting_move_form_view" model="ir.ui.view"> + <field name="name">mrp.subcontracting.move.form.view</field> + <field name="model">stock.move</field> + <field name="priority">1000</field> + <field name="arch" type="xml"> + <form create="0" delete="0"> + <header> + <field name="state" widget="statusbar"/> + </header> + <sheet> + <field name="product_uom_category_id" invisible="1"/> + <field name="company_id" invisible="1"/> + <field name="product_id" invisible="1"/> + <field name="sequence" invisible="1"/> + <field name="location_id" invisible="1"/> + <field name="picking_id" invisible="1"/> + <field name="location_dest_id" invisible="1"/> + <field name="has_tracking" invisible="1"/> + <field name="product_uom_qty" invisible="1"/> + <group> + <field name="order_finished_lot_ids" widget="many2many_tags"/> + <field name="product_uom" groups="uom.group_uom"/> + <field name="quantity_done" string="Total Consumed" readonly="1"/> + </group> + <field name="move_line_ids" + attrs="{'readonly': [('state', 'in', ['done', 'cancel'])]}" + context="{'default_product_uom_id': product_uom, 'default_picking_id': picking_id, 'default_move_id': id, 'default_product_id': product_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_company_id': company_id}"> + <tree editable="bottom" decoration-muted="state in ('done', 'cancel')"> + <field name="company_id" invisible="1"/> + <field name="state" invisible="1"/> + <field name="tracking" invisible="1"/> + <field name="product_uom_id" invisible="1"/> + <field name="product_uom_category_id" invisible="1"/> + <field name="picking_id" invisible="1"/> + <field name="move_id" invisible="1"/> + <field name="location_id" invisible="1"/> + <field name="location_dest_id" invisible="1"/> + <field name="product_id" readonly="1" force_save="1"/> + <field name="qty_done"/> + <field name="lot_id" attrs="{'column_invisible':[('parent.has_tracking', 'not in', ('serial', 'lot'))], 'required': [('tracking', 'in', ('serial', 'lot'))]}" context="{'default_product_id': product_id, 'default_company_id': company_id}"/> + </tree> + </field> + </sheet> + </form> + </field> + </record> + <record id="mrp_subcontracting_move_tree_view" model="ir.ui.view"> + <field name="name">mrp.subcontracting.move.tree.view</field> + <field name="model">stock.move</field> + <field name="priority">1000</field> + <field name="arch" type="xml"> + <tree delete="0" create="0" decoration-muted="is_done" decoration-warning="quantity_done - product_uom_qty > 0.0001" decoration-success="not is_done and quantity_done - product_uom_qty < 0.0001"> + <field name="company_id" invisible="1"/> + <field name="sequence" invisible="1"/> + <field name="product_uom_category_id" invisible="1"/> + <field name="name" invisible="1"/> + <field name="unit_factor" invisible="1"/> + <field name="date" 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="location_id" invisible="1"/> + <field name="warehouse_id" invisible="1"/> + <field name="product_uom_qty" invisible="1"/> + <field name="location_dest_id" invisible="1"/> + <field name="state" invisible="1" force_save="1"/> + <field name="raw_material_production_id" invisible="1"/> + <field name="product_id" required="1"/> + <field name="order_finished_lot_ids" widget="many2many_tags"/> + <field name="reserved_availability" attrs="{'invisible': [('is_done', '=', True)]}" string="Reserved"/> + <field name="quantity_done" string="Consumed" readonly="1"/> + <field name="product_uom" groups="uom.group_uom"/> + </tree> + </field> + </record> +</odoo> diff --git a/addons/mrp_subcontracting/views/stock_picking_views.xml b/addons/mrp_subcontracting/views/stock_picking_views.xml new file mode 100644 index 00000000..f035da8f --- /dev/null +++ b/addons/mrp_subcontracting/views/stock_picking_views.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="stock_picking_form_view" model="ir.ui.view"> + <field name="name">stock.picking.form.view</field> + <field name="model">stock.picking</field> + <field name="inherit_id" ref="stock.view_picking_form" /> + <field name="arch" type="xml"> + <xpath expr="//button[@name='button_validate'][hasclass('o_btn_validate')]" position="before"> + <field name="display_action_record_components" invisible="1" /> + <button name="action_record_components" class="oe_highlight" attrs="{'invisible': [('display_action_record_components', '=', False)]}" string="Record components" type="object"/> + </xpath> + <xpath expr="//field[@name='move_ids_without_package']//tree//button[@name='action_show_details']" position="after"> + <field name="show_subcontracting_details_visible" invisible="1"/> + <button name="action_show_subcontract_details" string="Register components for subcontracted product" type="object" icon="fa-sitemap" + width="0.1" attrs="{'invisible': [('show_subcontracting_details_visible', '=', False)]}"/> + </xpath> + </field> + </record> +</odoo> + diff --git a/addons/mrp_subcontracting/views/stock_warehouse_views.xml b/addons/mrp_subcontracting/views/stock_warehouse_views.xml new file mode 100644 index 00000000..a2428f64 --- /dev/null +++ b/addons/mrp_subcontracting/views/stock_warehouse_views.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="view_warehouse_inherit_mrp_subcontracting" model="ir.ui.view"> + <field name="name">Stock Warehouse Inherit Subcontracting</field> + <field name="model">stock.warehouse</field> + <field name="inherit_id" ref="mrp.view_warehouse_inherit_mrp"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='manufacture_to_resupply']" position="before"> + <field name="subcontracting_to_resupply" /> + </xpath> + </field> + </record> +</odoo> diff --git a/addons/mrp_subcontracting/views/supplier_info_views.xml b/addons/mrp_subcontracting/views/supplier_info_views.xml new file mode 100644 index 00000000..796f4a41 --- /dev/null +++ b/addons/mrp_subcontracting/views/supplier_info_views.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="product_supplierinfo_subcontractor_tree_view" model="ir.ui.view"> + <field name="name">product.supplierinfo.subcontractor.tree.view</field> + <field name="model">product.supplierinfo</field> + <field name="inherit_id" ref="product.product_supplierinfo_tree_view"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='name']" position="after"> + <field name="is_subcontractor" readonly="1"/> + </xpath> + </field> + </record> +</odoo> + |
