Sanjay Gohel (Open ERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-909782-sgo into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #909782 in OpenERP Addons: "Sales order tree view error: KeyError:
'number_of_stockable'"
https://bugs.launchpad.net/openobject-addons/+bug/909782
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-909782-sgo/+merge/87235
Hello,
I have added validation in project_mrp for when any sale order created
without line. It doesn't have key number_of_stockable therefore I have added
validation for that.
Kindly review it.
Thank You.
SGO
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-909782-sgo/+merge/87235
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-909782-sgo.
=== modified file 'project_mrp/project_mrp.py'
--- project_mrp/project_mrp.py 2011-12-21 15:16:39 +0000
+++ project_mrp/project_mrp.py 2012-01-02 10:17:24 +0000
@@ -96,11 +96,12 @@
res_sale[item['sale_id']]['number_of_done'] += item['total']
for sale in self.browse(cr, uid, ids, context=context):
- res_sale[sale.id]['number_of_stockable'] -= res_sale[sale.id]['total_no_task']
- #adjust previously percentage because now we must also count the product of type service
- res[sale.id] = res[sale.id] * float(res_sale[sale.id]['number_of_stockable']) / (res_sale[sale.id]['number_of_stockable'] + res_sale[sale.id]['total_no_task'])
- #add the task
- res[sale.id] += res_sale[sale.id]['number_of_done'] * 100 / (res_sale[sale.id]['number_of_stockable'] + res_sale[sale.id]['total_no_task'])
+ if 'number_of_stockable' in res_sale[sale.id]:
+ res_sale[sale.id]['number_of_stockable'] -= res_sale[sale.id]['total_no_task']
+ #adjust previously percentage because now we must also count the product of type service
+ res[sale.id] = res[sale.id] * float(res_sale[sale.id]['number_of_stockable']) / (res_sale[sale.id]['number_of_stockable'] + res_sale[sale.id]['total_no_task'])
+ #add the task
+ res[sale.id] += res_sale[sale.id]['number_of_done'] * 100 / (res_sale[sale.id]['number_of_stockable'] + res_sale[sale.id]['total_no_task'])
return res
_columns = {
_______________________________________________
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