[MERGE] Sync with trunk
[odoo/odoo.git] / addons / account_anglo_saxon / product.py
1 ##############################################################################
2 #    
3 #    OpenERP, Open Source Management Solution
4 #    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
5 #
6 #    This program is free software: you can redistribute it and/or modify
7 #    it under the terms of the GNU Affero General Public License as
8 #    published by the Free Software Foundation, either version 3 of the
9 #    License, or (at your option) any later version.
10 #
11 #    This program is distributed in the hope that it will be useful,
12 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #    GNU Affero General Public License for more details.
15 #
16 #    You should have received a copy of the GNU Affero General Public License
17 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.     
18 #
19 ##############################################################################
20
21 from openerp.osv import fields, osv
22
23 class product_category(osv.osv):
24     _inherit = "product.category"
25     _columns = {
26         'property_account_creditor_price_difference_categ': fields.property(
27             'account.account',
28             type='many2one',
29             relation='account.account',
30             string="Price Difference Account",
31             view_load=True,
32             help="This account will be used to value price difference between purchase price and cost price."),
33
34         #Redefine fields to change help text for anglo saxon methodology.            
35         'property_account_income_categ': fields.property(
36             'account.account',
37             type='many2one',
38             relation='account.account',
39             string="Income Account",
40             view_load=True,
41             help="This account will be used to value outgoing stock using sale price."),
42         'property_account_expense_categ': fields.property(
43             'account.account',
44             type='many2one',
45             relation='account.account',
46             string="Expense Account",
47             view_load=True,
48             help="This account will be used to value outgoing stock using cost price."),
49
50     }
51
52 class product_template(osv.osv):
53     _inherit = "product.template"
54     _columns = {
55         'property_account_creditor_price_difference': fields.property(
56             'account.account',
57             type='many2one',
58             relation='account.account',
59             string="Price Difference Account",
60             view_load=True,
61             help="This account will be used to value price difference between purchase price and cost price."),
62             
63         #Redefine fields to change help text for anglo saxon methodology.
64         'property_account_income': fields.property(
65             'account.account',
66             type='many2one',
67             relation='account.account',
68             string="Income Account",
69             view_load=True,
70             help="This account will be used to value outgoing stock using sale price."),
71         'property_account_expense': fields.property(
72             'account.account',
73             type='many2one',
74             relation='account.account',
75             string="Expense Account",
76             view_load=True,
77             help="This account will be used to value outgoing stock using cost price."),
78
79     }
80
81
82 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
83