[IMP] stock, stock_account: locations views and filters

- add a filter "production locations" on stock location
- add an action returning the production stock locations
- display a link to this action in the product category views in stock
  account so users can easily set the correct accounts on these
  locations
- set valuation journal an account before the others in the product
  category form

Task-2161057

closes odoo/odoo#43762

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
rso-odoo
2020-02-05 16:14:27 +00:00
committed by Simon Lejeune
parent 42078c745a
commit f648ab94eb
2 changed files with 16 additions and 2 deletions
@@ -68,6 +68,7 @@
<field name="name" string="Stock Locations"/>
<filter name="in_location" string="Internal" domain="[('usage', '=', 'internal')]" help="Internal Locations"/>
<filter name="customer" string="Customer" domain="[('usage', '=', 'customer')]" help="Customer Locations"/>
<filter name="prod_inv_location" string="Production" domain="[('usage', 'in', ['inventory', 'production'])]" help="Production Locations"/>
<filter name="supplier" string="Vendor" domain="[('usage', '=', 'supplier')]" help="Vendor Locations"/>
<field name="location_id" string="Parent Location"/>
<separator/>
@@ -129,6 +130,16 @@
</p>
</field>
</record>
<record id="action_prod_inv_location_form" model="ir.actions.act_window">
<field name="name">Locations</field>
<field name="res_model">stock.location</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_location_tree2"/>
<field name="search_view_id" ref="view_location_search"/>
<field name="context">{'search_default_prod_inv_location': 1}</field>
</record>
<menuitem action="action_location_form" id="menu_action_location_form"
parent="menu_warehouse_config" sequence="2" groups="stock.group_stock_multi_locations"/>
+5 -2
View File
@@ -19,10 +19,13 @@
<field name="arch" type="xml">
<group name="account_property" position="inside">
<group name="account_stock_property" string="Account Stock Properties" groups="account.group_account_readonly">
<field name="property_stock_valuation_account_id" options="{'no_create': True}" attrs="{'required':[('property_valuation', '=', 'real_time')]}"/>
<field name="property_stock_journal" attrs="{'required':[('property_valuation', '=', 'real_time')]}" />
<field name="property_stock_account_input_categ_id" attrs="{'required':[ ('property_valuation', '=', 'real_time')]}" />
<field name="property_stock_account_output_categ_id" attrs="{'required':[ ('property_valuation', '=', 'real_time')]}" />
<field name="property_stock_valuation_account_id" options="{'no_create': True}" attrs="{'required':[ ('property_valuation', '=', 'real_time')]}"/>
<field name="property_stock_journal" attrs="{'required':[ ('property_valuation', '=', 'real_time')]}" />
<div colspan="2" class="alert alert-info mt16" role="status">
<b>Set other input/output accounts on specific </b><button name="%(stock.action_prod_inv_location_form)d" role="button" type="action" class="btn-link" style="padding: 0;vertical-align: baseline;" string="locations"/>.
</div>
</group>
</group>
<group name="account_property" position="before">