Merge lp:~extra-addons-commiter/product-extra-addons/oerp6.1-cleanning into lp:product-extra-addons/oerp6.1-stable

Proposed by Sébastien BEAU - http://www.akretion.com
Status: Merged
Merged at revision: 75
Proposed branch: lp:~extra-addons-commiter/product-extra-addons/oerp6.1-cleanning
Merge into: lp:product-extra-addons/oerp6.1-stable
Diff against target: 1219 lines (+243/-248)
28 files modified
product_brand/__openerp__.py (+1/-1)
product_brand/product_brand.py (+5/-7)
product_custom_attributes/__openerp__.py (+7/-7)
product_custom_attributes/ir_model.py (+6/-13)
product_custom_attributes/product.py (+18/-7)
product_custom_attributes/product_attribute.py (+44/-25)
product_custom_attributes/product_attribute_view.xml (+1/-1)
product_custom_attributes/wizard/open_product_by_attribute_set.py (+7/-7)
product_gift/__openerp__.py (+3/-3)
product_gift/product.py (+7/-10)
product_gift/sale.py (+9/-16)
product_gift/stock.py (+10/-15)
product_images_olbs/__openerp__.py (+2/-2)
product_images_olbs/company.py (+8/-10)
product_images_olbs/product.py (+3/-7)
product_images_olbs/product_images.py (+8/-9)
product_m2mcategories/__openerp__.py (+3/-3)
product_m2mcategories/product.py (+4/-4)
product_multi_price/__openerp__.py (+3/-3)
product_multi_price/account.py (+7/-10)
product_multi_price/product.py (+27/-27)
product_multi_price/product_price_fields.py (+6/-11)
product_prices_on_variant/__openerp__.py (+10/-4)
product_prices_on_variant/product.py (+13/-11)
product_quick_stock_rule/__openerp__.py (+8/-8)
product_quick_stock_rule/product.py (+13/-15)
product_sequence/__openerp__.py (+1/-1)
product_sequence/product_product.py (+9/-11)
To merge this branch: bzr merge lp:~extra-addons-commiter/product-extra-addons/oerp6.1-cleanning
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp no test, review Needs Fixing
Review via email: mp+135019@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi,

When I read the method ``_fix_size_bug`` I do not understand:
 * what is the bug
 * why we need to do that in order to fix the bug

I think that it deserves a comment, at least a pointer to a bug report.

Line 251 : in onchange_name, you should use name.startswith('x_') instead of if name[:2] != 'x_':

Line 690: extra spaces at top of the file ?

Did not understand the purpose of product_price_tax_inc_exc

review: Needs Fixing (no test, review)
Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

Hi the product_price_tax_inc_exc is a module that give the posibility to create a sale order (or invoice) based on tax included or tax excluded. Indeed when your customer do B2C and B2B at the same time, and want to have beautiful price in the two case (9.99; 29.99...) you need to use a tax exclude price for B2C and a tax include price for B2B.
My module allow this (it only work for simple case like we have in europe with only one tax). When you create a sale order you can check the boxe "tax include" and the price will be in tax include with a tax '19.6 tax include' if you don't check the boxe it will use a 'tax exclude price" with a tax "19.6 tax exclude".

Hope my explication are clear.

Maybe it will be better to rename this module by sale_tax_include_exclude, or something like that

Revision history for this message
Benoit Guillot - http://www.akretion.com (benoit-guillot-z) wrote :

Hello Guewen,

> When I read the method ``_fix_size_bug`` I do not understand:
> * what is the bug
> * why we need to do that in order to fix the bug
>
> I think that it deserves a comment, at least a pointer to a bug report.

Actually the bug has been fixed but not merged.
Here is the merge proposal ; https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-579462-cpa/+merge/128003

I will add a comment on the method to explain, and when the bug will be merge we'll be able to remove this method.

> Line 251 : in onchange_name, you should use name.startswith('x_') instead of if name[:2] != 'x_':

All right, I will replace with startswith.

> Line 690: extra spaces at top of the file ?

Probably my mistake, I'll remove it.

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

product_custom_attributes/__openerp__.py
=========================================

* spell checked description (and committed, please pull branch before merging)

product_images_olbs/product_images.py
======================================

I thing I saw dependencies on 'product_images' in another repo. Are there 2 different addons?

* _check_filestore: the translated string in the exception has the substituted value inside.

product_price_tax_inc_exc/__openerp__.py
========================================

empty description

product_price_tax_inc_exc/addons_account_fix_missing_context.patch
===================================================================

do you want to keep this in the repo ?

product_prices_on_variant/__openerp__.py
========================================

empty description

75. By Sébastien BEAU - http://www.akretion.com

[MERGE] merge from cleanning branch, please update the moduel installed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product_brand/__openerp__.py'
2--- product_brand/__openerp__.py 2012-03-27 12:50:22 +0000
3+++ product_brand/__openerp__.py 2012-12-07 12:12:22 +0000
4@@ -26,7 +26,7 @@
5 ###################################################################################
6 {
7 'name': 'Product Brand Manager',
8- 'version': '0.1',
9+ 'version': '6.1.0',
10 'category': 'Product',
11 'description': """This module allows your user to easily manage product brand. You can define brand, attach it a logo and a description.
12 It also allows to attach a partner to a brand.
13
14=== modified file 'product_brand/product_brand.py'
15--- product_brand/product_brand.py 2012-03-27 12:50:22 +0000
16+++ product_brand/product_brand.py 2012-12-07 12:12:22 +0000
17@@ -21,11 +21,11 @@
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 # #
20 #################################################################################
21-from osv import osv, fields
22-import os
23+from openerp.osv.orm import Model
24+from openerp.osv import fields
25
26-class product_brand(osv.osv):
27- _name = 'product.brand'
28+class product_brand(Model):
29+ _name = 'product.brand'
30 _columns = {
31 'name': fields.char('Brand Name',size=32),
32 'description': fields.text('Description',translate=True),
33@@ -33,13 +33,11 @@
34 'logo': fields.binary('Logo File')
35 }
36
37-product_brand()
38
39-class product_template(osv.osv):
40+class product_template(Model):
41 _name = 'product.template'
42 _inherit = 'product.template'
43 _columns = {
44 'product_brand_id' : fields.many2one('product.brand','Brand', help='Select a brand for this product'),
45 }
46
47-product_template()
48
49=== modified file 'product_custom_attributes/__openerp__.py'
50--- product_custom_attributes/__openerp__.py 2012-08-18 16:32:28 +0000
51+++ product_custom_attributes/__openerp__.py 2012-12-07 12:12:22 +0000
52@@ -23,21 +23,21 @@
53
54 {
55 'name': 'product_custom_attributes',
56- 'version': '0.1',
57+ 'version': '6.1.0',
58 'category': 'Generic Modules/Others',
59 'license': 'AGPL-3',
60 'description': """
61- This module add the posibility to create easily custom field on product.
62- Each product can be link to an attributes set (like camera, fridge...)
63- And each attributs have custom fields (for example you don't need the same field for a frigde and a camera)
64-
65+ This module adds the posibility to easily create custom fields on products.
66+ Each product can be linked to an attribute set (such as camera, fridge...)
67+ and each attribute set has custom fields (for example you don't need the same field for a frigde and a camera)
68+
69 Need to install the lib unicode2ascii, http://github.com/akretion/unicode2ascii.git
70 """,
71 'author': 'Akretion',
72 'website': 'http://www.akretion.com/',
73- 'depends': ['product','stock'],
74+ 'depends': ['product','stock'],
75 'init_xml': [],
76- 'update_xml': [
77+ 'update_xml': [
78 'ir_model_view.xml',
79 'product_attribute_view.xml',
80 'product_view.xml',
81
82=== modified file 'product_custom_attributes/ir_model.py'
83--- product_custom_attributes/ir_model.py 2012-08-09 10:01:01 +0000
84+++ product_custom_attributes/ir_model.py 2012-12-07 12:12:22 +0000
85@@ -19,23 +19,16 @@
86 # #
87 ###############################################################################
88
89-from osv import osv, fields
90-import netsvc
91-
92-
93-class ir_model_fields(osv.osv):
94-
95+from openerp.osv.orm import Model
96+from openerp.osv import fields
97+
98+
99+class ir_model_fields(Model):
100+
101 _inherit = "ir.model.fields"
102-
103-
104 _columns = {
105 'field_description': fields.char('Field Label', required=True, size=256, translate=True),
106 }
107-
108- _defaults = {
109-
110- }
111-
112 _sql_constraints = [
113 ('name_model_uniq', 'unique (name, model_id)', 'The name of the field has to be uniq for a given model !'),
114 ]
115
116=== modified file 'product_custom_attributes/product.py'
117--- product_custom_attributes/product.py 2012-08-28 22:35:57 +0000
118+++ product_custom_attributes/product.py 2012-12-07 12:12:22 +0000
119@@ -19,12 +19,13 @@
120 # #
121 ###############################################################################
122
123-from osv import osv, fields
124-import netsvc
125+from openerp.osv.orm import Model
126+from openerp.osv import fields
127+from openerp.osv.osv import except_osv
128 from lxml import etree
129 from tools.translate import _
130
131-class product_template(osv.osv):
132+class product_template(Model):
133
134 _inherit = "product.template"
135
136@@ -32,7 +33,7 @@
137 'attribute_custom_tmpl': fields.serialized('Custom Template Attributes'),
138 }
139
140-class product_product(osv.osv):
141+class product_product(Model):
142
143 _inherit = "product.product"
144
145@@ -41,6 +42,15 @@
146 'attribute_custom_variant': fields.serialized('Custom Variant Attributes'),
147 }
148
149+ def _fix_size_bug(self, cr, uid, result, context=None):
150+ #When created a field text dynamicaly, its size is limited to 64 in the view.
151+ #The bug is fixed but not merged
152+ #https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-579462-cpa/+merge/128003
153+ #TO remove when the fix will be merged
154+ for field in result['fields']:
155+ if result['fields'][field]['type'] == 'text':
156+ if 'size' in result['fields'][field]: del result['fields'][field]['size']
157+ return result
158
159 def open_attributes(self, cr, uid, ids, context=None):
160 ir_model_data_obj = self.pool.get('ir.model.data')
161@@ -50,7 +60,7 @@
162 set_id = self.read(cr, uid, ids, fields=['attribute_set_id'], context=context)[0]['attribute_set_id']
163
164 if not set_id:
165- raise osv.except_osv(_('User Error'), _('Please choose an attribute set before opening the product attributes'))
166+ raise except_osv(_('User Error'), _('Please choose an attribute set before opening the product attributes'))
167
168 return {
169 'name': 'Product Attributes',
170@@ -73,14 +83,14 @@
171 kwargs = {'name': "%s" % attribute.name}
172 if attribute.ttype == 'many2many':
173 parent = etree.SubElement(page, 'group', colspan="2", col="4")
174- sep = etree.SubElement(parent, 'separator',
175+ sep = etree.SubElement(parent, 'separator',
176 string="%s" % attribute.field_description, colspan="4")
177 kwargs['nolabel'] = "1"
178 if attribute.ttype in ['many2one', 'many2many']:
179 kwargs['domain'] = "[('attribute_id', '=', %s)]" % attribute.attribute_id.id
180 field = etree.SubElement(parent, 'field', **kwargs)
181 return parent
182-
183+
184 def _build_attributes_notebook(self, cr, uid, set_id, context=None):
185 attribute_set = self.pool.get('attribute.set').browse(cr, uid, set_id, context=context)
186 notebook = etree.Element('notebook', name="attributes_notebook", colspan="4")
187@@ -114,4 +124,5 @@
188 info_page = eview.xpath("//page[@string='Information']")[0]
189 info_page.addnext(main_page)
190 result['arch'] = etree.tostring(eview, pretty_print=True)
191+ result = self._fix_size_bug(cr, uid, result, context=context)
192 return result
193
194=== modified file 'product_custom_attributes/product_attribute.py'
195--- product_custom_attributes/product_attribute.py 2012-09-05 08:41:29 +0000
196+++ product_custom_attributes/product_attribute.py 2012-12-07 12:12:22 +0000
197@@ -19,12 +19,13 @@
198 # #
199 ###############################################################################
200
201-from osv import osv, fields
202-import netsvc
203+from openerp.osv.orm import Model
204+from openerp.osv import fields
205+from openerp.osv.osv import except_osv
206+from openerp.tools.translate import _
207 from unidecode import unidecode # Debian package python-unidecode
208-from tools.translate import _
209
210-class attribute_option(osv.osv):
211+class attribute_option(Model):
212 _name = "attribute.option"
213 _description = "Attribute Option"
214 _order="sequence"
215@@ -35,25 +36,37 @@
216 'sequence': fields.integer('Sequence'),
217 }
218
219-class product_attribute(osv.osv):
220
221+class product_attribute(Model):
222 _name = "product.attribute"
223 _description = "Product Attribute"
224-
225 _inherits = {'ir.model.fields': 'field_id'}
226-
227 _columns = {
228 'field_id': fields.many2one('ir.model.fields', 'Ir Model Fields', required=True, ondelete="cascade"),
229- 'attribute_type': fields.selection([('char','Char'),('text','Text'),('select','Select'),('multiselect','Multiselect'),('boolean','Boolean'),('integer','Integer'),('date','Date'),('datetime','Datetime'),('binary','Binary'),('float','Float')],'Type', required=True),
230- 'serialized': fields.boolean('Field serialized', help="If serialized, the field will be stocked in the serialized field : attribute_custom_tmpl or attribute_custom_variant depending on the field based_on"),
231- 'based_on': fields.selection([('product_template','Product Template'),('product_product','Product Variant')],'Based on', required=True),
232+ 'attribute_type': fields.selection([('char','Char'),
233+ ('text','Text'),
234+ ('select','Select'),
235+ ('multiselect','Multiselect'),
236+ ('boolean','Boolean'),
237+ ('integer','Integer'),
238+ ('date','Date'),
239+ ('datetime','Datetime'),
240+ ('binary','Binary'),
241+ ('float','Float')],
242+ 'Type', required=True),
243+ 'serialized': fields.boolean('Field serialized',
244+ help="If serialized, the field will be stocked in the serialized field: "
245+ "attribute_custom_tmpl or attribute_custom_variant depending on the field based_on"),
246+ 'based_on': fields.selection([('product_template','Product Template'),
247+ ('product_product','Product Variant')],
248+ 'Based on', required=True),
249 'option_ids': fields.one2many('attribute.option', 'attribute_id', 'Attribute Option'),
250 'create_date': fields.datetime('Created date', readonly=True),
251- }
252+ }
253
254 def create(self, cr, uid, vals, context=None):
255 if vals.get('based_on') == 'product_template':
256- vals['model_id'] = self.pool.get('ir.model').search(cr, uid, [('model', '=', 'product.template')],context=context)[0]
257+ vals['model_id'] = self.pool.get('ir.model').search(cr, uid, [('model', '=', 'product.template')], context=context)[0]
258 serial_name = 'attribute_custom_tmpl'
259 else:
260 vals['model_id'] = self.pool.get('ir.model').search(cr, uid, [('model', '=', 'product.product')], context=context)[0]
261@@ -67,7 +80,7 @@
262 vals['ttype'] = 'many2many'
263 vals['relation'] = 'attribute.option'
264 if not vals.get('serialized'):
265- raise osv.except_osv(_('Create Error'), _("The field serialized should be ticked for a multiselect field !"))
266+ raise except_osv(_('Create Error'), _("The field serialized should be ticked for a multiselect field !"))
267 else:
268 vals['ttype'] = vals['attribute_type']
269 vals['state'] = 'manual'
270@@ -78,24 +91,26 @@
271 if field_description:
272 name = unidecode('x_%s' % field_description.replace(' ', '_').lower())
273 return {'value' : {'name' : name}}
274-
275-class attribute_location(osv.osv):
276-
277+
278+ def onchange_name(self, cr, uid, ids, name, context=None):
279+ if not name.startswith('x_'):
280+ name = 'x_%s' % name
281+ return {'value' : {'name' : unidecode(name)}}
282+
283+class attribute_location(Model):
284 _name = "attribute.location"
285 _description = "Attribute Location"
286 _order="sequence"
287-
288 _inherits = {'product.attribute': 'attribute_id'}
289-
290 _columns = {
291 'attribute_id': fields.many2one('product.attribute', 'Product Attribute', required=True, ondelete="cascade"),
292 'attribute_set_id': fields.related('attribute_group_id', 'attribute_set_id', type='many2one', relation='attribute.set', string='Attribute Set', store=True, readonly=True),
293 'attribute_group_id': fields.many2one('attribute.group', 'Attribute Group', required=True),
294 'sequence': fields.integer('Sequence'),
295- }
296-
297-class attribute_group(osv.osv):
298-
299+ }
300+
301+
302+class attribute_group(Model):
303 _name= "attribute.group"
304 _description = "Attribute Group"
305 _order="sequence"
306@@ -107,13 +122,17 @@
307 'sequence': fields.integer('Sequence'),
308 }
309
310-class attribute_set(osv.osv):
311+ def create(self, cr, uid, vals, context=None):
312+ for attribute in vals['attribute_ids']:
313+ if attribute[2] and not attribute[2].get('attribute_set_id'):
314+ attribute[2]['attribute_set_id'] = vals['attribute_set_id']
315+ return super(attribute_group, self).create(cr, uid, vals, context)
316
317+class attribute_set(Model):
318 _name = "attribute.set"
319 _description = "Attribute Set"
320-
321 _columns = {
322 'name': fields.char('Name', size=128, required=True),
323 'attribute_group_ids': fields.one2many('attribute.group', 'attribute_set_id', 'Attribute Groups'),
324- }
325+ }
326
327
328=== modified file 'product_custom_attributes/product_attribute_view.xml'
329--- product_custom_attributes/product_attribute_view.xml 2012-09-04 08:39:59 +0000
330+++ product_custom_attributes/product_attribute_view.xml 2012-12-07 12:12:22 +0000
331@@ -86,7 +86,7 @@
332 <field name="arch" type="xml">
333 <form string="Product Attribute" col="8">
334 <field name="field_description" colspan="1" on_change="onchange_field_description(field_description, context)"/>
335- <field name="name" colspan="1" attrs="{'readonly':[('create_date', '!=', False)]}"/>
336+ <field name="name" colspan="1" attrs="{'readonly':[('create_date', '!=', False)]}" on_change="onchange_name(name, context)"/>
337 <field name="attribute_type" colspan="1"/>
338 <field name="based_on" colspan="1"/>
339 <field name="serialized" colspan="1"/>
340
341=== modified file 'product_custom_attributes/wizard/open_product_by_attribute_set.py'
342--- product_custom_attributes/wizard/open_product_by_attribute_set.py 2012-08-03 14:33:51 +0000
343+++ product_custom_attributes/wizard/open_product_by_attribute_set.py 2012-12-07 12:12:22 +0000
344@@ -19,11 +19,11 @@
345 # #
346 ###############################################################################
347
348-from osv import osv, fields
349-import netsvc
350-
351-
352-class open_product_by_attribute_set(osv.osv_memory):
353+from openerp.osv.orm import TransientModel
354+from osv import fields
355+
356+
357+class open_product_by_attribute_set(TransientModel):
358 _name = 'open.product.by.attribute.set'
359 _description = 'Wizard to open product by attributes set'
360
361@@ -44,9 +44,9 @@
362 if context is None:
363 context = {}
364 attribute_set = self.browse(cr, uid, ids[0], context=context).attribute_set_id
365- data = self.read(cr, uid, ids, [], context=context)[0]
366+ data = self.read(cr, uid, ids, [], context=context)[0] # XXX used?
367 result = mod_obj.get_object_reference(cr, uid, 'product', 'product_normal_action')
368- id = result and result[1] or False
369+ id = result[1] if result else False
370 result = act_obj.read(cr, uid, [id], context=context)[0]
371 result['context'] = "{'set_id': %s, 'open_product_by_attribute_set': %s}"%(attribute_set.id, True)
372 result['domain'] = "[('attribute_set_id', '=', %s)]" % attribute_set.id
373
374=== modified file 'product_gift/__openerp__.py'
375--- product_gift/__openerp__.py 2012-05-17 09:54:58 +0000
376+++ product_gift/__openerp__.py 2012-12-07 12:12:22 +0000
377@@ -22,13 +22,13 @@
378
379 {
380 'name': 'product_gift',
381- 'version': '0.1',
382+ 'version': '6.1.0',
383 'category': 'Generic Modules',
384 'license': 'AGPL-3',
385- 'description': """This modules add the feature of gift_wrap and give the posibility to add present message on the order or the order line""",
386+ 'description': """This module adds the gift_wrap feature and gives the possibility to add a gift message on the order or the order line.""",
387 'author': 'Akretion',
388 'website': 'http://www.akretion.com/',
389- 'depends': ['sale','product', 'stock'],
390+ 'depends': ['sale','product', 'stock'],
391 'init_xml': [],
392 'update_xml': [
393 'stock_view.xml',
394
395=== modified file 'product_gift/product.py'
396--- product_gift/product.py 2011-12-01 13:34:58 +0000
397+++ product_gift/product.py 2012-12-07 12:12:22 +0000
398@@ -19,18 +19,15 @@
399 # #
400 #################################################################################
401
402-from osv import osv, fields
403-
404-
405-class product_product(osv.osv):
406+from openerp.osv.orm import Model
407+from openerp.osv import fields
408+
409+
410+class product_product(Model):
411 _inherit = "product.product"
412-
413 _columns = {
414 'allow_gift_wrap': fields.boolean('Allow Gift Wrap', help="Determine if the product can have the option gift wrap on the sale order line"),
415- }
416-
417+ }
418 _defaults = {
419 'allow_gift_wrap': True,
420- }
421-
422-product_product()
423+ }
424
425=== modified file 'product_gift/sale.py'
426--- product_gift/sale.py 2012-01-09 13:05:41 +0000
427+++ product_gift/sale.py 2012-12-07 12:12:22 +0000
428@@ -20,38 +20,31 @@
429 # #
430 #################################################################################
431
432-from osv import osv, fields
433-
434-
435-class sale_order(osv.osv):
436-
437+from openerp.osv.orm import Model
438+from openerp.osv import fields
439+
440+
441+class sale_order(Model):
442 _inherit = "sale.order"
443-
444 _columns = {
445 'gift_message': fields.text('Gift Message'),
446- }
447+ }
448
449 def _prepare_order_picking(self, cr, uid, order, *args, **kwargs):
450 values = super(sale_order, self)._prepare_order_picking(cr, uid, order, *args, **kwargs)
451 values.update({'gift_message' : order.gift_message})
452 return values
453
454-sale_order()
455-
456-
457-class sale_order_line(osv.osv):
458-
459+
460+class sale_order_line(Model):
461 _inherit = "sale.order.line"
462-
463 _columns = {
464 'gift_message': fields.text('Gift Message'),
465 'need_gift_wrap': fields.boolean('Add Gift Wrap'),
466- }
467+ }
468
469 def _prepare_order_line_move(self, cr, uid, order, line, picking_id, date_planned, *args, **kwargs):
470 values = super(sale_order_line, self)._prepare_order_line_move(cr, uid, order, line, picking_id, date_planned, *args, **kwargs)
471 values.update({'gift_message': line.gift_message,
472 'need_gift_wrap': line.need_gift_wrap})
473 return values
474-
475-sale_order_line()
476
477=== modified file 'product_gift/stock.py'
478--- product_gift/stock.py 2011-12-03 12:02:32 +0000
479+++ product_gift/stock.py 2012-12-07 12:12:22 +0000
480@@ -19,30 +19,25 @@
481 # #
482 #################################################################################
483
484-from osv import osv, fields
485-
486-
487-class stock_picking(osv.osv):
488+from openerp.osv.orm import Model
489+from openerp.osv import fields
490+
491+
492+class stock_picking(Model):
493 _inherit = "stock.picking"
494-
495 _columns = {
496 'gift_message': fields.text('Gift Message'),
497- }
498-
499-stock_picking()
500-
501-
502-class stock_move(osv.osv):
503+ }
504+
505+
506+class stock_move(Model):
507 _inherit = "stock.move"
508-
509 _columns = {
510 'gift_message': fields.text('Gift Message'),
511 'need_gift_wrap': fields.boolean('Need Gift Wrap'),
512- }
513+ }
514
515 def _prepare_chained_picking(self, cr, uid, pick_name, picking, ptype, move, context=None):
516 res = super(stock_move, self)._prepare_chained_picking(cr, uid, pick_name, picking, ptype, move, context=context)
517 res['gift_message'] = picking.gift_message
518 return res
519-
520-stock_move()
521
522=== modified file 'product_images_olbs/__openerp__.py'
523--- product_images_olbs/__openerp__.py 2012-05-17 12:00:14 +0000
524+++ product_images_olbs/__openerp__.py 2012-12-07 12:12:22 +0000
525@@ -17,7 +17,7 @@
526
527 {
528 "name" : "Product Image Gallery",
529- "version" : "0.1 ",
530+ "version" : "6.1.1",
531 "author" : "Sharoon Thomas, Open Labs Business Solutions",
532 "website" : "http://openlabs.co.in/",
533 "category" : "Added functionality - Product Extension",
534@@ -25,7 +25,7 @@
535 "description": """
536 This Module implements an Image Gallery for products.
537 You can add images against every product.
538-
539+
540 This module is generic but built for Magento ERP connector and
541 the upcoming e-commerce system for Open ERP by Open Labs
542 """,
543
544=== modified file 'product_images_olbs/company.py'
545--- product_images_olbs/company.py 2012-03-08 18:41:21 +0000
546+++ product_images_olbs/company.py 2012-12-07 12:12:22 +0000
547@@ -18,24 +18,22 @@
548 #
549 ##############################################################################
550
551-from osv import fields, osv
552-from tools.translate import _
553+from openerp.osv.orm import Model
554+from openerp.osv import fields
555
556-class ResCompany(osv.osv):
557+class ResCompany(Model):
558 """Override company to add images configuration"""
559 _inherit = "res.company"
560- _columns = {
561+ _columns = {
562 'local_media_repository':fields.char(
563- 'Images Repository Path',
564+ 'Images Repository Path',
565 size=256,
566 help='Local mounted path on OpenERP server where all your images are stored.'
567- ),
568- }
569-
570+ ),
571+ }
572+
573 def get_local_media_repository(self, cr, uid, id=None, context=None):
574 if id:
575 return self.browse(cr, uid, id, context=context).local_media_repository
576 user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
577 return user.company_id.local_media_repository
578-
579-ResCompany()
580
581=== modified file 'product_images_olbs/product.py'
582--- product_images_olbs/product.py 2012-06-27 10:30:03 +0000
583+++ product_images_olbs/product.py 2012-12-07 12:12:22 +0000
584@@ -19,13 +19,12 @@
585 import os
586 import shutil
587 import logging
588-import unicodedata
589 import base64, urllib
590
591-from osv import osv,fields
592-from tools.translate import _
593+from openerp.osv.orm import Model
594+from openerp.osv import fields
595
596-class product_product(osv.osv):
597+class product_product(Model):
598 _inherit = "product.product"
599
600 def copy(self, cr, uid, id, default=None, context=None):
601@@ -108,6 +107,3 @@
602 }
603 new_image_id = self.pool.get('product.images').create(cr, uid, data, context=context)
604 return True
605-
606-
607-product_product()
608
609=== modified file 'product_images_olbs/product_images.py'
610--- product_images_olbs/product_images.py 2012-06-27 10:30:03 +0000
611+++ product_images_olbs/product_images.py 2012-12-07 12:12:22 +0000
612@@ -16,7 +16,9 @@
613 #You should have received a copy of the GNU General Public License #
614 #along with this program. If not, see <http://www.gnu.org/licenses/>. #
615 #########################################################################
616-from osv import osv, fields
617+from openerp.osv.orm import Model
618+from openerp.osv import fields
619+from openerp.osv.osv import except_osv
620 import base64, urllib
621 from tools.translate import _
622 import os
623@@ -27,7 +29,7 @@
624 #TODO find a good solution in order to roll back changed done on file system
625 #TODO add the posibility to move from a store system to an other (example : moving existing image on database to file system)
626
627-class product_images(osv.osv):
628+class product_images(Model):
629 "Products Image gallery"
630 _name = "product.images"
631 _description = __doc__
632@@ -134,7 +136,7 @@
633 if not os.path.exists(dir_path):
634 os.makedirs(dir_path)
635 except OSError, e:
636- raise osv.except_osv(_('Error'), _('The image filestore can not be created, %s'%e))
637+ raise except_osv(_('Error'), _('The image filestore can not be created, %s')%e)
638 return True
639
640 def _save_file(self, path, b64_file):
641@@ -160,13 +162,10 @@
642 'url':fields.char('File Location', size=250),
643 'comments':fields.text('Comments'),
644 'product_id':fields.many2one('product.product', 'Product')
645- }
646-
647+ }
648 _defaults = {
649 'link': lambda *a: False,
650- }
651-
652+ }
653 _sql_constraints = [('uniq_name_product_id', 'UNIQUE(product_id, name)',
654- _('A product can have only one image with the same name'))]
655+ _('A product can have only one image with the same name'))]
656
657-product_images()
658
659=== modified file 'product_m2mcategories/__openerp__.py'
660--- product_m2mcategories/__openerp__.py 2012-05-17 10:24:04 +0000
661+++ product_m2mcategories/__openerp__.py 2012-12-07 12:12:22 +0000
662@@ -17,16 +17,16 @@
663
664 {
665 "name" : "Product - Many Categories",
666- "version" : "1.0.2",
667+ "version" : "6.1.0",
668 "author" : "Sharoon Thomas",
669 "website" : "",
670 "category" : "Added functionality",
671 "depends" : ['base','product'],
672 "description": """
673- This module Extends the existing functionality of Open ERP Products (One product - One Catgory)
674+ This module extends the existing functionality of OpenERP Products (One product -> One Category)
675 to One product -> Many Categories
676
677- *Note: This module was built generically but in focus of the Magento Open ERP connector
678+ *Note: This module was built generically but in focus of the Magento OpenERP connector
679 """,
680 "init_xml": [],
681 "update_xml": [
682
683=== modified file 'product_m2mcategories/product.py'
684--- product_m2mcategories/product.py 2009-09-20 23:10:21 +0000
685+++ product_m2mcategories/product.py 2012-12-07 12:12:22 +0000
686@@ -14,12 +14,12 @@
687 #You should have received a copy of the GNU General Public License #
688 #along with this program. If not, see <http://www.gnu.org/licenses/>. #
689 #########################################################################
690-from osv import osv,fields
691+from openerp.osv.orm import Model
692+from openerp.osv import fields
693
694-class product_product(osv.osv):
695+class product_product(Model):
696 _inherit = "product.template"
697 _columns = {
698 'categ_id': fields.many2one('product.category','Pricing/Primary Category', required=True, change_default=True),
699 'categ_ids': fields.many2many('product.category','product_categ_rel','product_id','categ_id','Product Categories')
700- }
701-product_product()
702+ }
703
704=== modified file 'product_multi_price/__openerp__.py'
705--- product_multi_price/__openerp__.py 2012-07-18 07:57:14 +0000
706+++ product_multi_price/__openerp__.py 2012-12-07 12:12:22 +0000
707@@ -22,15 +22,15 @@
708
709 {
710 'name': 'product_multi_price',
711- 'version': '0.1',
712+ 'version': '6.1.0',
713 'category': 'Generic Modules/Others',
714 'license': 'AGPL-3',
715 'description': """empty""",
716 'author': 'Akretion',
717 'website': 'http://www.akretion.com/',
718- 'depends': ['product','account', 'sale','product_prices_on_variant'],
719+ 'depends': ['product','account', 'sale','product_prices_on_variant'],
720 'init_xml': [],
721- 'update_xml': [
722+ 'update_xml': [
723 'product_price_fields_view.xml',
724 'product_view.xml',
725 'product_price_field_config.xml',
726
727=== modified file 'product_multi_price/account.py'
728--- product_multi_price/account.py 2012-07-06 09:26:51 +0000
729+++ product_multi_price/account.py 2012-12-07 12:12:22 +0000
730@@ -19,17 +19,14 @@
731 # #
732 ###############################################################################
733
734-from osv import osv, fields
735-import netsvc
736-
737-class account_tax(osv.osv):
738-
739+from openerp.osv.orm import Model
740+from openerp.osv import fields
741+
742+class account_tax(Model):
743 _inherit = 'account.tax'
744-
745 _columns = {
746- 'related_inc_tax_id': fields.many2one('account.tax', 'Related Included Tax'),
747- }
748-
749+ 'related_inc_tax_id': fields.many2one('account.tax', 'Related Included Tax', domain=[('price_include','=', True)]),
750+ }
751
752 # overload def compute all but add a choice for the decimal precision
753 def compute_all_with_precision(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, force_excluded=False, precision=None):
754@@ -68,4 +65,4 @@
755 'total': totalex,
756 'total_included': totalin,
757 'taxes': tin + tex
758- }
759+ }
760
761=== modified file 'product_multi_price/product.py'
762--- product_multi_price/product.py 2012-09-05 13:40:51 +0000
763+++ product_multi_price/product.py 2012-12-07 12:12:22 +0000
764@@ -19,16 +19,14 @@
765 # #
766 #################################################################################
767
768-from osv import osv, orm, fields
769-import netsvc
770+from openerp.osv.orm import Model, setup_modifiers
771+from openerp.osv.osv import except_osv
772 from lxml import etree
773-import decimal_precision as dp
774 from tools.translate import _
775
776
777
778-class product_product(osv.osv):
779-
780+class product_product(Model):
781 _inherit = "product.product"
782
783 def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
784@@ -73,19 +71,19 @@
785 if btn:
786 btn = btn[0]
787 group_ex = etree.Element('group', colspan="2", col="11")
788- separator_ex = etree.SubElement(
789+ _separator_ex = etree.SubElement(
790 group_ex,
791 'separator',
792 colspan="10",
793 string="Tax exclude prices")
794 group_inc = etree.Element('group', colspan="2", col="11")
795- separator_inc = etree.SubElement(
796+ _separator_inc = etree.SubElement(
797 group_inc,
798 'separator',
799 colspan="10",
800 string="Tax include prices")
801 group_sep = etree.Element('group', colspan="2", col="11")
802- separator_end = etree.SubElement(
803+ _separator_end = etree.SubElement(
804 group_sep,
805 'separator',
806 colspan="11")
807@@ -96,7 +94,7 @@
808 button_parent = group_inc
809 else:
810 button_parent = group_ex
811- button = etree.SubElement(
812+ _button = etree.SubElement(
813 button_parent,
814 'button',
815 colspan="1",
816@@ -116,19 +114,19 @@
817 tax_ex = True
818 inc_readonly = "1"
819 ex_readonly = "0"
820- label = etree.SubElement(
821+ _label = etree.SubElement(
822 parent,
823 'label',
824 colspan="3",
825 string="%s" % field.name)
826- basedon = etree.SubElement(
827+ _basedon = etree.SubElement(
828 parent,
829 'field',
830 name="%s" % field.basedon_field_id.name,
831 colspan="4",
832 nolabel="1")
833- orm.setup_modifiers(
834- basedon, field=result['fields'][field.basedon_field_id.name], context=context)
835+ setup_modifiers(
836+ _basedon, field=result['fields'][field.basedon_field_id.name], context=context)
837 coef = etree.SubElement(
838 parent,
839 'field',
840@@ -137,8 +135,9 @@
841 string="Coef",
842 colspan="1",
843 attrs="{'readonly':[('%s','!=','product_coef')]}" % field.basedon_field_id.name)
844- orm.setup_modifiers(
845- coef, field=result['fields'][field.product_coef_field_id.name], context=context)
846+ setup_modifiers(coef,
847+ field=result['fields'][field.product_coef_field_id.name],
848+ context=context)
849 price = etree.SubElement(
850 parent,
851 'field',
852@@ -148,8 +147,9 @@
853 nolabel="1",
854 readonly = ex_readonly,
855 attrs="{'readonly':[('%s','!=','manual')]}" % field.basedon_field_id.name)
856- orm.setup_modifiers(
857- price, field=result['fields'][field.field_name], context=context)
858+ setup_modifiers(price,
859+ field=result['fields'][field.field_name],
860+ context=context)
861 inc_price = etree.SubElement(
862 parent,
863 'field',
864@@ -159,8 +159,9 @@
865 nolabel="1",
866 readonly = inc_readonly,
867 attrs="{'readonly':[('%s','!=','manual')]}" % field.basedon_field_id.name)
868- orm.setup_modifiers(
869- inc_price, field=result['fields'][field.inc_price_field_id.name], context=context)
870+ setup_modifiers(inc_price,
871+ field=result['fields'][field.inc_price_field_id.name],
872+ context=context)
873 arch = etree.Element('group', colspan="2", col="11")
874 if tax_inc:
875 arch.extend(group_inc)
876@@ -268,7 +269,7 @@
877 if name:
878 if name == 'list_price':
879 price_name = 'list_price'
880- else:
881+ else:
882 price_name = 'x_pm_price_' + name
883 tax_inc = False
884 price_field_ids = prod_price_fields_obj.search(cr, uid, [
885@@ -285,7 +286,7 @@
886 if result['standard_price']:
887 if tax_inc and result.get('taxes_id'):
888 if not tax.related_inc_tax_id:
889- raise osv.except_osv(_("No related tax"), _("You need to define a related included tax for the sale tax!"))
890+ raise except_osv(_("No related tax"), _("You need to define a related included tax for the sale tax!"))
891 taxes = tax_obj.compute_all_with_precision(cr, uid, [tax.related_inc_tax_id], result['x_pm_inc_price_' + name], 1, precision=6)
892 result[price_name] = taxes['total']
893 elif result.get('taxes_id'):
894@@ -328,10 +329,9 @@
895 results = super(product_product, self).read(cr, uid, ids, fields=fields, context=context, load=load)
896 return results
897
898-product_product()
899-
900-class product_category(osv.osv):
901-
902+
903+
904+class product_category(Model):
905 _inherit = 'product.category'
906
907 def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
908@@ -345,14 +345,14 @@
909 if btn:
910 btn = btn[0]
911 arch = etree.Element('group', colspan="2", col="2")
912- separator = etree.SubElement(
913+ _separator = etree.SubElement(
914 arch,
915 'separator',
916 colspan="2",
917 string="Product price coefficients")
918 for field in product_price_fields_obj.browse(cr, uid, product_price_fields_ids, context=context):
919 price_fields.append(field.categ_coef_field_id.name)
920- coef = etree.SubElement(
921+ _coef = etree.SubElement(
922 arch,
923 'field',
924 digits="(18, 6)",
925
926=== modified file 'product_multi_price/product_price_fields.py'
927--- product_multi_price/product_price_fields.py 2012-09-05 13:40:51 +0000
928+++ product_multi_price/product_price_fields.py 2012-12-07 12:12:22 +0000
929@@ -19,19 +19,17 @@
930 # #
931 #################################################################################
932
933-from osv import osv, fields
934-import netsvc
935+from openerp.osv.orm import Model
936+from openerp.osv import fields
937+from openerp.osv.osv import except_osv
938 from tools.translate import _
939-import decimal_precision as dp
940
941 #TODO
942
943
944-class product_price_fields(osv.osv):
945-
946+class product_price_fields(Model):
947 _name = "product.price.fields"
948 _description = "product price fields"
949-
950 _columns = {
951 'name': fields.related('price_field_id', 'field_description', type='char', size=64, string='Field Label', store=True),
952 'field_name': fields.related('price_field_id', 'name', type='char', size=64, string='Field Name', store=True, help ="you can chose the field name by default it will be build with the name of the field replacing the space by '_' and adding x_pm_ add the start"),
953@@ -44,7 +42,7 @@
954 'default_basedon':fields.selection([('categ_coef','Price on category coefficient'),('product_coef','Price on product coefficient'),('manual','Manual price')], 'Based on by default', required=True),
955 'currency_id': fields.many2one('res.currency', "Currency", required=True, help="The currency the field is expressed in."),
956 'inc_price_field_id' : fields.many2one('ir.model.fields', 'Price Included Field ID', domain = [('model', '=', 'product.product'), ('ttype', '=', 'float')]),
957- }
958+ }
959
960 def _get_currency(self, cr, uid, ctx):
961 comp = self.pool.get('res.users').browse(cr, uid, uid).company_id
962@@ -119,7 +117,7 @@
963 print 'field name'
964 exist_id = self.pool.get('ir.model.fields').search(cr, uid, [('name', '=', vals['field_name'])])
965 if not exist_id and vals['field_name'][0:2] != 'x_':
966- raise osv.except_osv(_('User Error'), _("Please prefix the name field by x_ as it's a custom field"))
967+ raise except_osv(_('User Error'), _("Please prefix the field name by x_ as it is a custom field"))
968 field_list = ['price', 'inc_price', 'basedon','product_coef','categ_coef']
969 product_ids = self.pool.get('product.product').search(cr, uid, [], context=context)
970 for field in field_list:
971@@ -170,6 +168,3 @@
972 price_field.product_coef_field_id.unlink()
973 price_field.categ_coef_field_id.unlink()
974 return super(product_price_fields, self).unlink(cr, uid, ids, context=context)
975-
976-product_price_fields()
977-
978
979=== modified file 'product_prices_on_variant/__openerp__.py'
980--- product_prices_on_variant/__openerp__.py 2012-07-18 07:55:31 +0000
981+++ product_prices_on_variant/__openerp__.py 2012-12-07 12:12:22 +0000
982@@ -23,15 +23,21 @@
983
984 {
985 'name': 'product_prices_on_variant',
986- 'version': '0.1',
987+ 'version': '6.1.0',
988 'category': 'Generic Modules/Others',
989 'license': 'AGPL-3',
990- 'description': """empty""",
991+ 'description': """
992+ This module move the field price from the template to the variant.
993+ This module is needed by product_multi_price. Be careful when using this module.
994+ As this change the original behaviour of OpenERP when using variant.
995+ """,
996 'author': 'Akretion',
997 'website': 'http://www.akretion.com/',
998- 'depends': ['product'],
999+ 'depends': [
1000+ 'product',
1001+ ],
1002 'init_xml': [],
1003- 'update_xml': [
1004+ 'update_xml': [
1005 ],
1006 'demo_xml': [],
1007 'installable': True,
1008
1009=== modified file 'product_prices_on_variant/product.py'
1010--- product_prices_on_variant/product.py 2012-07-18 07:55:31 +0000
1011+++ product_prices_on_variant/product.py 2012-12-07 12:12:22 +0000
1012@@ -19,24 +19,26 @@
1013 # #
1014 ###############################################################################
1015
1016-from osv import osv, fields
1017-import netsvc
1018+from openerp.osv.orm import Model
1019+from openerp.osv import fields
1020 import decimal_precision as dp
1021
1022
1023-class product_product(osv.osv):
1024-
1025+class product_product(Model):
1026 _inherit = "product.product"
1027-
1028-
1029 _columns = {
1030- 'list_price': fields.float('Sale Price', digits_compute=dp.get_precision('Sale Price'), help="Base price for computing the customer price. Sometimes called the catalog price."),
1031- 'standard_price': fields.float('Cost Price', required=True, digits_compute=dp.get_precision('Purchase Price'), help="Product's cost for accounting stock valuation. It is the base price for the supplier price."),
1032- }
1033-
1034+ 'list_price': fields.float('Sale Price',
1035+ digits_compute=dp.get_precision('Sale Price'),
1036+ help="Base price for computing the customer price. "
1037+ "Sometimes called the catalog price."),
1038+ 'standard_price': fields.float('Cost Price', required=True,
1039+ digits_compute=dp.get_precision('Purchase Price'),
1040+ help="Product's cost for accounting stock valuation. "
1041+ "It is the base price for the supplier price."),
1042+ }
1043 _defaults = {
1044 'list_price': lambda *a: 1,
1045 'standard_price': lambda *a: 1,
1046- }
1047+ }
1048
1049
1050
1051=== modified file 'product_quick_stock_rule/__openerp__.py'
1052--- product_quick_stock_rule/__openerp__.py 2012-05-21 12:59:56 +0000
1053+++ product_quick_stock_rule/__openerp__.py 2012-12-07 12:12:22 +0000
1054@@ -23,22 +23,22 @@
1055
1056 {
1057 'name': 'product_quick_stock_rule',
1058- 'version': '0.1',
1059+ 'version': '6.1.0',
1060 'category': 'Stock',
1061 'license': 'AGPL-3',
1062 'description': """
1063- This module simplifie the stock rule managment.
1064- Two field have been had on product view : 'active_rule' and 'min_qty'
1065- If you click on 'active rule' and select a 'min_qty' a stock rule will be automatically
1066+ This module simplifies the stock rule managment.
1067+ Two fields have been added on product view : 'active_rule' and 'min_qty'
1068+ If you click on 'active rule' and select a 'min_qty' a stock rule will be automatically
1069 generated.
1070- If you unselect the 'active rule' the rule will be unactive.
1071- And the field min qty will be in readonly.
1072+ If you unselect the 'active rule' the rule will be deactivated
1073+ and the field min_qty will be read only.
1074 """,
1075 'author': 'Akretion',
1076 'website': 'http://www.akretion.com/',
1077- 'depends': ['procurement'],
1078+ 'depends': ['procurement'],
1079 'init_xml': [],
1080- 'update_xml': [
1081+ 'update_xml': [
1082 'product_view.xml',
1083 ],
1084 'demo_xml': [],
1085
1086=== modified file 'product_quick_stock_rule/product.py'
1087--- product_quick_stock_rule/product.py 2012-05-21 13:55:05 +0000
1088+++ product_quick_stock_rule/product.py 2012-12-07 12:12:22 +0000
1089@@ -19,18 +19,18 @@
1090 # #
1091 ###############################################################################
1092
1093-from osv import osv, fields
1094-import netsvc
1095-
1096-
1097-class product_product(osv.osv):
1098+from openerp.osv.orm import Model
1099+from openerp.osv import fields
1100+
1101+
1102+class product_product(Model):
1103 _inherit = "product.product"
1104
1105 def _get_min_stock(self, cr, uid, ids, field_name, arg, context=None):
1106 orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
1107 res={}
1108 for product_id in ids:
1109- op_ids = orderpoint_obj.search(cr, uid, ['|', ('active', '=', False),
1110+ op_ids = orderpoint_obj.search(cr, uid, ['|', ('active', '=', False),
1111 ('active', '=', True), ('product_id', '=', product_id)], context=context)
1112 if op_ids:
1113 op = orderpoint_obj.browse(cr, uid, op_ids[0], context=context)
1114@@ -70,7 +70,7 @@
1115
1116 def _set_rule_status(self, cr, uid, product_id, name, value, arg, context=None):
1117 orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
1118- op_ids = orderpoint_obj.search(cr, uid, ['|', ('active', '=', False),
1119+ op_ids = orderpoint_obj.search(cr, uid, ['|', ('active', '=', False),
1120 ('active', '=', True), ('product_id', '=', product_id)], context=context)
1121 if op_ids:
1122 orderpoint_obj.write(cr, uid, op_ids[0], {'active': value}, context=context)
1123@@ -79,22 +79,20 @@
1124 orderpoint_obj.create(cr, uid, vals, context=context)
1125 return True
1126
1127-
1128 _columns = {
1129 'active_rule': fields.function(_get_rule_status, fnct_inv =_set_rule_status, type='boolean', string='Active Rule'),
1130 'qty_min': fields.function(_get_min_stock, fnct_inv =_set_min_stock, type='float', string='Minimal Stock'),
1131- }
1132-
1133-
1134-class stock_warehouse_orderpoint(osv.osv):
1135+ }
1136+
1137+
1138+class stock_warehouse_orderpoint(Model):
1139 """
1140 Defines Minimum stock rules.
1141 """
1142 _inherit = "stock.warehouse.orderpoint"
1143-
1144 _columns = {
1145 'sequence': fields.integer('Sequence', require=True),
1146- }
1147+ }
1148
1149 def _get_default_warehouse(self, cr, uid, context=None):
1150 warehouse_ids = self.pool.get('stock.warehouse').search(cr, uid, [], context=context)
1151@@ -115,4 +113,4 @@
1152 'warehouse_id': _get_default_warehouse,
1153 'product_max_qty': 0,
1154 'sequence': 0,
1155- }
1156+ }
1157
1158=== modified file 'product_sequence/__openerp__.py'
1159--- product_sequence/__openerp__.py 2012-03-02 17:27:08 +0000
1160+++ product_sequence/__openerp__.py 2012-12-07 12:12:22 +0000
1161@@ -22,7 +22,7 @@
1162
1163 {
1164 'name' : 'Product Sequence',
1165- 'version' : '0.1',
1166+ 'version' : '6.1.0',
1167 "author": "Zikzakmedia SL",
1168 "website": "http://www.zikzakmedia.com",
1169 "license" : "AGPL-3",
1170
1171=== modified file 'product_sequence/product_product.py'
1172--- product_sequence/product_product.py 2012-07-06 10:11:58 +0000
1173+++ product_sequence/product_product.py 2012-12-07 12:12:22 +0000
1174@@ -19,23 +19,21 @@
1175 #
1176 ##############################################################################
1177
1178-from osv import osv, fields
1179-from tools.translate import _
1180+from openerp.osv.orm import Model
1181+from openerp.osv import fields
1182+from openerp.tools.translate import _
1183
1184-class product_product(osv.osv):
1185+class product_product(Model):
1186 _inherit = 'product.product'
1187-
1188 _columns = {
1189 'default_code' : fields.char('Reference', size=64, required=True),
1190- }
1191-
1192+ }
1193 _sql_constraints = [
1194 ('uniq_default_code', 'unique(default_code)', "The reference must be unique"),
1195- ]
1196-
1197+ ]
1198 _defaults = {
1199 'default_code': lambda * a: '/',
1200- }
1201+ }
1202
1203 def create(self, cr, uid, vals, context=None):
1204 if context is None:
1205@@ -45,6 +43,8 @@
1206 return super(product_product, self).create(cr, uid, vals, context)
1207
1208 def write(self, cr, uid, ids, vals, context=None):
1209+ if not hasattr(ids, '__iter__'):
1210+ ids = [ids]
1211 if context is None:
1212 context = {}
1213 products_without_code = self.search(cr, uid, [('default_code', 'in', [False, '/']),('id', 'in', ids)], context=context)
1214@@ -63,5 +63,3 @@
1215 })
1216
1217 return super(product_product, self).copy(cr, uid, id, default, context)
1218-
1219-product_product()

Subscribers

People subscribed via source and target branches