Ila Rana(Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-17546-ira into 
lp:openobject-addons/6.0.

Requested reviews:
  Raphael Collet (OpenERP) (rco-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-17546-ira/+merge/76161

Hello Raphael,

There is a problem in confirming "purchase order" in following situation:

1. In the configuration parameter, there is already existed record with name 
"property_account_expense_categ". First, modify this record by selecting one of 
the resources and the value.

2. After that, Create a new purchase order. In Purchase order line, don't 
define any product but only define required data after then try out to confirm 
this order. You get the Attribute-error message : 'bool' object has no 
attribute 'id'.

To overcome from this type error I have made changes in purchase as given in 
sale module.

Thanks,
Ila Rana
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-17546-ira/+merge/76161
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-17546-ira.
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py	2011-07-07 10:50:50 +0000
+++ purchase/purchase.py	2011-09-20 07:13:27 +0000
@@ -362,9 +362,13 @@
                     if not a:
                         raise osv.except_osv(_('Error !'), _('There is no expense account defined for this product: "%s" (id:%d)') % (ol.product_id.name, ol.product_id.id,))
                 else:
-                    a = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category').id
+                    acc_id = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category')
+                    a = acc_id and acc_id.id or False
                 fpos = o.fiscal_position or False
                 a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a)
+                if not a:
+                    raise osv.except_osv(_('Error !'),
+                                _('There is no expense account defined in default Properties for Product Category or Fiscal Position is not defined !'))
                 il.append(self.inv_line_create(cr, uid, a, ol))
 
             a = o.partner_id.property_account_payable.id

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to