summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Patel (OpenERP) <apa@tinyerp.com>2012-08-31 15:59:30 +0530
committerAmit Patel (OpenERP) <apa@tinyerp.com>2012-08-31 15:59:30 +0530
commit8ef441badb2d3e7a0d7a4650e70de27b4a8dde2d (patch)
treed34744f01c708b53014f0723d555da9f26818e02
parent23fec920304717dca49b353d1c1d54713102824f (diff)
parent39ed85c18dc3b3226ddc62ed73391fce714d2d9a (diff)
[MERGE]:merged with trunk
bzr revid: apa@tinyerp.com-20120831102930-a53w7rvmibe3mqkm
-rw-r--r--addons/account_analytic_analysis/account_analytic_analysis_view.xml1
-rw-r--r--addons/mrp/mrp_view.xml56
-rw-r--r--addons/mrp/product.py2
-rw-r--r--addons/procurement/procurement_view.xml41
-rw-r--r--addons/product/product_view.xml2
5 files changed, 40 insertions, 62 deletions
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index 8f051b33bf9..63a8e6c7add 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -23,7 +23,6 @@
<label for="quantity_max"/>
<div>
<field name="quantity_max" class="oe_inline"/>
- <field name="company_uom_id" readonly="1" class="oe_inline"/>
</div>
</xpath>
<xpath expr='//group[@name="invoice_on_timesheets"]' position="replace">
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index d47c3a9129a..d57eba2ceb5 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -985,43 +985,14 @@
</data>
</field>
</record>
- <record id="product_normal_form_supply_view" model="ir.ui.view">
+ <record id="product_normal_form_supply_view" model="ir.ui.view">
<field name="name">product.normal.form.mrp.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
- <xpath expr="//field[@name='procure_method']" position="after">
- <field name="supply_method" groups="base.group_user"/>
- </xpath>
- </field>
- </record>
-
- <record id="product_normal_form_view" model="ir.ui.view">
- <field name="name">product.normal.form.mrp.inherit</field>
- <field name="model">product.product</field>
- <field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>
- <field name="arch" type="xml">
- <page string="Procurement &amp; Locations" position="inside">
- <separator string="Bill of Materials"/>
- <field name="bom_ids" widget="one2many_list" mode="tree" context="{'default_product_id': active_id}">
- <tree string="Bill of Materials">
- <field name="name" string="Component Name"/>
- <field name="bom_id"/>
- <field name="product_qty" string="Quantity of Product"/>
- <field name="type"/>
- <field name="date_start"/>
- <field name="date_stop"/>
- </tree>
- <form string="Bill of Material">
- <field name="name" string="Component Name"/>
- <field name="bom_id"/>
- <field name="product_qty" string="Quantity of Product"/>
- <field name="type"/>
- <field name="date_start"/>
- <field name="date_stop"/>
- </form>
- </field>
- </page>
+ <xpath expr="//field[@name='procure_method']" position="after">
+ <field name="supply_method" groups="base.group_user"/>
+ </xpath>
</field>
</record>
@@ -1079,5 +1050,24 @@
id="menu_mrp_production_order_action" name="Orders Planning"
parent="menu_mrp_planning" sequence="1"/>
+
+ <record model="ir.actions.act_window" id="product_open_bom">
+ <field name="context">{'default_product_id': active_id, 'search_default_product_id': active_id}</field>
+ <field name="name">Bill of Materials</field>
+ <field name="res_model">mrp.bom</field>
+ </record>
+
+ <record model="ir.ui.view" id="product_form_view_bom_button">
+ <field name="name">product.product.procurement</field>
+ <field name="model">product.product</field>
+ <field name="inherit_id" ref="product.product_normal_form_view"/>
+ <field name="arch" type="xml">
+ <xpath expr="//div[@name='buttons']" position="inside">
+ <button string="Bill of Materials" name="%(product_open_bom)d" type="action"/>
+ </xpath>
+ </field>
+ </record>
+
+
</data>
</openerp>
diff --git a/addons/mrp/product.py b/addons/mrp/product.py
index 1bc3bb749ce..1fa0f2c8a97 100644
--- a/addons/mrp/product.py
+++ b/addons/mrp/product.py
@@ -26,7 +26,7 @@ from tools.translate import _
class product_product(osv.osv):
_inherit = "product.product"
_columns = {
- "bom_ids": fields.one2many('mrp.bom', 'product_id','Bill of Materials'),
+ "bom_ids": fields.one2many('mrp.bom', 'product_id','Bill of Materials', domain=[('bom_id','=',False)]),
}
def copy(self, cr, uid, id, default=None, context=None):
if not default:
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index f2a8dc98cb0..432ff13aaa5 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -261,12 +261,12 @@
</record>
<act_window
- context="{'search_default_warehouse_id': active_id, 'default_warehouse_id': active_id}"
- id="act_stock_warehouse_2_stock_warehouse_orderpoint"
- name="Reordering Rules"
- res_model="stock.warehouse.orderpoint"
- src_model="stock.warehouse"
- groups="stock.group_stock_user"/>
+ context="{'search_default_warehouse_id': active_id, 'default_warehouse_id': active_id}"
+ id="act_stock_warehouse_2_stock_warehouse_orderpoint"
+ name="Reordering Rules"
+ res_model="stock.warehouse.orderpoint"
+ src_model="stock.warehouse"
+ groups="stock.group_stock_user"/>
<act_window
context="{'product_uom': locals().has_key('uom_id') and uom_id, 'default_procurement_id': active_id}"
@@ -283,23 +283,11 @@
<menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_configuration" sequence="5"/>
<menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="stock.menu_stock_configuration" sequence="10"/>
- <record id="product_normal_form_view" model="ir.ui.view">
- <field name="name">product.normal.form.orderpoint.inherit</field>
- <field name="model">product.product</field>
- <field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>
- <field name="arch" type="xml">
- <page string="Procurement &amp; Locations" position="inside">
- <separator string="Minimum Stock Rules"/>
- <field name="orderpoint_ids" widget="one2many_list" mode="tree" context="{'default_product_id': active_id}">
- <tree string="Reordering Rules">
- <field name="name"/>
- <field name="warehouse_id"/>
- <field name="product_min_qty"/>
- <field name="product_max_qty"/>
- </tree>
- </field>
- </page>
- </field>
+
+ <record model="ir.actions.act_window" id="product_open_orderpoint">
+ <field name="context">{'default_product_id': active_id, 'search_default_product_id': active_id}</field>
+ <field name="name">Orderpoints</field>
+ <field name="res_model">stock.warehouse.orderpoint</field>
</record>
<record model="ir.ui.view" id="product_form_view_procurement_button">
@@ -307,10 +295,9 @@
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
- <xpath expr="//field[@name='image_medium']" position="after">
- <div class='oe_right oe_button_box'>
- <button string="Procurement Request" name="%(act_make_procurement)d" type="action"/>
- </div>
+ <xpath expr="//div[@name='buttons']" position="inside">
+ <button string="Request Procurement" name="%(act_make_procurement)d" type="action"/>
+ <button string="Orderpoints" name="%(product_open_orderpoint)d" type="action"/>
</xpath>
</field>
</record>
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 17b4a7ecc68..d341b5883d6 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -72,6 +72,8 @@
<label for="categ_id" class="oe_edit_only"/>
<h2><field name="categ_id"/></h2>
</div>
+ <div class="oe_right oe_button_box" name="buttons">
+ </div>
<notebook>
<page string="Information">
<group>