mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
Merge pull request #197 from oihane/8.0-mrp_sale_info
[IMP] mrp_sale_info: add sale line to MO and WO
This commit is contained in:
@@ -10,9 +10,15 @@ This module extends the functionality of *sale_mrp*.
|
||||
|
||||
* Add fields to Manufacturing Orders and Work Orders:
|
||||
* Sale order
|
||||
* Sale line
|
||||
* Customer
|
||||
* Commitment Date
|
||||
|
||||
Also add in search view "Group by" to Manufacturing Orders and Work Orders:
|
||||
|
||||
* Customer
|
||||
* Sale order
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
@@ -48,9 +54,10 @@ Contributors
|
||||
* Rafael Blasco <rafabn@antiun.com>
|
||||
* Antonio Espinosa <antonioea@antiun.com>
|
||||
* Javier Iniesta <javieria@antiun.com>
|
||||
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>",
|
||||
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
|
||||
* Ana Juaristi <ajuaristio@gmail.com>"
|
||||
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
|
||||
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
|
||||
* Ana Juaristi <ajuaristio@gmail.com>
|
||||
* Victor M. Martin <victor.martin@elico-corp.com>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
@@ -9,8 +9,12 @@ class MrpProduction(models.Model):
|
||||
_inherit = "mrp.production"
|
||||
|
||||
sale_id = fields.Many2one(
|
||||
'sale.order', string='Sale order', readonly=True, store=True,
|
||||
comodel_name='sale.order', string='Sale order',
|
||||
readonly=True, store=True,
|
||||
related='move_prod_id.procurement_id.sale_line_id.order_id')
|
||||
sale_line_id = fields.Many2one(
|
||||
comodel_name='sale.order.line', string='Sale Line',
|
||||
related='move_prod_id.procurement_id.sale_line_id')
|
||||
partner_id = fields.Many2one(related='sale_id.partner_id',
|
||||
string='Customer', store=True)
|
||||
commitment_date = fields.Datetime(related='sale_id.commitment_date',
|
||||
|
||||
@@ -10,6 +10,9 @@ class MrpProductionWorkcenterLine(models.Model):
|
||||
|
||||
sale_id = fields.Many2one(related='production_id.sale_id',
|
||||
string='Sale order', readonly=True, store=True)
|
||||
sale_line_id = fields.Many2one(
|
||||
comodel_name='sale.order.line', string='Sale Line',
|
||||
related='production_id.sale_line_id')
|
||||
partner_id = fields.Many2one(related='sale_id.partner_id', readonly=True,
|
||||
string='Customer', store=True)
|
||||
commitment_date = fields.Datetime(related='sale_id.commitment_date',
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="sale_name" position="after">
|
||||
<field name="sale_id"/>
|
||||
<field name="sale_line_id" />
|
||||
<field name="partner_id"/>
|
||||
<field name="commitment_date"/>
|
||||
</field>
|
||||
@@ -22,11 +23,30 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="date_planned" position="after">
|
||||
<field name="sale_id"/>
|
||||
<field name="sale_line_id" />
|
||||
<field name="partner_id"/>
|
||||
<field name="commitment_date"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_production_sale_info_search_view" model="ir.ui.view">
|
||||
<field name="name">MRP Production search with Customer and Sale Order</field>
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.view_mrp_production_filter" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<field name="partner_id" />
|
||||
<field name="sale_id" />
|
||||
</field>
|
||||
<group position="inside">
|
||||
<filter string="Customer" icon="terp-accessories-archiver"
|
||||
domain="[]" context="{'group_by':'partner_id'}" />
|
||||
<filter string="Sale Order" icon="terp-accessories-archiver"
|
||||
domain="[]" context="{'group_by':'sale_id'}" />
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="date_planned" position="after">
|
||||
<field name="sale_id"/>
|
||||
<field name="sale_line_id" />
|
||||
<field name="partner_id"/>
|
||||
<field name="commitment_date"/>
|
||||
</field>
|
||||
@@ -23,6 +24,7 @@
|
||||
<group string="Product to Produce" position="after">
|
||||
<group string="Sale Information">
|
||||
<field name="sale_id"/>
|
||||
<field name="sale_line_id" />
|
||||
<field name="partner_id"/>
|
||||
<field name="commitment_date"/>
|
||||
</group>
|
||||
@@ -30,5 +32,23 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_mrp_production_workcenter_form_view_filter" model="ir.ui.view">
|
||||
<field name="name">MRP Production Workcenter search with Customer and Sale Order</field>
|
||||
<field name="model">mrp.production.workcenter.line</field>
|
||||
<field name="inherit_id" ref="mrp_operations.view_mrp_production_workcenter_form_view_filter" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="production_id" position="after">
|
||||
<field name="partner_id" />
|
||||
<field name="sale_id" />
|
||||
</field>
|
||||
<group position="inside">
|
||||
<filter string="Customer" icon="terp-accessories-archiver"
|
||||
domain="[]" context="{'group_by':'partner_id'}" />
|
||||
<filter string="Sale Order" icon="terp-accessories-archiver"
|
||||
domain="[]" context="{'group_by':'sale_id'}" />
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user