From 02a76becf7bd76c37a43b363f64e46598738005c Mon Sep 17 00:00:00 2001 From: Haresh Shyara Date: Mon, 13 Feb 2017 16:01:48 +0530 Subject: [PATCH] [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. --- .../models/stock_config_settings.py | 19 +------------- .../security/stock_account_security.xml | 5 ---- addons/stock_account/views/product_views.xml | 26 ++++++------------- .../views/stock_config_settings_views.xml | 13 +--------- .../data/stock_landed_cost_data.xml | 4 --- 5 files changed, 10 insertions(+), 57 deletions(-) diff --git a/addons/stock_account/models/stock_config_settings.py b/addons/stock_account/models/stock_config_settings.py index e5c2e1e4c6b..c2f60ecc29f 100644 --- a/addons/stock_account/models/stock_config_settings.py +++ b/addons/stock_account/models/stock_config_settings.py @@ -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) diff --git a/addons/stock_account/security/stock_account_security.xml b/addons/stock_account/security/stock_account_security.xml index 838ffdf5fb2..7580ca74c6e 100644 --- a/addons/stock_account/security/stock_account_security.xml +++ b/addons/stock_account/security/stock_account_security.xml @@ -4,11 +4,6 @@ - - Manage Inventory Valuation and Costing Methods - - - Stock History multi-company diff --git a/addons/stock_account/views/product_views.xml b/addons/stock_account/views/product_views.xml index 6ab5ea14add..489340094ee 100644 --- a/addons/stock_account/views/product_views.xml +++ b/addons/stock_account/views/product_views.xml @@ -18,7 +18,7 @@ - + @@ -35,7 +35,7 @@ - +
-
-
-
- + + class="oe_link oe_read_only" colspan="2"/>