2
Creating a res.partner record
4
!record {model: res.partner, id: kit_partner_A}:
9
Creating a res.partner.address record
11
!record {model: res.partner.address, id: kit_address_A}:
12
partner_id: kit_partner_A
17
!record {model: product.product, id: kit_product_A}:
21
batch_management: true
27
international_status: product_attributes.int_1
31
!record {model: product.product, id: kit_product_B}:
35
batch_management: false
41
international_status: product_attributes.int_1
45
!record {model: product.product, id: kit_product_C}:
49
batch_management: true
55
international_status: product_attributes.int_1
57
Production Lot As (s stands for standard)
59
!record {model: stock.production.lot, id: kit_lot_As}:
61
product_id: kit_product_A
65
Production Lot Cs (s stands for standard)
67
!record {model: stock.production.lot, id: kit_lot_Cs}:
69
product_id: kit_product_C
73
I create empty theoretical composition list 01, productA, ITC, 2010-01-20
75
!record {model: composition.kit, id: kit_compo_01}:
76
composition_type: 'theoretical'
77
composition_product_id: kit_product_A
78
composition_version_txt: 'ITC'
79
composition_creation_date: '2010-01-20'
81
I then create Items for the compo 01 - prodC
83
!record {model: composition.item, id: item_01_01}:
84
item_kit_id: kit_compo_01
85
item_product_id: kit_product_C
87
item_uom_id: product.product_uom_unit
89
!record {model: composition.item, id: item_01_02}:
90
item_kit_id: kit_compo_01
91
item_product_id: kit_product_C
93
item_uom_id: product.product_uom_unit
95
I create empty theoretical composition list 02, productA, OCG, 2010-01-20
97
!record {model: composition.kit, id: kit_compo_02}:
98
composition_type: 'theoretical'
99
composition_product_id: kit_product_A
100
composition_version_txt: 'OCG'
101
composition_creation_date: '2010-01-20'
103
I create empty theoretical composition list 03, productB, OCG, 2010-01-20
105
!record {model: composition.kit, id: kit_compo_03}:
106
composition_type: 'theoretical'
107
composition_product_id: kit_product_B
108
composition_version_txt: 'OCG'
109
composition_creation_date: '2010-01-20'
111
I add a product item to the composition list kit_compo_03
113
!record {model: composition.item, id: item_03_01}:
114
item_kit_id: kit_compo_03
115
item_product_id: kit_product_C
117
item_uom_id: product.product_uom_unit
120
I edit all the journals to include the proprietary instance
122
!python {model: account.journal}: |
123
journal_ids = self.search(cr, uid, [])
124
company = self.pool.get('res.company').browse(cr, uid, uid, context=context)
125
if company and company.instance_id:
126
self.write(cr, uid, journal_ids, {'instance_id': company.instance_id.id})