[6.1/trunk] wrong check : Cannot change the category of existing UoM; patch included
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP R&D Addons Team 2 |
Bug Description
Try to import several time this UOM CSV file (for instance using the GTK client)
After first importation, subsequent importations will fail (silently, you might want to hack the GTK client to actually make it print the server warning message, this is yet an other GTK bug)
So if you hack the GTK client to display the message, then you'll see the server error response:
(-1, {'category_id': 1, 'name': 'toto', 'factor': 1.0}, u"Line 1 : Warning\nCannot change the category of existing UoM 'toto3'.", '')
If you look in product/product.py, the test of UOM category change is plain wrong:
def write(self, cr, uid, ids, vals, context=None):
if 'category_id' in vals:
for uom in self.browse(cr, uid, ids, context=context):
if uom.category_id != vals['category_
You are comparing a browse object to an integer...
Of course this should be instead:
def write(self, cr, uid, ids, vals, context=None):
if 'category_id' in vals:
for uom in self.browse(cr, uid, ids, context=context):
if uom.category_id.id != vals['category_
Thanks to change that...
Related branches
- Rucha (Open ERP) (community): Approve
- qdp (OpenERP): Pending requested
-
Diff: 11 lines (+1/-1)1 file modifiedproduct/product.py (+1/-1)
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Hello Raphael Valyi ,
I have checked this issue at my end.Its working fine
with trunk without using your patch,I am not properly get
what you want exactly so would you please more elaborate regarding
this issue.
Thanks and waiting for replay.