[IMP] stock_account: remove security group inventory valuation
It will remove the stock setting, the group itself and remove it where it is used in the views. The perpetual valuation setting is only on the internal category which is already "deeper" in the system. It is also removed for the update price link on the product form in case of perpetual valuation and we changed the label to Update Cost instead of update standard/average cost.
This commit is contained in:
committed by
Josse Colpaert
parent
14c56188d1
commit
02a76becf7
@@ -1,28 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class StockConfigSettings(models.TransientModel):
|
||||
_inherit = 'stock.config.settings'
|
||||
|
||||
group_stock_inventory_valuation = fields.Boolean("Perpetual Valuation", implied_group='stock_account.group_inventory_valuation',
|
||||
help="Perpetual valuation allows to get up-to-date books whenever products are transferred. It is only tailored for big companies where such a need matters. It requires extra configuration and testing to make sure accounting is impacted the right way for every kind of stock move. \n This must be set on product categories. The Periodic mode is applied by default (i.e. manual accounting entries at the end of the fiscal year). This last mode is recommended for starters and small/medium-size companies.")
|
||||
module_stock_landed_costs = fields.Boolean("Landed Costs",
|
||||
help="Affect landed costs on receipt operations and split them among products to update their cost price.")
|
||||
|
||||
@api.model
|
||||
def get_default_property_valuation(self, fields):
|
||||
category = self.env['ir.values'].get_default('product.category', 'property_valuation')
|
||||
return {
|
||||
'group_stock_inventory_valuation': True if category == 'real_time' else False
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def set_default_property_valuation(self):
|
||||
if self.group_stock_inventory_valuation:
|
||||
data = 'real_time'
|
||||
else:
|
||||
data = 'manual_periodic'
|
||||
return self.env['ir.values'].set_default('product.category', 'property_valuation', data)
|
||||
|
||||
@@ -4,11 +4,6 @@
|
||||
<record id="stock.group_stock_manager" model="res.groups">
|
||||
<field name="implied_ids" eval="[(4, ref('account.group_account_invoice'))]"/>
|
||||
</record>
|
||||
<record id="group_inventory_valuation" model="res.groups">
|
||||
<field name="name">Manage Inventory Valuation and Costing Methods</field>
|
||||
<field name="category_id" ref="base.module_category_hidden"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.rule" id="stock_history_rule">
|
||||
<field name="name">Stock History multi-company</field>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<group name="account_property" position="before">
|
||||
<group>
|
||||
<group string="Inventory Valuation">
|
||||
<field name="property_cost_method" groups="stock_account.group_inventory_valuation"/>
|
||||
<field name="property_cost_method"/>
|
||||
<field name="property_valuation"/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -35,7 +35,7 @@
|
||||
<field name="list_price" position="after">
|
||||
<field name="valuation" invisible="1" readonly="1"/>
|
||||
<field name="cost_method" invisible="1" readonly="1"/>
|
||||
<field name="property_cost_method" groups="stock_account.group_inventory_valuation" invisible="1"/>
|
||||
<field name="property_cost_method" invisible="1"/>
|
||||
</field>
|
||||
<field name="standard_price" position="replace">
|
||||
<field name="standard_price"
|
||||
@@ -43,21 +43,13 @@
|
||||
widget='monetary' options="{'currency_field': 'currency_id'}"/>
|
||||
</field>
|
||||
<div name="standard_price_uom" position="after">
|
||||
<button string="Set standard cost" type="action"
|
||||
<button string="Update Cost" type="action"
|
||||
name="%(action_view_change_standard_price)d"
|
||||
attrs="{'invisible':['|', '|', ('valuation','!=', 'real_time'), ('cost_method', 'not in', ['standard']), ('product_variant_count', '>', 1)]}"
|
||||
class="oe_link oe_read_only" colspan="2"
|
||||
groups="stock_account.group_inventory_valuation"/>
|
||||
</div>
|
||||
<div name="standard_price_uom" position="after">
|
||||
<button string="Set standard cost" type="action"
|
||||
name="%(action_view_change_standard_price)d"
|
||||
attrs="{'invisible':['|', '|', ('valuation','!=', 'real_time'), ('cost_method', 'not in', ['average']), ('product_variant_count', '>', 1)]}"
|
||||
class="oe_link oe_read_only" colspan="2"
|
||||
groups="stock_account.group_inventory_valuation"/>
|
||||
attrs="{'invisible':['|', '|', ('valuation','!=', 'real_time'), ('cost_method', 'not in', ['average', 'standard']), ('product_variant_count', '>', 1)]}"
|
||||
class="oe_link oe_read_only" colspan="2"/>
|
||||
</div>
|
||||
<group name="accounting" position="inside">
|
||||
<group name="property_inventory_valuation" groups="stock_account.group_inventory_valuation" attrs="{'invisible': [('type','=','service')]}">
|
||||
<group name="property_inventory_valuation" attrs="{'invisible': [('type','=','service')]}">
|
||||
<field name="property_valuation" invisible="1"/>
|
||||
<field name="property_stock_account_input"
|
||||
attrs="{'invisible':[ ('valuation', '!=', 'real_time')]}"
|
||||
@@ -85,15 +77,13 @@
|
||||
<button string="Set standard cost" type="action"
|
||||
name="%(action_view_change_standard_price)d"
|
||||
attrs="{'invisible':['|',('valuation','!=', 'real_time'), ('cost_method', 'not in', ['standard'])]}"
|
||||
class="oe_link oe_read_only" colspan="2"
|
||||
groups="stock_account.group_inventory_valuation"/>
|
||||
class="oe_link oe_read_only" colspan="2"/>
|
||||
</field>
|
||||
<field name="standard_price" position="after">
|
||||
<button string="Set standard cost" type="action"
|
||||
name="%(action_view_change_standard_price)d"
|
||||
attrs="{'invisible':['|',('valuation','!=', 'real_time'), ('cost_method', 'not in', ['average'])]}"
|
||||
class="oe_link oe_read_only" colspan="2"
|
||||
groups="stock_account.group_inventory_valuation"/>
|
||||
class="oe_link oe_read_only" colspan="2"/>
|
||||
</field>
|
||||
</data>
|
||||
</field>
|
||||
|
||||
@@ -7,19 +7,8 @@
|
||||
<field name="inherit_id" ref="stock.view_stock_config_settings"/>
|
||||
<field name="arch" type="xml">
|
||||
<div id="production_lot_info" position="after">
|
||||
<h2>Costing & Valuation </h2>
|
||||
<h2>Costing</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Perpetual valuation allows to get an up-to-date stock valuation in your accounting whenever products are transferred. It is only tailored for big companies where such a need matters. It requires extra configuration and testing to make sure accounting is impacted the right way for every kind of stock move. This must be set on product categories. The Periodic mode is applied by default (i.e. manual accounting entries at the end of the fiscal year). This last mode is recommended for starters and small/medium-size companies.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_stock_inventory_valuation"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_stock_inventory_valuation"/>
|
||||
<div class="text-muted">
|
||||
Allow perpetual stock valuation in accounting
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Affect landed costs on receipt operations and split them among products to update their cost price.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_stock_landed_costs"/>
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
<field name="description">Landed cost validated</field>
|
||||
</record>
|
||||
|
||||
<record model="res.groups" id="base.group_user">
|
||||
<field name="implied_ids" eval="[(4, ref('stock_account.group_inventory_valuation'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="seq_stock_landed_costs" model="ir.sequence">
|
||||
<field name="name">Stock Landed Costs</field>
|
||||
<field name="code">stock.landed.cost</field>
|
||||
|
||||
Reference in New Issue
Block a user