mirror of
https://github.com/bringout/oca-ocb-mrp.git
synced 2026-04-24 19:31:59 +02:00
Initial commit: Mrp packages
This commit is contained in:
commit
50d736b3bd
739 changed files with 538193 additions and 0 deletions
|
|
@ -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>
|
||||
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<?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="//div[hasclass('oe_title')]" 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="//label[@name='bom_label']" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='bom_div']" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='move_byproduct_ids']" position="replace"/>
|
||||
<xpath expr="//field[@name='workorder_ids']" position="replace"/>
|
||||
<xpath expr="//button[@name='action_generate_serial']" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='move_finished_ids']" position="replace"/>
|
||||
<xpath expr="//field[@name='move_raw_ids']" position="replace">
|
||||
<field name="bom_product_ids" invisible="1"/>
|
||||
<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, 'bom_product_ids': bom_product_ids}"
|
||||
/>
|
||||
</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" data-hotkey="q"/>
|
||||
<button name="subcontracting_record_component" attrs="{'invisible': [('state', '!=', 'to_close')]}" string="Record Production" type="object" class="oe_highlight" data-hotkey="q"/>
|
||||
<button string="Discard" special="cancel" data-hotkey="z" />
|
||||
</footer>
|
||||
</xpath>
|
||||
<xpath expr="//div[hasclass('oe_chatter')]" position="replace"/>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_production_subcontracting_portal_form_view" model="ir.ui.view">
|
||||
<field name="name">mrp.production.subcontracting.portal.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_production_subcontracting_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_id']" position="attributes">
|
||||
<attribute name="options">{'no_create_edit': True, 'no_open': True}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='product_qty']" position="attributes">
|
||||
<attribute name="attrs">{'readonly': True}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='lot_producing_id']" position="attributes">
|
||||
<attribute name="domain">[('id', '=', False)]</attribute>
|
||||
<attribute name="options">{'no_create_edit': True, 'no_open': True}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='move_line_raw_ids']" position="attributes">
|
||||
<attribute name="context">{'tree_view_ref': 'mrp_subcontracting.mrp_subcontracting_portal_stock_move_line_tree_view', 'default_company_id': company_id, 'default_location_id': location_src_id, 'default_location_dest_id': production_location_id, 'bom_product_ids': bom_product_ids}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='forecasted_issue']" position="replace"/>
|
||||
<xpath expr="//button[@name='%(mrp.action_change_production_qty)d']" position="replace"/>
|
||||
<xpath expr="//button[@name='action_product_forecast_report']" position="replace"/>
|
||||
<xpath expr="//button[@name='action_product_forecast_report']" position="replace"/>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_production_subcontracting_tree_view" model="ir.ui.view">
|
||||
<field name="name">mrp.production.subcontracting.tree</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_tree_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='name']" position="after">
|
||||
<field name="incoming_picking"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_production_subcontracting_filter" model="ir.ui.view">
|
||||
<field name="name">mrp.production.subcontracting.select</field>
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="inherit_id" ref="mrp.view_mrp_production_filter" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='name']" position="after">
|
||||
<field name="name" string="Incoming transfer" filter_domain="[('incoming_picking.name', 'ilike', self)]"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?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="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')]" groups="mrp.group_mrp_user"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
|
|
@ -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="arch" type="xml">
|
||||
<xpath expr="//filter[@name='inactive']" position="before">
|
||||
<filter string="Subcontractors" name="type_subcontractors" domain="[('is_subcontractor', '=', True)]" groups="mrp.group_mrp_user"/>
|
||||
<separator groups="mrp.group_mrp_user"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_location_form" model="ir.ui.view">
|
||||
<field name="name">stock.location.form</field>
|
||||
<field name="model">stock.location</field>
|
||||
<field name="inherit_id" ref="stock.view_location_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='return_location']" position='after'>
|
||||
<field name="is_subcontracting_location" groups="base.group_no_one" attrs="{'invisible': [('usage', '!=', 'internal')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
<?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" domain="[('id', 'in', context.get('bom_product_ids'))] if context.get('is_subcontracting_portal') else []"/>
|
||||
<field name="lot_id" groups="stock.group_production_lot"
|
||||
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="reserved_uom_qty" readonly="1" force_save="1"/>
|
||||
<field name="qty_done"
|
||||
decoration-warning="reserved_uom_qty < qty_done"
|
||||
decoration-success="reserved_uom_qty == qty_done"/>
|
||||
<field name="product_uom_id" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"
|
||||
attrs="{'readonly': ['|', ('reserved_uom_qty', '!=', 0.0), '&', ('state', '=', 'done'), ('id', '!=', False)]}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="mrp_subcontracting_portal_stock_move_line_tree_view" model="ir.ui.view">
|
||||
<field name="name">mrp.subcontracting.portal.stock.move.line.tree.view</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="inherit_id" ref="mrp_subcontracting_stock_move_line_tree_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='lot_id']" position="attributes">
|
||||
<attribute name="options">{'no_create_edit': True, 'no_open': True}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='product_id']" position="attributes">
|
||||
<attribute name="options">{'no_open': True}</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="mrp_subcontracting_view_stock_move_line_operation_tree" model="ir.ui.view">
|
||||
<field name="name">mrp.subcontracting.stock.move.line.operations.tree</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="priority">1000</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="options">{'no_create_edit': True, 'no_open': True}</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="mrp_subcontracting_view_stock_move_operations" model="ir.ui.view">
|
||||
<field name="name">mrp.subcontracting.stock.move.operations.form</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_operations" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='move_line_ids']" position="attributes">
|
||||
<attribute name="context">{'tree_view_ref': 'mrp_subcontracting.mrp_subcontracting_view_stock_move_line_operation_tree', '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}</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="mrp_subcontracting_view_stock_move_nosuggest_operations" model="ir.ui.view">
|
||||
<field name="name">mrp.subcontracting.stock.move.operations.nosuggest.form</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_nosuggest_operations" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='move_line_nosuggest_ids']" position="attributes">
|
||||
<attribute name="context">{'tree_view_ref': 'mrp_subcontracting.mrp_subcontracting_view_stock_move_line_operation_tree','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}</attribute>
|
||||
</xpath>
|
||||
</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" invisible="1"/>
|
||||
<field name="product_uom_qty" invisible="1"/>
|
||||
<group>
|
||||
<field name="order_finished_lot_id"/>
|
||||
<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}" groups="stock.group_production_lot"/>
|
||||
</tree>
|
||||
</field>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="mrp_subcontracting_portal_move_form_view" model="ir.ui.view">
|
||||
<field name="name">mrp.subcontracting.portal.move.form.view</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="inherit_id" ref="mrp_subcontracting_move_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='order_finished_lot_id']" position="attributes">
|
||||
<attribute name="options">{'no_open': True}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//tree" position="attributes">
|
||||
<attribute name="no_open">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//tree/field[@name='lot_id']" position="attributes">
|
||||
<attribute name="options">{'no_create_edit': True, 'no_open': True}</attribute>
|
||||
</xpath>
|
||||
</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" js_class="subcontracting_portal_move_list_view">
|
||||
<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_id"/>
|
||||
<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>
|
||||
<record id="view_move_search" model="ir.ui.view">
|
||||
<field name="name">stock.move.search</field>
|
||||
<field name="model">stock.move</field>
|
||||
<field name="inherit_id" ref="stock.view_move_search" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='partner_id']" position="after">
|
||||
<field name="order_finished_lot_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?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', '!=', 'mandatory')]}" string="Record components" type="object" data-hotkey="shift+x"/>
|
||||
<button name="action_record_components" attrs="{'invisible': [('display_action_record_components', '!=', 'facultative')]}" string="Record components" type="object" data-hotkey="shift+x"/>
|
||||
</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>
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="quant_subcontracting_search_view" model="ir.ui.view">
|
||||
<field name="name">stock.quant.subcontracting.search</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.quant_search_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//filter[@name='transit_loc']" position="after">
|
||||
<filter string="Subcontracting Locations" name="is_subcontract" domain="[('is_subcontract', '=', True)]" groups="mrp.group_mrp_user"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="portal_my_home_productions" name="Productions" customize_show="True" inherit_id="portal.portal_my_home" priority="20">
|
||||
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
|
||||
<t t-call="portal.portal_docs_entry">
|
||||
<t t-set="title">Productions</t>
|
||||
<t t-set="url" t-value="'/my/productions'"/>
|
||||
<t t-set="placeholder_count" t-value="'production_count'"/>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="portal_my_home_menu_production" name="Portal layout : production menu entries" inherit_id="portal.portal_breadcrumbs" priority="25">
|
||||
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
|
||||
<li t-if="page_name == 'production' or production" t-attf-class="breadcrumb-item #{'active' if not pickings else ''}">
|
||||
<t>Productions</t>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="portal_my_productions" name="My Productions">
|
||||
<t t-call="portal.portal_layout">
|
||||
<t t-set="breadcrumbs_searchbar" t-value="True"/>
|
||||
|
||||
<t t-call="portal.portal_searchbar">
|
||||
<t t-set="title">Productions</t>
|
||||
</t>
|
||||
|
||||
<t t-if="not pickings">
|
||||
<p>There are currently no productions for your account.</p>
|
||||
</t>
|
||||
|
||||
<t t-if="pickings" t-call="portal.portal_table">
|
||||
<thead>
|
||||
<tr class="active">
|
||||
<th>Order</th>
|
||||
<th class="text-end">Source Document</th>
|
||||
<th class="text-end">Scheduled Date</th>
|
||||
<th class="text-end">Deadline Date</th>
|
||||
<th class="text-end">State</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<t t-foreach="pickings" t-as="picking">
|
||||
<tr>
|
||||
<td><a t-attf-href="/my/productions/#{picking.id}?{{ keep_query() }}"><span t-field="picking.name"/></a></td>
|
||||
<td class="text-end"><span t-field="picking.origin"/></td>
|
||||
<td class="text-end"><span t-field="picking.scheduled_date" t-options='{"widget": "date"}'/></td>
|
||||
<td class="text-end"><span t-field="picking.date_deadline" t-options='{"widget": "date"}'/></td>
|
||||
<td class="text-end"><span t-field="picking.state"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="subcontracting_portal" name="Subcontracting View in Portal">
|
||||
<t t-call="portal.frontend_layout">
|
||||
<t t-set="no_footer" t-value="true"/>
|
||||
<t t-call="mrp_subcontracting.subcontracting"/>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="subcontracting" name="Subcontracting Portal View">
|
||||
<iframe width="100%" height="100%" frameborder="0" t-attf-src="/my/productions/{{ picking_id }}/subcontracting_portal"/>
|
||||
</template>
|
||||
|
||||
<template id="subcontracting_portal_embed" name="Subcontracting Portal">
|
||||
<t t-call="web.layout">
|
||||
<t t-set="head_subcontracting_portal">
|
||||
<script type="text/javascript">
|
||||
odoo.__session_info__ = <t t-out="json.dumps(session_info)"/>;
|
||||
</script>
|
||||
<base target="_parent"/>
|
||||
<t t-call-assets="web.assets_common" t-js="false"/>
|
||||
<t t-call-assets="web.assets_backend" t-js="false"/>
|
||||
<t t-call-assets="web.assets_common" t-css="false"/>
|
||||
<t t-call-assets="mrp_subcontracting.webclient" t-css="false"/>
|
||||
<t t-call="web.conditional_assets_tests"/>
|
||||
</t>
|
||||
<t t-set="head" t-value="head_subcontracting_portal + (head or '')"/>
|
||||
<t t-set="body_classname" t-value="'o_web_client o_subcontracting_portal'"/>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="subcontracting_portal_production_form_view" model="ir.ui.view">
|
||||
<field name="name">subcontracting.portal.production.view.form</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="priority">999</field>
|
||||
<field name="arch" type="xml">
|
||||
<form js_class="subcontracting_portal_picking_form_view" string="Manufacturing Orders">
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name" placeholder="Manufacturing Reference" nolabel="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<field name="state" invisible='1'/>
|
||||
<field name="scheduled_date" attrs="{'required': [('id', '!=', False)]}" decoration-warning="state not in ('done', 'cancel') and scheduled_date < now" decoration-danger="state not in ('done', 'cancel') and scheduled_date < current_date" decoration-bf="state not in ('done', 'cancel') and (scheduled_date < current_date or scheduled_date < now)"/>
|
||||
<field name="date_deadline" attrs="{'invisible': ['|', ('state', 'in', ('done', 'cancel')), ('date_deadline', '=', False)]}" decoration-danger="date_deadline and date_deadline < current_date" decoration-bf="date_deadline and date_deadline < current_date"/>
|
||||
<field name="origin" placeholder="e.g. PO0032"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Operations" name="operations">
|
||||
<field name="move_ids_without_package" mode="tree">
|
||||
<tree no_open="1">
|
||||
<field name="id" readonly="1" invisible="1"/>
|
||||
<field name="product_id" readonly="1"/>
|
||||
<field name="show_details_visible" invisible="1"/>
|
||||
<field name="description_picking" string="Description" optional="hide"/>
|
||||
<field name="date" optional="hide"/>
|
||||
<field name="date_deadline" optional="hide"/>
|
||||
<field name="product_packaging_id" groups="product.group_stock_packaging"/>
|
||||
<field name="product_uom_qty" string="Demand" readonly="1"/>
|
||||
<field name="product_qty" invisible="1" readonly="1"/>
|
||||
<field name="quantity_done" string="Done"/>
|
||||
<field name="product_uom" groups="uom.group_uom"/>
|
||||
<button name="action_show_details" type="object" icon="fa-list" width="0.1" title="Details"
|
||||
attrs="{'invisible': [('show_details_visible', '=', False)]}" context="{'is_subcontracting_portal': 1}"/>
|
||||
<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)]}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="subcontracting_portal_view_production_action" model="ir.actions.act_window">
|
||||
<field name="name">Subcontracting Portal</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="subcontracting_portal_production_form_view"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -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='partner_id']" position="after">
|
||||
<field name="is_subcontractor" readonly="1" optional="hide"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue