[REM] stock_account: valuation stat button

Remove the valuation stat button as we say that from now on, to
understand the current value of a product, you should go through the
valuation ation and its stat button.
This commit is contained in:
Simon Lejeune
2018-04-16 11:26:49 +02:00
parent 352875a5a0
commit b8133aa64b
2 changed files with 5 additions and 84 deletions
+4 -20
View File
@@ -85,16 +85,8 @@ class ProductTemplate(models.Model):
@api.multi
def action_open_product_moves(self):
self.ensure_one()
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,
'search_default_incoming': True,
'search_default_done': True,
'is_avg': self.cost_method == 'average',
}
return action
# TODO: remove me in master
pass
@api.multi
def get_product_accounts(self, fiscal_pos=None):
@@ -270,16 +262,8 @@ class ProductProduct(models.Model):
@api.multi
def action_open_product_moves(self):
self.ensure_one()
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,
'search_default_done': True,
'is_avg': self.cost_method == 'average',
}
return action
#TODO: remove me in master
pass
@api.model
def _anglo_saxon_sale_move_lines(self, name, product, uom, qty, price_unit, currency=False, amount_currency=False, fiscal_position=False, account_analytic=False, analytic_tags=False):
+1 -64
View File
@@ -102,68 +102,5 @@
</p>
</field>
</record>
<record id="product_valuation_form_view" model="ir.ui.view">
<field name="name">product.product</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="stock.product_form_view_procurement_button"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_view_stock_move_lines']" position="after">
<button string="Inventory Valuation" type="object" name="action_open_product_moves" class="oe_stat_button" icon="fa-cubes" attrs="{'invisible': ['|', ('cost_method', '=', 'standard'), ('id', '=', False)]}"/>
</xpath>
</field>
</record>
<record id="product_template_valuation_form_view" model="ir.ui.view">
<field name="name">product.template</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_view_stock_move_lines']" position="after">
<button string="Inventory Valuation" type="object" name="action_open_product_moves" class="oe_stat_button" icon="fa-cubes" attrs="{'invisible': [('cost_method', '=', 'standard')]}"/>
</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>
</data>
</odoo>