summaryrefslogtreecommitdiff
path: root/addons/procurement
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2015-03-17 10:54:37 +0100
committerYannick Tivisse <yti@odoo.com>2015-07-10 15:25:44 +0200
commit2fcd35631780fae64d19e29dd89e4e93dee1d57f (patch)
tree43677c9f56abbd1f916008c33ab1a987b356042d /addons/procurement
parentaf4702006fb445073559fa182ee401e74932694b (diff)
[IMP] stock,procurement : stat button procurement, ux improvements
Diffstat (limited to 'addons/procurement')
-rw-r--r--addons/procurement/__openerp__.py1
-rw-r--r--addons/procurement/procurement_view.xml72
-rw-r--r--addons/procurement/product_product_view.xml34
3 files changed, 97 insertions, 10 deletions
diff --git a/addons/procurement/__openerp__.py b/addons/procurement/__openerp__.py
index f405054060a..ff35d8ec9a3 100644
--- a/addons/procurement/__openerp__.py
+++ b/addons/procurement/__openerp__.py
@@ -37,6 +37,7 @@ Procurements in exception should be checked manually and can be re-run.
'wizard/schedulers_all_view.xml',
'procurement_view.xml',
'company_view.xml',
+ 'product_product_view.xml',
],
'demo': [],
'test': ['test/procurement.yml'],
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index 6a28fbd58f7..350df7898b5 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -131,6 +131,31 @@
</field>
</record>
+ <record id="procurement_order_action_exceptions" model="ir.actions.act_window">
+ <field name="name">Procurement Exceptions</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">procurement.order</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="context">{'search_default_exceptions':1}</field>
+ <field name="search_view_id" ref="view_procurement_filter"/>
+ <field name="help" type="html">
+ <p class="oe_view_nocontent_create">
+ Click to create a Procurement order in exception state, or remove the filter on the search bar to display all the procurements.
+ </p>
+ <p>
+ <b>Procurement Orders</b> represent the need for a certain quantity of products, at a given time, in a given location.
+ </p>
+ <p>
+ <b>Sales Orders</b> are one typical source of Procurement Orders (but these are distinct documents).
+ <br/>Depending on the procurement parameters and the product configuration, the procurement engine will attempt to satisfy the need by reserving products from stock, ordering products from a supplier, or passing a manufacturing order, etc...
+ </p>
+ <p>
+ A <b>Procurement Exception</b> occurs when the system cannot find a way to fulfill a procurement. Some exceptions will resolve themselves automatically, but others require manual intervention (those are identified by a specific error message in the chatter).
+ </p>
+ </field>
+ </record>
+
<record id="procurement_action" model="ir.actions.act_window">
<field name="name">Procurement Orders</field>
<field name="type">ir.actions.act_window</field>
@@ -156,28 +181,55 @@
</p>
</field>
</record>
-
- <record id="procurement_exceptions" model="ir.actions.act_window">
- <field name="name">Procurement Exceptions</field>
+
+ <record id="procurement_order_action_product_template_stat" model="ir.actions.act_window">
+ <field name="name">Procurement Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">procurement.order</field>
<field name="view_type">form</field>
- <field name="view_mode">tree,form</field>
- <field name="context">{'search_default_exceptions':1}</field>
<field name="search_view_id" ref="view_procurement_filter"/>
+ <field name="context">{'search_default_current':1}</field>
+ <field name="domain">[('product_id.product_tmpl_id.id', '=', active_id)]</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
- Click to create a Procurement Exception, or remove the filter on the search bar to display all the procurements.
+ Click to create a procurement order.
</p>
<p>
- <b>Procurement Orders</b> represent the need for a certain quantity of products, at a given time, in a given location.
+ A <b>procurement order</b> is used to record a need for a specific
+ product at a specific location. Procurement orders are usually
+ created automatically from <i>sales orders, pull logistic rules or
+ minimum stock rules.</i>
</p>
<p>
- <b>Sales Orders</b> are one typical source of Procurement Orders (but these are distinct documents).
- <br/>Depending on the procurement parameters and the product configuration, the procurement engine will attempt to satisfy the need by reserving products from stock, ordering products from a supplier, or passing a manufacturing order, etc...
+ When the procurement order is confirmed, it automatically
+ creates the necessary operations to fullfil the need: purchase
+ order proposition, manufacturing order, etc.
+ </p>
+ </field>
+ </record>
+
+ <record id="procurement_order_action_product_product_stat" model="ir.actions.act_window">
+ <field name="name">Procurement Orders</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">procurement.order</field>
+ <field name="view_type">form</field>
+ <field name="search_view_id" ref="view_procurement_filter"/>
+ <field name="context">{'search_default_current':1, 'default_product_id': active_id}</field>
+ <field name="domain">[('product_id.id', '=', active_id)]</field>
+ <field name="help" type="html">
+ <p class="oe_view_nocontent_create">
+ Click to create a procurement order.
</p>
<p>
- A <b>Procurement Exception</b> occurs when the system cannot find a way to fulfill a procurement. Some exceptions will resolve themselves automatically, but others require manual intervention (those are identified by a specific error message in the chatter).
+ A <b>procurement order</b> is used to record a need for a specific
+ product at a specific location. Procurement orders are usually
+ created automatically from <i>sales orders, pull logistic rules or
+ minimum stock rules.</i>
+ </p>
+ <p>
+ When the procurement order is confirmed, it automatically
+ creates the necessary operations to fullfil the need: purchase
+ order proposition, manufacturing order, etc.
</p>
</field>
</record>
diff --git a/addons/procurement/product_product_view.xml b/addons/procurement/product_product_view.xml
new file mode 100644
index 00000000000..0a40e60b871
--- /dev/null
+++ b/addons/procurement/product_product_view.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="product_template_view_form_procurement_button" model="ir.ui.view">
+ <field name="name">product.template.procurement.stat.button</field>
+ <field name="model">product.template</field>
+ <field name="inherit_id" ref="product.product_template_only_form_view"/>
+ <field name="arch" type="xml">
+ <xpath expr="//div[@name='button_box']" position="inside">
+ <button class="oe_stat_button" name="%(procurement.procurement_order_action_product_template_stat)d"
+ icon="fa-truck" string="Procurements" type="action"
+ groups="stock.group_adv_location"
+ attrs="{'invisible':[('type', '=', 'service')]}"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="product_product_view_form_procurement_button" model="ir.ui.view">
+ <field name="name">product.product.procurement.stat.button</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='button_box']" position="inside">
+ <button class="oe_stat_button" name="%(procurement.procurement_order_action_product_product_stat)d"
+ icon="fa-truck" string="Procurements" type="action"
+ groups="stock.group_adv_location"
+ attrs="{'invisible':[('type', '=', 'service')]}"/>
+ </xpath>
+ </field>
+ </record>
+
+ </data>
+</openerp> \ No newline at end of file