Merge lp:~openerp-dev/openobject-addons/trunk-bug-715470-ara into lp:openobject-addons

Proposed by Ashvin Rathod (OpenERP)
Status: Merged
Merged at revision: 5021
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-715470-ara
Merge into: lp:openobject-addons
Diff against target: 29 lines (+9/-2)
1 file modified
sale_margin/sale_margin.py (+9/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-715470-ara
Reviewer Review Type Date Requested Status
qdp (OpenERP) Approve
OpenERP buildbot (community) Needs Fixing
Mustufa Rangwala (Open ERP) (community) Approve
Ashvin Rathod (OpenERP) (community) Needs Resubmitting
Olivier Dony (Odoo) Pending
Review via email: mp+51288@code.launchpad.net

Description of the change

Hello,

fixed the bug:ale margin module : wrong computation
https://bugs.launchpad.net/openobject-addons/+bug/715470

Thanks,
ara

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

rename the method _get_sale_order => _get_order_line

review: Needs Fixing
Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

Hello,

I have changed as you describe above.

Thanks,
ara

review: Needs Resubmitting
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) :
review: Approve
Revision history for this message
qdp (OpenERP) (qdp) wrote :

patch was working, but by luck only.

Actually, the way to use the store = {} feature wasn't good but the orm was bugged and the priorities of functions wasn't working at all. So i just commited the right way to fix the issue in the addons, a patch is under testing server side and if it succeeds, i will merge without delay that branch.

Revision history for this message
OpenERP buildbot (openerp-buildbot) wrote :

crm_partner_assign/test/test_crm_partner_assign.yml[warning]: AssertionError in Python code : SMTP not configured !
project_timesheet/test/worktask_entry_to_timesheetline_entry.yml[warning]: Assertion "After hr manager's work task" FAILED test: len(timesheet_ids) > 0 values: ! 0 > 0
~/addons/anonymization/anonymization.py:298[pywarn]: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
~/addons/anonymization/anonymization.py:300[pywarn]: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.

review: Needs Fixing
Revision history for this message
qdp (OpenERP) (qdp) wrote :

i aproove and set Olivier as reviewer (in order to clean my merge proposal list) and as we are waiting for his patch server side.

review: Approve
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

The corresponding server-side fix landed in trunk at revision 3612 rev-id: <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale_margin/sale_margin.py'
2--- sale_margin/sale_margin.py 2011-02-23 10:43:22 +0000
3+++ sale_margin/sale_margin.py 2011-03-10 14:54:55 +0000
4@@ -49,7 +49,8 @@
5 return res
6
7 _columns = {
8- 'margin': fields.function(_product_margin, method=True, string='Margin', store=True),
9+ 'margin': fields.function(_product_margin, method=True, string='Margin',
10+ store = True),
11 'purchase_price': fields.float('Cost Price', digits=(16,2))
12 }
13
14@@ -66,8 +67,14 @@
15 result[sale.id] += line.margin or 0.0
16 return result
17
18+ def _get_order(self, cr, uid, ids, context=None):
19+ return super(self,sale_order)._get_order(cr, uid, ids, context=context)
20+
21 _columns = {
22- 'margin': fields.function(_product_margin, method=True, string='Margin', store=True, help="It gives profitability by calculating the difference between the Unit Price and Cost Price."),
23+ 'margin': fields.function(_product_margin, method=True, string='Margin', help="It gives profitability by calculating the difference between the Unit Price and Cost Price.", store={
24+ 'sale.order.line': (_get_order, ['margin'], 20),
25+ 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 20),
26+ }),
27 }
28
29 sale_order()

Subscribers

People subscribed via source and target branches

to all changes: