~openerp-commiter/openobject-addons/extra-6.0

« back to all changes in this revision

Viewing changes to bom_customization/bom_customization.py

- renamed bom_customization into mrp_bom_customization: indeed it makes it more explicit it's a mrp module, better renaming before it's too late.
- added a few comments, especially about the product_variant_multi dependency which is questionnable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- encoding: utf-8 -*-
2
 
##############################################################################
3
 
#
4
 
#    OpenERP, Open Source Management Solution    
5
 
#    Copyright (C) 2009 Smile.fr. All Rights Reserved
6
 
#    authors: Raphaël Valyi, Xavier Fernandez
7
 
#
8
 
#    This program is free software: you can redistribute it and/or modify
9
 
#    it under the terms of the GNU General Public License as published by
10
 
#    the Free Software Foundation, either version 3 of the License, or
11
 
#    (at your option) any later version.
12
 
#
13
 
#    This program is distributed in the hope that it will be useful,
14
 
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
#    GNU General Public License for more details.
17
 
#
18
 
#    You should have received a copy of the GNU General Public License
19
 
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 
#
21
 
##############################################################################
22
 
from osv import fields, osv
23
 
 
24
 
class bom_customization_groups(osv.osv):
25
 
    _name = "bom_customization.bom_customization_groups"
26
 
    
27
 
    _columns = {
28
 
                'name': fields.char('Group Name', size=64, select=1),
29
 
                'key_ids': fields.one2many("bom_customization.bom_customization_keys", 'group_id', "Keys"),
30
 
                'value_ids': fields.one2many("bom_customization.bom_customization_values", 'group_id', "Values"),
31
 
    }
32
 
bom_customization_groups()
33
 
 
34
 
class bom_customization_keys(osv.osv):
35
 
    _name = "bom_customization.bom_customization_keys"
36
 
    
37
 
    _columns = {
38
 
                'name': fields.char('Key Name', size=64, select=1),
39
 
                'group_id': fields.many2one('bom_customization.bom_customization_groups', "Customization Group", required = True),
40
 
    }
41
 
bom_customization_keys()
42
 
 
43
 
class bom_customization_values(osv.osv):
44
 
    _name = "bom_customization.bom_customization_values"
45
 
    
46
 
    _columns = {
47
 
                'name': fields.char('Value Name', size=64, select=1),
48
 
                'group_id': fields.many2one('bom_customization.bom_customization_groups', "Customization Group", required = True),
49
 
    }
50
 
bom_customization_values()
51
 
 
52
 
 
53
 
class sale_order_line_customization(osv.osv):
54
 
    _name = "bom_customization.sale_order_line_customizations"
55
 
    
56
 
    #TODO get rid of name
57
 
    _columns = {
58
 
                'name': fields.related('customization_key_id','name', type="char", string="Name"),
59
 
                #'bom_ids': fields.many2many('mrp.bom','mrp_bom_bom_customizations_rel','bom_customization_id','bom_id',"BoM's"),
60
 
                'sale_order_line_id': fields.many2one('sale.order.line', "Sale order line"),
61
 
                'customization_value_id': fields.many2one('bom_customization.bom_customization_values', 'Customization Value'),
62
 
                'customization_key_id': fields.many2one('bom_customization.bom_customization_keys', 'Customization Key'),
63
 
    }
64
 
sale_order_line_customization()