Merge lp:~savoirfairelinux-openerp/openerp-product-configurator/sale_package_configurator into lp:~akretion-team/openerp-product-configurator/trunk

Proposed by Mathieu Benoit
Status: Needs review
Proposed branch: lp:~savoirfairelinux-openerp/openerp-product-configurator/sale_package_configurator
Merge into: lp:~akretion-team/openerp-product-configurator/trunk
Diff against target: 626 lines (+572/-0)
10 files modified
sale_package_configurator/__init__.py (+24/-0)
sale_package_configurator/__openerp__.py (+88/-0)
sale_package_configurator/demo/product.category.csv (+5/-0)
sale_package_configurator/demo/product.product.csv (+4/-0)
sale_package_configurator/i18n/sale_package_configurator.pot (+50/-0)
sale_package_configurator/sale.py (+44/-0)
sale_package_configurator/sale_package_configurator_view.xml (+28/-0)
sale_package_configurator/wizard/__init__.py (+23/-0)
sale_package_configurator/wizard/package_configurator.py (+256/-0)
sale_package_configurator/wizard/package_configurator.xml (+50/-0)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/openerp-product-configurator/sale_package_configurator
Reviewer Review Type Date Requested Status
Akretion Team Pending
Review via email: mp+220707@code.launchpad.net

Description of the change

When clicking on the "add an item" button in Sales Orders, the user is presented with the list of packages.
The system automatically adds all mandatory products.
The user then sees a screen that will offer him all options for the selected package; if he selects them, they are added to the order.

To post a comment you must log in.

Unmerged revisions

115. By Mathieu Benoit

[IMP] sale_package_configurator: finish documentation to configure the sale_package_configurator.

114. By Mathieu Benoit

[FIX] sale_package_configurator: fix product id when consommable.

113. By Mathieu Benoit

[FIX] remove unused onchange and begin to add demo data.

112. By Mathieu Benoit

[ADD] add sale_package_configurator

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'sale_package_configurator'
2=== added file 'sale_package_configurator/__init__.py'
3--- sale_package_configurator/__init__.py 1970-01-01 00:00:00 +0000
4+++ sale_package_configurator/__init__.py 2014-05-22 19:13:44 +0000
5@@ -0,0 +1,24 @@
6+# -*- coding: utf-8 -*-
7+
8+##############################################################################
9+#
10+# OpenERP, Open Source Management Solution
11+# Copyright (C) 2014 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as
15+# published by the Free Software Foundation, either version 3 of the
16+# License, or (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Affero General Public License for more details.
22+#
23+# You should have received a copy of the GNU Affero General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+##############################################################################
27+
28+import wizard
29+import sale
30\ No newline at end of file
31
32=== added file 'sale_package_configurator/__openerp__.py'
33--- sale_package_configurator/__openerp__.py 1970-01-01 00:00:00 +0000
34+++ sale_package_configurator/__openerp__.py 2014-05-22 19:13:44 +0000
35@@ -0,0 +1,88 @@
36+# -*- encoding: utf-8 -*-
37+##############################################################################
38+#
39+# OpenERP, Open Source Management Solution
40+# This module copyright (C) 2014 Savoir-faire Linux
41+# (<http://www.savoirfairelinux.com>).
42+#
43+# This program is free software: you can redistribute it and/or modify
44+# it under the terms of the GNU Affero General Public License as
45+# published by the Free Software Foundation, either version 3 of the
46+# License, or (at your option) any later version.
47+#
48+# This program is distributed in the hope that it will be useful,
49+# but WITHOUT ANY WARRANTY; without even the implied warranty of
50+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51+# GNU Affero General Public License for more details.
52+#
53+# You should have received a copy of the GNU Affero General Public License
54+# along with this program. If not, see <http://www.gnu.org/licenses/>.
55+#
56+##############################################################################
57+
58+{
59+ "name": "Sales package configurator",
60+ "version": "1.0",
61+ "author": "Savoir-faire Linux",
62+ 'maintainer': 'Savoir-faire Linux',
63+ 'website': 'http://www.savoirfairelinux.com',
64+ 'license': 'AGPL-3',
65+ "category": "Sale",
66+ 'summary': 'Package selector for sales orders.',
67+ "description": """
68+A package product selector for sales orders.
69+
70+How it works
71+============
72+When clicking on the "add an item" button in Sales Orders, the user is \
73+presented with the list of packages.
74+The system automatically adds all mandatory products.
75+The user then sees a screen that will offer him all options for the selected \
76+package; if he selects them, they are added to the \
77+order.
78+
79+IMPORTANT
80+=========
81+TODO:
82+* Work only with product service. Need fix to work with stockable \
83+product.
84+* Need more test when add dependencies on package with category.
85+
86+Configuration
87+=============
88+* Add the repository: lp:openerp-isp/7.0
89+* In Sales \ Configuration \ Products \ Product categories , add "Packages"
90+* In Settings \ Companies \ Companies
91+** Open the main company
92+** In the ISP Contract Management tab, select the category "Packages" in the \
93+field " Default Product Category"
94+* In Sales in \ Products \ Products , add your package product.
95+** Need to be in category "Packages" and add your dependencies to a product \
96+or a category.
97+
98+To manage dependency
99+--------------------
100+* In Settings \ Technical \ Database Structure \ Models :
101+** Find and open the model product.dependency
102+** Click Create a Menu
103+*** Menu name = Product dependencies
104+*** Parent Menu = Sales / Configuration / Products ( you must find this Menu, \
105+not create it)
106+
107+Test
108+====
109+* In the sales menu, create a purchase order,
110+* Click on the "Add an item" button
111+* Select a product ... and follow the steps.
112+ """,
113+ "depends": [
114+ "base",
115+ "sale",
116+ "contract_isp_package_configurator"
117+ ],
118+ "data": [
119+ "sale_package_configurator_view.xml",
120+ "wizard/package_configurator.xml"
121+ ],
122+ "installable": True,
123+}
124
125=== added directory 'sale_package_configurator/demo'
126=== added file 'sale_package_configurator/demo/product.category.csv'
127--- sale_package_configurator/demo/product.category.csv 1970-01-01 00:00:00 +0000
128+++ sale_package_configurator/demo/product.category.csv 2014-05-22 19:13:44 +0000
129@@ -0,0 +1,5 @@
130+External ID,name,parent_id/id
131+product_category_package,Packages,
132+demo_category_2,Produits,demo_category_1
133+demo_category_3,Fruit,demo_category_2
134+demo_category_4,Vegetable,demo_category_2
135
136=== added file 'sale_package_configurator/demo/product.product.csv'
137--- sale_package_configurator/demo/product.product.csv 1970-01-01 00:00:00 +0000
138+++ sale_package_configurator/demo/product.product.csv 2014-05-22 19:13:44 +0000
139@@ -0,0 +1,4 @@
140+id,rental,sale_ok,categ_id/id,name,procure_method,type,supply_method
141+demo_product_product_1,False,True,demo_category_3,Apple,Make to Stock,Stockable Product,Buy
142+demo_product_product_2,False,True,demo_category_3,Pear,Make to Stock,Stockable Product,Buy
143+demo_product_product_3,False,True,demo_category_1,Small package fruit 1,Make to Stock,Service,Buy
144
145=== added directory 'sale_package_configurator/i18n'
146=== added file 'sale_package_configurator/i18n/sale_package_configurator.pot'
147--- sale_package_configurator/i18n/sale_package_configurator.pot 1970-01-01 00:00:00 +0000
148+++ sale_package_configurator/i18n/sale_package_configurator.pot 2014-05-22 19:13:44 +0000
149@@ -0,0 +1,50 @@
150+# Translation of OpenERP Server.
151+# This file contains the translation of the following modules:
152+# * sale_package_configurator
153+#
154+msgid ""
155+msgstr ""
156+"Project-Id-Version: OpenERP Server 7.0\n"
157+"Report-Msgid-Bugs-To: \n"
158+"POT-Creation-Date: 2014-04-07 21:45+0000\n"
159+"PO-Revision-Date: 2014-04-07 21:45+0000\n"
160+"Last-Translator: <>\n"
161+"Language-Team: \n"
162+"MIME-Version: 1.0\n"
163+"Content-Type: text/plain; charset=UTF-8\n"
164+"Content-Transfer-Encoding: \n"
165+"Plural-Forms: \n"
166+
167+#. module: sale_package_configurator
168+#: model:ir.actions.act_window,name:sale_package_configurator.sale_package_configurator_action
169+#: view:sale.order:0
170+msgid "Package Configurator"
171+msgstr ""
172+
173+#. module: sale_package_configurator
174+#: model:ir.model,name:sale_package_configurator.model_contract_service_configurator_dependency_line
175+msgid "contract.service.configurator.dependency.line"
176+msgstr ""
177+
178+#. module: sale_package_configurator
179+#: model:ir.model,name:sale_package_configurator.model_contract_service_configurator
180+msgid "contract.service.configurator"
181+msgstr ""
182+
183+#. module: sale_package_configurator
184+#: code:addons/sale_package_configurator/wizard/package_configurator.py:99
185+#: code:addons/sale_package_configurator/wizard/package_configurator.py:186
186+#, python-format
187+msgid "Cancel"
188+msgstr ""
189+
190+#. module: sale_package_configurator
191+#: model:ir.model,name:sale_package_configurator.model_contract_service_configurator_line
192+msgid "contract.service.configurator.line"
193+msgstr ""
194+
195+#. module: sale_package_configurator
196+#: field:contract.service.configurator,order_id:0
197+msgid "Order ID"
198+msgstr ""
199+
200
201=== added file 'sale_package_configurator/sale.py'
202--- sale_package_configurator/sale.py 1970-01-01 00:00:00 +0000
203+++ sale_package_configurator/sale.py 2014-05-22 19:13:44 +0000
204@@ -0,0 +1,44 @@
205+# -*- encoding: utf-8 -*-
206+##############################################################################
207+#
208+# OpenERP, Open Source Management Solution
209+# This module copyright (C) 2014 Savoir-faire Linux
210+# (<http://www.savoirfairelinux.com>).
211+#
212+# This program is free software: you can redistribute it and/or modify
213+# it under the terms of the GNU Affero General Public License as
214+# published by the Free Software Foundation, either version 3 of the
215+# License, or (at your option) any later version.
216+#
217+# This program is distributed in the hope that it will be useful,
218+# but WITHOUT ANY WARRANTY; without even the implied warranty of
219+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
220+# GNU Affero General Public License for more details.
221+#
222+# You should have received a copy of the GNU Affero General Public License
223+# along with this program. If not, see <http://www.gnu.org/licenses/>.
224+#
225+##############################################################################
226+import logging
227+from openerp.osv import orm
228+
229+_logger = logging.getLogger(__name__)
230+
231+
232+class sale_order(orm.Model):
233+ _inherit = "sale.order"
234+
235+ def sale_package_configurator_action(self, cr, uid, ids, context=None):
236+ # manage only one sale order
237+ ids = ids[0]
238+ so = self.browse(cr, uid, ids, context=context)
239+
240+ return {'type': 'ir.actions.act_window',
241+ 'name': 'Package Configurator',
242+ 'res_model': 'contract.service.configurator',
243+ 'view_type': 'form',
244+ 'view_mode': 'form',
245+ 'target': 'new',
246+ 'context': {'default_pricelist_id': so.pricelist_id.id,
247+ 'default_partner_id': so.partner_id.id,
248+ 'default_order_id': so.id}}
249
250=== added file 'sale_package_configurator/sale_package_configurator_view.xml'
251--- sale_package_configurator/sale_package_configurator_view.xml 1970-01-01 00:00:00 +0000
252+++ sale_package_configurator/sale_package_configurator_view.xml 2014-05-22 19:13:44 +0000
253@@ -0,0 +1,28 @@
254+<openerp>
255+ <data>
256+
257+ <record id="view_sale_package_configurator_form" model="ir.ui.view">
258+ <field name="name">Sale Order Form</field>
259+ <field name="model">sale.order</field>
260+ <field name="inherit_id" ref="sale.view_order_form"/>
261+ <field name="arch" type="xml">
262+ <data>
263+ <xpath expr="//header/field[@name='state']" position="before">
264+ <button name="sale_package_configurator_action" type="object"
265+ string="Add an Item"/>
266+ </xpath>
267+ <xpath expr="//field[@name='order_line']/tree" position="attributes">
268+ <attribute name="create">0</attribute>
269+ </xpath>
270+ <xpath
271+ expr="//field[@name='order_line']/tree/field[@name='price_unit']"
272+ position="attributes">
273+ <attribute name="readonly">0</attribute>
274+ </xpath>
275+
276+ </data>
277+ </field>
278+ </record>
279+
280+ </data>
281+</openerp>
282
283=== added directory 'sale_package_configurator/wizard'
284=== added file 'sale_package_configurator/wizard/__init__.py'
285--- sale_package_configurator/wizard/__init__.py 1970-01-01 00:00:00 +0000
286+++ sale_package_configurator/wizard/__init__.py 2014-05-22 19:13:44 +0000
287@@ -0,0 +1,23 @@
288+# -*- coding: utf-8 -*-
289+
290+##############################################################################
291+#
292+# OpenERP, Open Source Management Solution
293+# Copyright (C) 2014 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
294+#
295+# This program is free software: you can redistribute it and/or modify
296+# it under the terms of the GNU Affero General Public License as
297+# published by the Free Software Foundation, either version 3 of the
298+# License, or (at your option) any later version.
299+#
300+# This program is distributed in the hope that it will be useful,
301+# but WITHOUT ANY WARRANTY; without even the implied warranty of
302+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
303+# GNU Affero General Public License for more details.
304+#
305+# You should have received a copy of the GNU Affero General Public License
306+# along with this program. If not, see <http://www.gnu.org/licenses/>.
307+#
308+##############################################################################
309+
310+import package_configurator
311
312=== added file 'sale_package_configurator/wizard/package_configurator.py'
313--- sale_package_configurator/wizard/package_configurator.py 1970-01-01 00:00:00 +0000
314+++ sale_package_configurator/wizard/package_configurator.py 2014-05-22 19:13:44 +0000
315@@ -0,0 +1,256 @@
316+# -*- coding: utf-8 -*-
317+
318+##############################################################################
319+#
320+# OpenERP, Open Source Management Solution
321+# Copyright (C) 2014 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
322+#
323+# This program is free software: you can redistribute it and/or modify
324+# it under the terms of the GNU Affero General Public License as
325+# published by the Free Software Foundation, either version 3 of the
326+# License, or (at your option) any later version.
327+#
328+# This program is distributed in the hope that it will be useful,
329+# but WITHOUT ANY WARRANTY; without even the implied warranty of
330+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
331+# GNU Affero General Public License for more details.
332+#
333+# You should have received a copy of the GNU Affero General Public License
334+# along with this program. If not, see <http://www.gnu.org/licenses/>.
335+#
336+##############################################################################
337+
338+from openerp.osv import orm, fields
339+from openerp.tools.translate import _
340+
341+
342+class contract_service_configurator_line(orm.TransientModel):
343+ """Model contract.service.configurator.line"""
344+
345+ def _get_product_price(self, cr, uid, ids, field_name, arg, context=None):
346+ return get_prices(self, cr, uid, ids, field_name, arg, context=context)
347+
348+ _name = 'contract.service.configurator.line'
349+ _description = __doc__
350+ _inherit = 'contract.service.configurator.line'
351+ _columns = {
352+ 'price': fields.function(_get_product_price, type="float",
353+ string="Price"),
354+ }
355+
356+ def router(self, cr, uid, ids, data=None, context=None):
357+ stock_move_id = None
358+ if isinstance(ids, list):
359+ ids = ids[0]
360+ line = self.browse(cr, uid, ids, context=context)
361+ if line.state == 'message':
362+ if line.product_id.type == 'product' \
363+ and line.product_id.qty_available > 0.0:
364+ state = 'serial'
365+ else:
366+ state = 'stock'
367+ elif line.state in ('serial', 'stock'):
368+ stock_move_obj = self.pool.get('stock.move')
369+ location_id = self.pool.get('ir.model.data').get_object_reference(
370+ cr, uid, 'stock', 'stock_location_stock')[1]
371+ location_dest_id = line.configurator_id.order_id. \
372+ partner_id.property_stock_customer.id
373+ if line.product_id and line.product_id.uom_id \
374+ and line.product_id.uom_id:
375+ product_uom = line.product_id.uom_id.id
376+ else:
377+ product_uom = None
378+ move = {
379+ 'name': line.product_id and line.product_id.name or '',
380+ 'product_id': line.product_id and line.product_id.id,
381+ 'product_uom': product_uom,
382+ 'prodlot_id': line.serial and line.serial.id or None,
383+ 'location_id': location_id,
384+ 'location_dest_id': location_dest_id,
385+ 'partner_id': line.configurator_id.order_id.partner_id.id,
386+ 'type': 'out'
387+ }
388+ stock_move_id = stock_move_obj.create(
389+ cr, uid, move, context=context)
390+ stock_move_obj.action_confirm(
391+ cr, uid, [stock_move_id], context=context)
392+ stock_move_obj.action_done(
393+ cr, uid, [stock_move_id], context=context)
394+
395+ state = 'done'
396+
397+ line.write({'state': state, 'stock_move_id': stock_move_id})
398+
399+ return line.configurator_id.router(data={})
400+
401+ def unlink(self, cr, uid, ids, context=None):
402+ if isinstance(ids, int):
403+ ids = [ids]
404+
405+ for line in self.browse(cr, uid, ids, context=context):
406+ if line.product_id.type == 'product' and line.stock_move_id:
407+ stock_move_obj = self.pool.get('stock.move')
408+ name = ' '.join([_('Cancel'),
409+ line.product_id and line.product_id.name
410+ or ''])
411+ if line.product_id and line.product_id.uom_id \
412+ and line.product_id.uom_id:
413+ product_uom = line.product_id.uom_id.id
414+ else:
415+ product_uom = None
416+ if line.configurator_id.contract_id:
417+ partner_id = line.configurator_id.contract_id.partner_id.id
418+ else:
419+ partner_id = None
420+ move = {
421+ 'name': name,
422+ 'product_id': line.product_id and line.product_id.id,
423+ 'product_uom': product_uom,
424+ 'prodlot_id': line.serial and line.serial.id or None,
425+ 'location_id': line.stock_move_id.location_dest_id.id,
426+ 'location_dest_id': line.stock_move_id.location_id.id,
427+ 'partner_id': partner_id,
428+ 'type': 'in'
429+ }
430+ stock_move_id = stock_move_obj.create(
431+ cr, uid, move, context=context)
432+ stock_move_obj.action_confirm(
433+ cr, uid, [stock_move_id], context=context)
434+ stock_move_obj.action_done(
435+ cr, uid, [stock_move_id], context=context)
436+
437+ return super(contract_service_configurator_line, self).unlink(
438+ cr, uid, ids, context=context)
439+
440+
441+class contract_service_configurator_dependency_line(orm.TransientModel):
442+ def _get_product_price(self, cr, uid, ids, field_name, arg, context=None):
443+ return get_prices(self, cr, uid, ids, field_name, arg, context=context)
444+
445+ _name = 'contract.service.configurator.dependency.line'
446+ _inherit = 'contract.service.configurator.line'
447+
448+ _order = 'name'
449+
450+ _columns = {
451+ 'price': fields.function(_get_product_price,
452+ type="float", string="Price"),
453+ }
454+
455+
456+class package_configurator(orm.TransientModel):
457+ """Package Configurator wizard"""
458+
459+ _name = 'contract.service.configurator'
460+ _description = __doc__
461+ _inherit = 'contract.service.configurator'
462+
463+ _columns = {
464+ 'order_id': fields.many2one('sale.order', 'Order ID'),
465+ 'state': fields.selection((('draft', _('Start')),
466+ ('product', _('Select product')),
467+ ('dependency', _('Select options')),
468+ ('done', _('Done'))), 'State'),
469+ 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist',
470+ required=True, readonly=True),
471+ 'partner_id': fields.many2one('res.partner', 'Customer', readonly=True,
472+ required=True),
473+ }
474+ _defaults = {'current_product_id': False}
475+
476+ def do_done(self, cr, uid, ids, context=None):
477+ sale_order_line_obj = self.pool.get('sale.order.line')
478+ self.write(cr, uid, ids, {'state': 'done'}, context=context)
479+ wizard = self.browse(cr, uid, ids[0], context=context)
480+
481+ for line in wizard.line_ids:
482+ name = line.product_id and line.product_id.description_sale or ''
483+ price = get_price_from_pricelist(self, cr, uid, wizard,
484+ line.product_id, context=context)
485+ l = {
486+ 'name': name,
487+ 'product_id': line.product_id.id,
488+ 'product_uom_qty': 1,
489+ 'price_unit': price
490+ }
491+ # add taxes from product
492+ lst_tax = line.product_id.taxes_id
493+ if lst_tax:
494+ l['tax_id'] = [(6, 0, [tax.id for tax in lst_tax])]
495+ sale_order_line_obj.create(cr, uid, l, context=context)
496+
497+ return {
498+ 'type': 'ir.actions.act_window',
499+ 'res_model': 'sale.order',
500+ 'view_type': 'form',
501+ 'view_mode': 'form',
502+ 'target': 'current',
503+ 'res_id': wizard.order_id.id,
504+ 'context': context
505+ }
506+
507+ def do_cancel(self, cr, uid, ids, context=None):
508+ if isinstance(ids, int):
509+ ids = [ids]
510+
511+ for line in self.browse(cr, uid, ids[0], context=context).line_ids:
512+ if line.product_id.type == 'product' and line.stock_move_id:
513+ stock_move_obj = self.pool.get('stock.move')
514+ name = ' '.join([_('Cancel'),
515+ line.product_id and
516+ line.product_id.name or ''])
517+ if line.product_id and line.product_id.uom_id \
518+ and line.product_id.uom_id:
519+ product_uom = line.product_id.uom_id
520+ else:
521+ product_uom = None
522+ move = {
523+ 'name': name,
524+ 'product_id': line.product_id and line.product_id.id,
525+ 'product_uom': product_uom,
526+ 'prodlot_id': line.serial and line.serial.id or None,
527+ 'location_id': line.stock_move_id.location_dest_id.id,
528+ 'location_dest_id': line.stock_move_id.location_id.id,
529+ 'partner_id': line.configurator_id.order_id.partner_id.id,
530+ 'type': 'in'
531+ }
532+ stock_move_id = stock_move_obj.create(
533+ cr, uid, move, context=context)
534+ stock_move_obj.action_confirm(
535+ cr, uid, [stock_move_id], context=context)
536+ stock_move_obj.action_done(
537+ cr, uid, [stock_move_id], context=context)
538+
539+ return True
540+
541+
542+def get_price_from_pricelist(self, cr, uid, configurator_id, product_id,
543+ context=None):
544+ ppl_obj = self.pool.get('product.pricelist')
545+ pricelist_id = configurator_id.pricelist_id.id
546+ partner_id = configurator_id.partner_id.id
547+ pricelist_lst = [pricelist_id]
548+ price_lst = ppl_obj.price_get(cr, uid, pricelist_lst,
549+ product_id.id, 1,
550+ partner=partner_id, context=context)
551+ price = price_lst[pricelist_id]
552+ return price
553+
554+
555+def get_prices(self, cr, uid, ids, field_name, arg, context=None):
556+ context = context or {}
557+ result = {}
558+ configurator_line_ids = self.browse(cr, uid, ids, context=context)
559+ # optimize, the pricelist is the same for all line
560+ if not configurator_line_ids:
561+ return result
562+ configurator_id = configurator_line_ids[0].configurator_id
563+ i = 0
564+ # force pricelist of sale_order
565+ for configurator_line in configurator_line_ids:
566+ product_id = configurator_line.product_id
567+ price = get_price_from_pricelist(self, cr, uid, configurator_id,
568+ product_id, context=context)
569+ result[ids[i]] = price
570+ i += 1
571+ return result
572
573=== added file 'sale_package_configurator/wizard/package_configurator.xml'
574--- sale_package_configurator/wizard/package_configurator.xml 1970-01-01 00:00:00 +0000
575+++ sale_package_configurator/wizard/package_configurator.xml 2014-05-22 19:13:44 +0000
576@@ -0,0 +1,50 @@
577+<?xml version="1.0" encoding="utf-8"?>
578+<openerp>
579+ <data>
580+ <record id="view_sale_package_configurator_wizard" model="ir.ui.view">
581+ <field name="name">Package Configurator</field>
582+ <field name="model">contract.service.configurator</field>
583+ <field name="inherit_id"
584+ ref="contract_isp_package_configurator.view_contract_service_configurator"/>
585+ <field name="arch" type="xml">
586+ <xpath expr="//group[@attrs and not(@string)]/div/p"
587+ position="replace">
588+ <p>Click on add to view the available options</p>
589+ </xpath>
590+ <xpath expr="//group[@string='Category']" position="attributes">
591+ <attribute name="invisible">True</attribute>
592+ </xpath>
593+ <xpath expr="//field[@name='current_product_id']"
594+ position="attributes">
595+ <attribute name="class"></attribute>
596+ <attribute name="style">width:50%%</attribute>
597+ </xpath>
598+ <field name="contract_id" position="replace">
599+ <field name="order_id" invisible="1"/>
600+ </field>
601+ <xpath
602+ expr="//group[@string='Products']/group/field/tree/field[@name='serial']"
603+ position="after">
604+ <field name="price"/>
605+ </xpath>
606+ <xpath
607+ expr="//group/field[@name='dependency_ids']/tree/field[@name='product_id']"
608+ position="after">
609+ <field name="price"/>
610+ </xpath>
611+ </field>
612+ </record>
613+
614+ <record id="view_sale_package_configurator_dependency_line_tree"
615+ model="ir.ui.view">
616+ <field name="name">Dependencies</field>
617+ <field name="model">contract.service.configurator.dependency.line</field>
618+ <field name="arch" type="xml">
619+ <tree string="Dependencies" version="7.0">
620+ <field name="name"/>
621+ <field name="price"/>
622+ </tree>
623+ </field>
624+ </record>
625+ </data>
626+</openerp>

Subscribers

People subscribed via source and target branches