[FIX] Account_Budget : Correction on functional field calculation
lp bug: https://launchpad.net/bugs/663279 fixed bzr revid: jvo@tinyerp.com-20101020135421-hd6koh378ojcrp08
This commit is contained in:
parent
b42f8f310d
commit
1d537d4724
|
@ -110,6 +110,7 @@ class crossovered_budget_lines(osv.osv):
|
||||||
|
|
||||||
def _prac_amt(self, cr, uid, ids, context={}):
|
def _prac_amt(self, cr, uid, ids, context={}):
|
||||||
res = {}
|
res = {}
|
||||||
|
result = 0.0
|
||||||
for line in self.browse(cr, uid, ids):
|
for line in self.browse(cr, uid, ids):
|
||||||
acc_ids = [x.id for x in line.general_budget_id.account_ids]
|
acc_ids = [x.id for x in line.general_budget_id.account_ids]
|
||||||
if not acc_ids:
|
if not acc_ids:
|
||||||
|
@ -120,6 +121,7 @@ class crossovered_budget_lines(osv.osv):
|
||||||
date_from = context['wizard_date_from']
|
date_from = context['wizard_date_from']
|
||||||
if context.has_key('wizard_date_to'):
|
if context.has_key('wizard_date_to'):
|
||||||
date_to = context['wizard_date_to']
|
date_to = context['wizard_date_to']
|
||||||
|
if line.analytic_account_id.id:
|
||||||
cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id=%s AND (date "
|
cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id=%s AND (date "
|
||||||
"between to_date(%s,'yyyy-mm-dd') AND to_date(%s,'yyyy-mm-dd')) AND "
|
"between to_date(%s,'yyyy-mm-dd') AND to_date(%s,'yyyy-mm-dd')) AND "
|
||||||
"general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,))
|
"general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,))
|
||||||
|
|
|
@ -131,6 +131,7 @@
|
||||||
<field name="date_to"/>
|
<field name="date_to"/>
|
||||||
<field name="paid_date" select="1"/>
|
<field name="paid_date" select="1"/>
|
||||||
<field name="planned_amount" select="1"/>
|
<field name="planned_amount" select="1"/>
|
||||||
|
<field name="analytic_account_id"/>
|
||||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
|
Loading…
Reference in New Issue