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
##############################################################################
23
from osv import fields
26
from tools.translate import _
28
class res_partner(osv.osv):
29
_inherit = "res.partner"
31
'related_cost_ids': fields.one2many('res.partner.related.cost.line', 'product_id', 'Related Cost'),
36
class res_partner_related_cost(osv.osv):### ADD a name constrain !!!!!!
38
_name = 'res.partner.related.cost'
40
'factor': fields.float('Factor', digits=(14,4)),
41
'active': fields.boolean('Active'),
42
'name': fields.char('Name', size=32)
45
'active': lambda *args: 1
48
res_partner_related_cost()
50
class res_partner_related_cost_line(osv.osv):
51
_name = 'res.partner.related.cost.line'
53
'factor': fields.float('Factor', digits=(14,4)),
54
'active': fields.boolean('Active'),
55
'product_id': fields.many2one('res.partner', 'Product', required=True, select=True),
56
'relaed_cost_id': fields.many2one('res.partner.related.cost', 'Related Cost', required=True, select=True),
59
'active': lambda *args: 1
61
res_partner_related_cost_line()