1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (C) 2009 Smile.fr. All Rights Reserved
6
# authors: Raphaël Valyi, Xavier Fernandez
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.
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.
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/>.
21
##############################################################################
22
from osv import fields, osv
24
class bom_customization_groups(osv.osv):
25
_name = "bom_customization.bom_customization_groups"
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"),
32
bom_customization_groups()
34
class bom_customization_keys(osv.osv):
35
_name = "bom_customization.bom_customization_keys"
38
'name': fields.char('Key Name', size=64, select=1),
39
'group_id': fields.many2one('bom_customization.bom_customization_groups', "Customization Group", required = True),
41
bom_customization_keys()
43
class bom_customization_values(osv.osv):
44
_name = "bom_customization.bom_customization_values"
47
'name': fields.char('Value Name', size=64, select=1),
48
'group_id': fields.many2one('bom_customization.bom_customization_groups', "Customization Group", required = True),
50
bom_customization_values()
53
class sale_order_line_customization(osv.osv):
54
_name = "bom_customization.sale_order_line_customizations"
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'),
64
sale_order_line_customization()