Merge lp:~openerp-dev/openobject-addons/trunk-bug-1100396-bde into lp:openobject-addons

Proposed by Bharat Devnani (Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1100396-bde
Merge into: lp:openobject-addons
Diff against target: 31 lines (+11/-3)
1 file modified
account_budget/report/crossovered_budget_report.py (+11/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1100396-bde
Reviewer Review Type Date Requested Status
Lionel Sausin - Initiatives/Numérigraphe (community) Needs Fixing
OpenERP Core Team Pending
Review via email: mp+199999@code.launchpad.net

Description of the change

Hello,

I have checked the branch lp:~openerp-community/openobject-addons/fix-1100396-account_budget-date_range by Niels Huylebroeck and removed some of his unused code and applied in this branch.

Thanks & Regards,
Devnani Bharat R.

To post a comment you must log in.
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

By "unused code" you mean "useful comments", right?
Why do you do this?

review: Needs Fixing
9026. By Bharat Devnani (Open ERP)

[ADD] added comment

Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

I have added useful comments

Unmerged revisions

9026. By Bharat Devnani (Open ERP)

[ADD] added comment

9025. By Niels Huylebroeck

[ACCOUNT BUDGET] [IMP] improved date values in context in order to get correct practical amount

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_budget/report/crossovered_budget_report.py'
2--- account_budget/report/crossovered_budget_report.py 2013-10-27 12:31:04 +0000
3+++ account_budget/report/crossovered_budget_report.py 2014-01-31 11:32:21 +0000
4@@ -71,7 +71,6 @@
5 self.cr.execute('SELECT DISTINCT(analytic_account_id) FROM crossovered_budget_lines WHERE id = ANY(%s)',(budget_ids,))
6 an_ids = self.cr.fetchall()
7
8- context = {'wizard_date_from': d_from, 'wizard_date_to': d_to}
9 for i in range(0, len(an_ids)):
10 if not an_ids[i][0]:
11 continue
12@@ -96,8 +95,17 @@
13 for line in line_id:
14 if line.id in budget_ids:
15 theo = pract = 0.00
16- theo = c_b_lines_obj._theo_amt(self.cr, self.uid, [line.id], context)[line.id]
17- pract = c_b_lines_obj._prac_amt(self.cr, self.uid, [line.id], context)[line.id]
18+ # When fetching theoretical/practical amounts we
19+ # want to use the date as closely related to the
20+ # period defined on the budget line, however
21+ # if the user has entered a date which intersects
22+ # the budget_line dates we take that in preference.
23+ ctx = {
24+ 'wizard_date_from': max(line.date_from, d_from),
25+ 'wizard_date_to': min(line.date_to, d_to),
26+ }
27+ theo = c_b_lines_obj._theo_amt(self.cr, self.uid, [line.id], ctx)[line.id]
28+ pract = c_b_lines_obj._prac_amt(self.cr, self.uid, [line.id], ctx)[line.id]
29 if line.general_budget_id.id in done_budget:
30 for record in result:
31 if record['b_id'] == line.general_budget_id.id and record['a_id'] == line.analytic_account_id.id:

Subscribers

People subscribed via source and target branches

to all changes: