diff --git a/addons/product/product.py b/addons/product/product.py index 5ee41a09545..3933fa72c21 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -313,12 +313,6 @@ class product_template(osv.osv): 'volume': fields.float('Volume', help="The volume in m3."), 'weight': fields.float('Gross Weight', digits_compute=dp.get_precision('Stock Weight'), help="The gross weight in Kg."), 'weight_net': fields.float('Net Weight', digits_compute=dp.get_precision('Stock Weight'), help="The net weight in Kg."), - 'cost_method': fields.property(type='selection', selection = [('standard','Standard Price'), ('average','Average Price'), ('real', 'Real Price')], - help="""Standard Price: The cost price is manually updated at the end of a specific period (usually every year) - Average Price: The cost price is recomputed at each incoming shipment - FIFO Price: The cost price is recomputed at each outgoing shipment FIFO - LIFO Price: The cost price is recomputed at each outgoing shipment LIFO""", - string="Costing Method", required=True), 'warranty': fields.float('Warranty'), 'sale_ok': fields.boolean('Can be Sold', help="Specify if the product can be selected in a sales order line."), 'state': fields.selection([('',''), @@ -373,14 +367,13 @@ class product_template(osv.osv): _defaults = { 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'product.template', context=c), 'list_price': 1, - 'cost_method': 'standard', 'standard_price': 0.0, 'sale_ok': 1, 'produce_delay': 1, 'uom_id': _get_uom_id, 'uom_po_id': _get_uom_id, - 'uos_coeff' : 1.0, - 'mes_type' : 'fixed', + 'uos_coeff': 1.0, + 'mes_type': 'fixed', 'categ_id' : _default_category, 'type' : 'consu', } diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 8fb6615feda..f6140cf4154 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -96,8 +96,7 @@ - - + @@ -710,8 +709,7 @@ - - + diff --git a/addons/product_extended/__openerp__.py b/addons/product_extended/__openerp__.py index e9604c83c98..6a641a26c6a 100644 --- a/addons/product_extended/__openerp__.py +++ b/addons/product_extended/__openerp__.py @@ -22,7 +22,7 @@ "name" : "Product extension to track sales and purchases", "version" : "1.0", "author" : "OpenERP S.A.", - "depends" : ["product", "purchase", "sale", "mrp"], + "depends" : ["product", "purchase", "sale", "mrp", "stock_account"], "category" : "Generic Modules/Inventory Control", "description": """ Product extension. This module adds: diff --git a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml index 3efd133ffb6..fd4afb31942 100644 --- a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml +++ b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml @@ -13,7 +13,6 @@ - !record {model: product.product, id: product_product_hrmanger0}: categ_id: product.product_category_6 - cost_method: standard mes_type: fixed name: HR Manger procure_method: make_to_stock diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index 0a131faf49c..5d262a6cec9 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -38,15 +38,15 @@ OpenERP’s replenishment management rules enable the system to generate draft p Dashboard / Reports for Purchase Management will include: --------------------------------------------------------- * Request for Quotations -* Purchase Orders Waiting Approval +* Purchase Orders Waiting Approval * Monthly Purchases by Category * Receptions Analysis * Purchase Analysis """, 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', - 'images' : ['images/purchase_order.jpeg', 'images/purchase_analysis.jpeg', 'images/request_for_quotation.jpeg'], - 'depends': ['stock', 'process'], + 'images': ['images/purchase_order.jpeg', 'images/purchase_analysis.jpeg', 'images/request_for_quotation.jpeg'], + 'depends': ['stock_account', 'process'], 'data': [ 'security/purchase_security.xml', 'security/ir.model.access.csv', @@ -67,8 +67,8 @@ Dashboard / Reports for Purchase Management will include: 'res_config_view.xml', ], 'test': [ - 'test/fifo_price.yml', - 'test/fifo_returns.yml', + 'test/fifo_price.yml', + 'test/fifo_returns.yml', #'test/costmethodchange.yml', 'test/process/cancel_order.yml', 'test/process/rfq2order2done.yml', diff --git a/addons/sale_mrp/test/sale_mrp.yml b/addons/sale_mrp/test/sale_mrp.yml index f0ec2de6efc..5659e327df0 100644 --- a/addons/sale_mrp/test/sale_mrp.yml +++ b/addons/sale_mrp/test/sale_mrp.yml @@ -15,7 +15,6 @@ - !record {model: product.template, id: product_template_slidermobile0}: categ_id: product_category_allproductssellable0 - cost_method: standard list_price: 200.0 mes_type: fixed name: Slider Mobile @@ -30,7 +29,6 @@ - !record {model: product.product, id: product_product_slidermobile0}: categ_id: product_category_allproductssellable0 - cost_method: standard list_price: 200.0 mes_type: fixed name: Slider Mobile diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index fbd5b977ea2..14335a7fdbd 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -24,12 +24,12 @@ 'version': '1.1', 'author': 'OpenERP SA', 'summary': 'Inventory, Logistic, Storage', - 'description' : """ + 'description': """ Manage multi-warehouses, multi- and structured stock locations ============================================================== -The warehouse and inventory management is based on a hierarchical location structure, from warehouses to storage bins. -The double entry inventory system allows you to manage customers, suppliers as well as manufacturing inventories. +The warehouse and inventory management is based on a hierarchical location structure, from warehouses to storage bins. +The double entry inventory system allows you to manage customers, suppliers as well as manufacturing inventories. OpenERP has the capacity to manage lots and serial numbers ensuring compliance with the traceability requirements imposed by the majority of industries. @@ -53,8 +53,8 @@ Dashboard / Reports for Warehouse Management will include: * Moves Analysis """, 'website': 'http://www.openerp.com', - 'images': ['images/stock_forecast_report.png', 'images/delivery_orders.jpeg', 'images/inventory_analysis.jpeg','images/location.jpeg','images/moves_analysis.jpeg','images/physical_inventories.jpeg','images/warehouse_dashboard.jpeg'], - 'depends': ['product', 'account','procurement'], + 'images': ['images/stock_forecast_report.png', 'images/delivery_orders.jpeg', 'images/inventory_analysis.jpeg', 'images/location.jpeg', 'images/moves_analysis.jpeg', 'images/physical_inventories.jpeg', 'images/warehouse_dashboard.jpeg'], + 'depends': ['product', 'procurement', 'board'], 'category': 'Warehouse Management', 'sequence': 16, 'demo': [ @@ -72,12 +72,10 @@ Dashboard / Reports for Warehouse Management will include: 'wizard/stock_partial_picking_view.xml', 'wizard/stock_partial_move_view.xml', 'wizard/stock_fill_inventory_view.xml', - 'wizard/stock_invoice_onshipping_view.xml', 'wizard/stock_inventory_merge_view.xml', 'wizard/stock_location_product_view.xml', 'wizard/stock_splitinto_view.xml', 'wizard/stock_inventory_line_split_view.xml', - 'wizard/stock_change_standard_price_view.xml', 'wizard/stock_return_picking_view.xml', 'wizard/make_procurement_view.xml', 'wizard/mrp_procurement_view.xml', @@ -87,7 +85,6 @@ Dashboard / Reports for Warehouse Management will include: 'stock_report.xml', 'stock_view.xml', 'stock_sequence.xml', - 'product_data.xml', 'product_view.xml', 'partner_view.xml', 'report/report_stock_move_view.xml', @@ -103,15 +100,15 @@ Dashboard / Reports for Warehouse Management will include: 'installable': True, 'application': True, 'auto_install': False, - 'css': [ + 'css': [ 'static/src/css/picking.css', - 'static/src/css/stock.css', + 'static/src/css/stock.css', ], 'js': [ 'static/src/js/widgets.js', 'static/src/js/main.js', ], - 'qweb':['static/src/xml/picking.xml'], + 'qweb': ['static/src/xml/picking.xml'], } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/partner.py b/addons/stock/partner.py index 3b193cb447e..0998ddf0b44 100644 --- a/addons/stock/partner.py +++ b/addons/stock/partner.py @@ -36,3 +36,4 @@ class res_partner(osv.osv): help="This stock location will be used, instead of the default one, as the source location for goods you receive from the current partner"), } +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/product.py b/addons/stock/product.py index ed39faf790e..dec76623ce4 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -47,147 +47,6 @@ class product_product(osv.osv): res[product_id]['delivery_count'] = move['product_id_count'] return res - def get_product_accounts(self, cr, uid, product_id, context=None): - """ To get the stock input account, stock output account and stock journal related to product. - @param product_id: product id - @return: dictionary which contains information regarding stock input account, stock output account and stock journal - """ - if context is None: - context = {} - product_obj = self.pool.get('product.product').browse(cr, uid, product_id, context=context) - - stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False - if not stock_input_acc: - stock_input_acc = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id or False - - stock_output_acc = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id or False - if not stock_output_acc: - stock_output_acc = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id or False - - journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False - account_valuation = product_obj.categ_id.property_stock_valuation_account_id and product_obj.categ_id.property_stock_valuation_account_id.id or False - return { - 'stock_account_input': stock_input_acc, - 'stock_account_output': stock_output_acc, - 'stock_journal': journal_id, - 'property_stock_valuation_account_id': account_valuation - } - - # FP Note:;too complex, not good, should be implemented at quant level TODO - def do_change_standard_price(self, cr, uid, ids, datas, context=None): - """ Changes the Standard Price of Product and creates an account move accordingly. - @param datas : dict. contain default datas like new_price, stock_output_account, stock_input_account, stock_journal - @param context: A standard dictionary - @return: - - """ - location_obj = self.pool.get('stock.location') - move_obj = self.pool.get('account.move') - move_line_obj = self.pool.get('account.move.line') - if context is None: - context = {} - - new_price = datas.get('new_price', 0.0) - stock_output_acc = datas.get('stock_output_account', False) - stock_input_acc = datas.get('stock_input_account', False) - journal_id = datas.get('stock_journal', False) - product_obj=self.browse(cr, uid, ids, context=context)[0] - account_valuation = product_obj.categ_id.property_stock_valuation_account_id - account_valuation_id = account_valuation and account_valuation.id or False - if not account_valuation_id: raise osv.except_osv(_('Error!'), _('Specify valuation Account for Product Category: %s.') % (product_obj.categ_id.name)) - move_ids = [] - loc_ids = location_obj.search(cr, uid,[('usage','=','internal')]) - for rec_id in ids: - for location in location_obj.browse(cr, uid, loc_ids, context=context): - c = context.copy() - c.update({ - 'location': location.id, - 'compute_child': False - }) - - product = self.browse(cr, uid, rec_id, context=c) - qty = product.qty_available - diff = product.standard_price - new_price - if not diff: raise osv.except_osv(_('Error!'), _("No difference between standard price and new price!")) - if qty: - company_id = location.company_id and location.company_id.id or False - if not company_id: raise osv.except_osv(_('Error!'), _('Please specify company in Location.')) - # - # Accounting Entries - # - if not journal_id: - journal_id = product.categ_id.property_stock_journal and product.categ_id.property_stock_journal.id or False - if not journal_id: - raise osv.except_osv(_('Error!'), - _('Please define journal '\ - 'on the product category: "%s" (id: %d).') % \ - (product.categ_id.name, - product.categ_id.id,)) - move_id = move_obj.create(cr, uid, { - 'journal_id': journal_id, - 'company_id': company_id - }) - - move_ids.append(move_id) - - - if diff > 0: - if not stock_input_acc: - stock_input_acc = product.\ - property_stock_account_input.id - if not stock_input_acc: - stock_input_acc = product.categ_id.\ - property_stock_account_input_categ.id - if not stock_input_acc: - raise osv.except_osv(_('Error!'), - _('Please define stock input account ' \ - 'for this product: "%s" (id: %d).') % \ - (product.name, - product.id,)) - amount_diff = qty * diff - move_line_obj.create(cr, uid, { - 'name': product.name, - 'account_id': stock_input_acc, - 'debit': amount_diff, - 'move_id': move_id, - }) - move_line_obj.create(cr, uid, { - 'name': product.categ_id.name, - 'account_id': account_valuation_id, - 'credit': amount_diff, - 'move_id': move_id - }) - elif diff < 0: - if not stock_output_acc: - stock_output_acc = product.\ - property_stock_account_output.id - if not stock_output_acc: - stock_output_acc = product.categ_id.\ - property_stock_account_output_categ.id - if not stock_output_acc: - raise osv.except_osv(_('Error!'), - _('Please define stock output account ' \ - 'for this product: "%s" (id: %d).') % \ - (product.name, - product.id,)) - amount_diff = qty * -diff - move_line_obj.create(cr, uid, { - 'name': product.name, - 'account_id': stock_output_acc, - 'credit': amount_diff, - 'move_id': move_id - }) - move_line_obj.create(cr, uid, { - 'name': product.categ_id.name, - 'account_id': account_valuation_id, - 'debit': amount_diff, - 'move_id': move_id - }) - - self.write(cr, uid, rec_id, {'standard_price': new_price}) - - return move_ids - def view_header_get(self, cr, user, view_id, view_type, context=None): if context is None: context = {} @@ -343,15 +202,6 @@ class product_product(osv.osv): 'track_outgoing': fields.boolean('Track Outgoing Lots', help="Forces to specify a Serial Number for all moves containing this product and going to a Customer Location"), 'location_id': fields.dummy(string='Location', relation='stock.location', type='many2one'), 'warehouse_id': fields.dummy(string='Warehouse', relation='stock.warehouse', type='many2one'), - 'valuation':fields.property(type='selection', selection=[('manual_periodic', 'Periodical (manual)'), - ('real_time','Real Time (automated)'),], string = 'Inventory Valuation', - help="If real-time valuation is enabled for a product, the system will automatically write journal entries corresponding to stock moves." \ - "The inventory variation account set on the product category will represent the current inventory value, and the stock input and stock output account will hold the counterpart moves for incoming and outgoing products." - , required=True), - } - - _defaults = { - 'valuation': 'manual_periodic', } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): @@ -420,18 +270,6 @@ class product_template(osv.osv): string="Inventory Location", domain=[('usage','like','inventory')], help="This stock location will be used, instead of the default one, as the source location for stock moves generated when you do an inventory."), - 'property_stock_account_input': fields.property( - type='many2one', - relation='account.account', - string='Stock Input Account', - help="When doing real-time inventory valuation, counterpart journal items for all incoming stock moves will be posted in this account, unless " - "there is a specific valuation account set on the source location. When not set on the product, the one from the product category is used."), - 'property_stock_account_output': fields.property( - type='many2one', - relation='account.account', - string='Stock Output Account', - help="When doing real-time inventory valuation, counterpart journal items for all outgoing stock moves will be posted in this account, unless " - "there is a specific valuation account set on the destination location. When not set on the product, the one from the product category is used."), 'sale_delay': fields.float('Customer Lead Time', help="The average delay in days between the confirmation of the customer order and the delivery of the finished products. It's the time you promise to your customers."), 'loc_rack': fields.char('Rack', size=16), 'loc_row': fields.char('Row', size=16), @@ -443,35 +281,4 @@ class product_template(osv.osv): } - -class product_category(osv.osv): - _inherit = 'product.category' - _columns = { - 'property_stock_journal': fields.property( - relation='account.journal', - type='many2one', - string='Stock Journal', - help="When doing real-time inventory valuation, this is the Accounting Journal in which entries will be automatically posted when stock moves are processed."), - 'property_stock_account_input_categ': fields.property( - type='many2one', - relation='account.account', - string='Stock Input Account', - help="When doing real-time inventory valuation, counterpart journal items for all incoming stock moves will be posted in this account, unless " - "there is a specific valuation account set on the source location. This is the default value for all products in this category. It " - "can also directly be set on each product"), - 'property_stock_account_output_categ': fields.property( - type='many2one', - relation='account.account', - string='Stock Output Account', - help="When doing real-time inventory valuation, counterpart journal items for all outgoing stock moves will be posted in this account, unless " - "there is a specific valuation account set on the destination location. This is the default value for all products in this category. It " - "can also directly be set on each product"), - 'property_stock_valuation_account_id': fields.property( - type='many2one', - relation='account.account', - string="Stock Valuation Account", - help="When real-time inventory valuation is enabled on a product, this account will hold the current value of the products.",), - } - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml index 40d16f2bc63..15390b85e9b 100644 --- a/addons/stock/product_view.xml +++ b/addons/stock/product_view.xml @@ -14,24 +14,6 @@ - - product.category.stock.property.form.inherit - product.category - - - - - - - - - - - - - - - product.template.stock.property.form.inherit product.template @@ -48,16 +30,12 @@ - + - - - - @@ -68,13 +46,22 @@ product.product + + + + +