diff options
| author | Simon Lejeune <sle@openerp.com> | 2017-09-28 16:43:57 +0200 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2017-09-29 16:43:00 +0200 |
| commit | a7d1740e475c44b50d0cc6ce6f43e9f142e99334 (patch) | |
| tree | 1436f07dc7084a703a4f1f9188e13c86c527936a | |
| parent | 50f0b5ebaf47f7693d92d66fd12eae7fa9fb4c64 (diff) | |
[FIX] stock_account: restore the valuation action
Introduced in rev 0f7d2d7cf7aaf8f3349c9733e970f9ae8e2b90b4 and wrongly
removed in ce4da0531dc18d68f0943e46a1ebe779761f8013
| -rw-r--r-- | addons/stock_account/models/product.py | 6 | ||||
| -rw-r--r-- | addons/stock_account/views/product_views.xml | 41 |
2 files changed, 44 insertions, 3 deletions
diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index 10d80789938..883a4b48ff9 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -86,7 +86,7 @@ class ProductTemplate(models.Model): @api.multi def action_open_product_moves(self): self.ensure_one() - action = self.env.ref('stock_account.product_valuation_action').read()[0] + action = self.env.ref('stock_account.stock_move_valuation_action').read()[0] action['domain'] = [('product_tmpl_id', '=', self.id)] action['context'] = { 'search_default_outgoing': True, @@ -185,8 +185,8 @@ class ProductProduct(models.Model): @api.multi def action_open_product_moves(self): self.ensure_one() - action = self.env.ref('stock_account.product_valuation_action').read()[0] - action['domain'] = [('id', '=', self.id)] + action = self.env.ref('stock_account.stock_move_valuation_action').read()[0] + action['domain'] = [('product_id', '=', self.id)] action['context'] = { 'search_default_outgoing': True, 'search_default_incoming': True, diff --git a/addons/stock_account/views/product_views.xml b/addons/stock_account/views/product_views.xml index d21e5f3ee0f..1bba3652044 100644 --- a/addons/stock_account/views/product_views.xml +++ b/addons/stock_account/views/product_views.xml @@ -137,5 +137,46 @@ </xpath> </field> </record> + + <!-- stock move valuation view --> + <record id="view_move_tree_valuation" model="ir.ui.view"> + <field name="name">stock.move.tree.valuation</field> + <field name="model">stock.move</field> + <field eval="8" name="priority"/> + <field name="arch" type="xml"> + <tree decoration-muted="state == 'cancel'" decoration-danger="(state not in ('cancel','done')) and date > current_date" string="Moves" create="0"> + <field name="name"/> + <field name="picking_id" string="Reference"/> + <field name="origin"/> + <field name="picking_type_id" invisible="1"/> + <field name="create_date" invisible="1" groups="base.group_no_one"/> + <field name="product_id"/> + <field name="location_id" groups="stock.group_stock_multi_locations"/> + <field name="location_dest_id" groups="stock.group_stock_multi_locations"/> + <field name="date" groups="base.group_no_one"/> + <field name="state" invisible="1"/> + <field name="product_uom_qty" string="Qty"/> + <field name="product_uom" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="product.group_uom"/> + <field name="price_unit"/> + <field name="value" sum="Stock Valuation"/> + <field name="remaining_qty" invisible="context.get('is_avg')"/> + <field name="remaining_value" sum="Stock Valuation" invisible="context.get('is_avg')"/> + </tree> + </field> + </record> + <record id="stock_move_valuation_action" model="ir.actions.act_window"> + <field name="name">Stock Moves</field> + <field name="res_model">stock.move</field> + <field name="type">ir.actions.act_window</field> + <field name="view_type">form</field> + <field name="view_id" ref="view_move_tree_valuation"/> + <field name="search_view_id" ref="stock.view_move_search"/> + <field name="context">{'search_default_outgoing': 1, 'search_default_incoming': 1, 'search_default_done': 1, 'search_default_group_by_product': 1}</field> + <field name="help" type="html"> + <p class="oe_view_nocontent_create"> + Click to create a stock movement. + </p> + </field> + </record> </data> </odoo> |
