~akretion-team/openerp-product-attributes/openerp-product-attributes

« back to all changes in this revision

Viewing changes to product_electronic/product_electronic.py

  • Committer: ced
  • Date: 2007-08-10 07:47:26 UTC
  • Revision ID: ced-20070810074726-5v7gte8bp19tv2pw
Move less used modules to extra_addons repo
(/home/gbaconnier/code/openerp/extra-addons/lp6.1-main rev 495)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
##############################################################################
 
2
#
 
3
# Copyright (c) 2005 TINY SPRL. (http://tiny.be) All Rights Reserved.
 
4
#
 
5
# $Id: product_expiry.py 2103 2006-01-11 21:01:14Z pinky $
 
6
#
 
7
# WARNING: This program as such is intended to be used by professional
 
8
# programmers who take the whole responsability of assessing all potential
 
9
# consequences resulting from its eventual inadequacies and bugs
 
10
# End users who are looking for a ready-to-use solution with commercial
 
11
# garantees and support are strongly adviced to contract a Free Software
 
12
# Service Company
 
13
#
 
14
# This program is Free Software; you can redistribute it and/or
 
15
# modify it under the terms of the GNU General Public License
 
16
# as published by the Free Software Foundation; either version 2
 
17
# of the License, or (at your option) any later version.
 
18
#
 
19
# This program is distributed in the hope that it will be useful,
 
20
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
21
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
22
# GNU General Public License for more details.
 
23
#
 
24
# You should have received a copy of the GNU General Public License
 
25
# along with this program; if not, write to the Free Software
 
26
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
27
#
 
28
##############################################################################
 
29
 
 
30
from osv import fields,osv
 
31
 
 
32
class product_product(osv.osv):
 
33
        _inherit = 'product.product'
 
34
        _name = 'product.product'
 
35
        _columns = {
 
36
                'manufacturer' : fields.many2one('res.partner', 'Manufacturer'),
 
37
                'manufacturer_pname' : fields.char('Manufacturer product name', size=64),
 
38
                'manufacturer_pref' : fields.char('Manufacturer product code', size=64),
 
39
                'attribute_ids': fields.one2many('product.electronic.attribute', 'product_id', 'Attributes'),
 
40
        }
 
41
product_product()
 
42
 
 
43
class product_attribute(osv.osv):
 
44
        _name = "product.electronic.attribute"
 
45
        _description = "Product attributes"
 
46
        _columns = {
 
47
                'name' : fields.char('Attribute', size=64, required=True),
 
48
                'value' : fields.char('Value', size=64),
 
49
                'product_id': fields.many2one('product.product', 'Product', ondelete='cascade'),
 
50
        }
 
51
product_attribute()
 
52
 
 
53