[IMP] config wizards: add buttons Cancel and Apply on forms
[odoo/odoo.git] / addons / product_manufacturer / product_manufacturer.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 osv import fields, osv
22
23 class product_product(osv.osv):
24     _inherit = 'product.product'
25     _columns = {
26         'manufacturer' : fields.many2one('res.partner', 'Manufacturer'),
27         'manufacturer_pname' : fields.char('Manufacturer Product Name', size=64),
28         'manufacturer_pref' : fields.char('Manufacturer Product Code', size=64),
29         'attribute_ids': fields.one2many('product.manufacturer.attribute', 'product_id', 'Attributes'),
30     }
31 product_product()
32
33 class product_attribute(osv.osv):
34     _name = "product.manufacturer.attribute"
35     _description = "Product attributes"
36     _columns = {
37         'name' : fields.char('Attribute', size=64, required=True),
38         'value' : fields.char('Value', size=64),
39         'product_id': fields.many2one('product.product', 'Product', ondelete='cascade'),
40     }
41 product_attribute()
42
43 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: