1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as
9 # published by the Free Software Foundation, either version 3 of the
10 # License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ##############################################################################
22 from osv import fields, osv
23 from tools.translate import _
26 class product_product(osv.osv):
27 _inherit = "product.product"
29 # TODO: DEAD CODE: This function was called from do_change_standard_price,
30 # but as that function is removed for the fix of lp:747056, its not reached
31 # def get_product_accounts(self, cr, uid, product_id, context=None):
32 # """ To get the stock input account, stock output account and stock journal related to product.
33 # @param product_id: product id
34 # @return: dictionary which contains information regarding stock input account, stock output account and stock journal
36 # product_obj = self.pool.get('product.product').browse(cr, uid, product_id, False)
37 # res = super(product_product,self).get_product_accounts(cr, uid, product_id, context=context)
38 # stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False
39 # if not stock_input_acc:
40 # 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
42 # stock_output_acc = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id or False
43 # if not stock_output_acc:
44 # 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
46 # journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False
48 # res.update({'stock_account_input': stock_input_acc})
49 # res.update({'stock_account_output': stock_output_acc})
50 # res.update({'stock_journal': journal_id})
56 "bom_ids": fields.one2many('mrp.bom', 'product_id','Bill of Materials'),
59 # Removed do_change_standard_price for the fix of lp:747056
61 def copy(self, cr, uid, id, default=None, context=None):
67 return super(product_product, self).copy(cr, uid, id, default, context=context)