Merge lp:~openerp-dev/openobject-addons/trunk-bug-880797-mdi into lp:openobject-addons

Proposed by DJ Patel (OpenERP)
Status: Merged
Merged at revision: 5561
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-880797-mdi
Merge into: lp:openobject-addons
Diff against target: 42 lines (+4/-3)
2 files modified
account_budget/account_budget.py (+3/-3)
account_budget/account_budget_view.xml (+1/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-880797-mdi
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+80978@code.launchpad.net

Description of the change

Hello Sir,

I have fix the issue: https://bugs.launchpad.net/openobject-addons/+bug/880797 "Unable to filter Budget Lines".

I added a field in tree view, which is in search view and also added store=True in function field.

Thanks and Regards,

Divyesh Makwana(MDI)

To post a comment you must log in.
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

FYI, adding "store=True" is not enough. The value may have to be recomputed, and this does not work by magic :-( The value of field 'practical_amount' depends on the model account.analytic.line. So you have to specify which records of crossovered.budget.lines must be recomputed when the table account_analytic_line is touched.

Anyway, searching on practical_amount does not make much sense. I will merge without that change, only the view needs to be fixed.

Thanks,
Raphael

Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

I removed the select="1" on field practical_amount in the list view.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_budget/account_budget.py'
2--- account_budget/account_budget.py 2011-07-05 13:31:35 +0000
3+++ account_budget/account_budget.py 2011-11-02 05:10:28 +0000
4@@ -111,7 +111,7 @@
5 def _prac_amt(self, cr, uid, ids, context=None):
6 res = {}
7 result = 0.0
8- if context is None:
9+ if context is None:
10 context = {}
11 for line in self.browse(cr, uid, ids, context=context):
12 acc_ids = [x.id for x in line.general_budget_id.account_ids]
13@@ -141,7 +141,7 @@
14
15 def _theo_amt(self, cr, uid, ids, context=None):
16 res = {}
17- if context is None:
18+ if context is None:
19 context = {}
20 for line in self.browse(cr, uid, ids, context=context):
21 today = datetime.datetime.today()
22@@ -196,7 +196,7 @@
23 'date_to': fields.date('End Date', required=True),
24 'paid_date': fields.date('Paid Date'),
25 'planned_amount':fields.float('Planned Amount', required=True, digits_compute=dp.get_precision('Account')),
26- 'practical_amount':fields.function(_prac, string='Practical Amount', type='float', digits_compute=dp.get_precision('Account')),
27+ 'practical_amount':fields.function(_prac, string='Practical Amount', type='float', store=True, digits_compute=dp.get_precision('Account')),
28 'theoritical_amount':fields.function(_theo, string='Theoretical Amount', type='float', digits_compute=dp.get_precision('Account')),
29 'percentage':fields.function(_perc, string='Percentage', type='float'),
30 'company_id': fields.related('crossovered_budget_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
31
32=== modified file 'account_budget/account_budget_view.xml'
33--- account_budget/account_budget_view.xml 2011-09-17 13:03:09 +0000
34+++ account_budget/account_budget_view.xml 2011-11-02 05:10:28 +0000
35@@ -205,6 +205,7 @@
36 <tree string="Budget Lines">
37 <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
38 <field name="general_budget_id"/>
39+ <field name="crossovered_budget_id"/>
40 <field name="date_from"/>
41 <field name="date_to"/>
42 <field name="paid_date"/>

Subscribers

People subscribed via source and target branches

to all changes: