Merge lp:~openerp-dev/openobject-addons/trunk-bug-768430-ron into lp:openobject-addons

Proposed by Rohan Nayani(Open ERP)
Status: Merged
Merged at revision: 4758
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-768430-ron
Merge into: lp:openobject-addons
Diff against target: 18 lines (+6/-2)
1 file modified
product/product.py (+6/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-768430-ron
Reviewer Review Type Date Requested Status
qdp (OpenERP) Needs Information
Rucha (Open ERP) (community) Approve
Rohan Nayani(Open ERP) (community) Needs Resubmitting
Review via email: mp+59170@code.launchpad.net

Description of the change

product:Fixed-After delete All product category you cannot create new product

To post a comment you must log in.
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

return res and res[1] or False

get proper result in above code and then return only res

review: Needs Fixing
Revision history for this message
Rohan Nayani(Open ERP) (ron-tinyerp) :
review: Needs Resubmitting
Revision history for this message
Rucha (Open ERP) (rpa-openerp) :
review: Approve
Revision history for this message
qdp (OpenERP) (qdp) wrote :

i cannot reproduce this bug. Am i missing something?

review: Needs Information
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

1) Create a new database without demo data
2) Remove Product Category "All Products"
3) Go to product view and try to create new product

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product/product.py'
2--- product/product.py 2011-03-23 12:08:18 +0000
3+++ product/product.py 2011-04-27 06:34:33 +0000
4@@ -315,8 +315,12 @@
5 if 'categ_id' in context and context['categ_id']:
6 return context['categ_id']
7 md = self.pool.get('ir.model.data')
8- res = md.get_object_reference(cr, uid, 'product', 'cat0') or False
9- return res and res[1] or False
10+ res = False
11+ try:
12+ res = md.get_object_reference(cr, uid, 'product', 'cat0')[1]
13+ except ValueError:
14+ res = False
15+ return res
16
17 def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
18 if uom_id:

Subscribers

People subscribed via source and target branches

to all changes: