bug fix on move line and account_budget

bzr revid: mra@tinyerp.com-20080925043944-ufpmg5fy162ntrms
This commit is contained in:
Mustufa Rangwala 2008-09-25 10:09:44 +05:30
parent 9961e94cfa
commit 2ab70b66aa
2 changed files with 2 additions and 47 deletions

View File

@ -481,7 +481,7 @@ class account_move_line(osv.osv):
self_debit = -writeoff
# If comment exist in context, take it
if context['comment']:
if 'comment' in context and context['comment']:
libelle=context['comment']
else:
libelle='Write-Off'

View File

@ -208,51 +208,6 @@ class crossovered_budget_lines(osv.osv):
}
crossovered_budget_lines()
#class account_budget_post(osv.osv): #old code
# _name = 'account.budget.post'
# _inherit = 'account.budget.post'
# _columns = {
# 'crossovered_budget_line': fields.one2many('crossovered.budget.lines', 'general_budget_id', 'Budget Lines'),
# }
#account_budget_post()
#
#class account_budget_post_dotation(osv.osv):
# _name = 'account.budget.post.dotation'
# _inherit = 'account.budget.post.dotation'
#
# def _tot_planned(self, cr, uid, ids,name,args,context):
# res={}
# for line in self.browse(cr, uid, ids):
# if line.period_id:
# obj_period=self.pool.get('account.period').browse(cr, uid,line.period_id.id)
#
# total_days=strToDate(obj_period.date_stop) - strToDate(obj_period.date_start)
# budget_id=line.post_id and line.post_id.id or False
# query="select id from crossovered_budget_lines where general_budget_id= '"+ str(budget_id) + "' AND (date_from >='" +obj_period.date_start +"' and date_from <= '"+obj_period.date_stop + "') OR (date_to >='" +obj_period.date_start +"' and date_to <= '"+obj_period.date_stop + "') OR (date_from <'" +obj_period.date_start +"' and date_to > '"+obj_period.date_stop + "')"
# cr.execute(query)
# res1=cr.fetchall()
#
# tot_planned=0.00
# for record in res1:
# obj_lines = self.pool.get('crossovered.budget.lines').browse(cr, uid,record[0])
# count_days = min(strToDate(obj_period.date_stop),strToDate(obj_lines.date_to)) - max(strToDate(obj_period.date_start), strToDate(obj_lines.date_from))
# days_in_period = count_days.days +1
# count_days = strToDate(obj_lines.date_to) - strToDate(obj_lines.date_from)
# total_days_of_rec = count_days.days +1
# tot_planned += obj_lines.planned_amount/total_days_of_rec* days_in_period
# res[line.id]=tot_planned
# else:
# res[line.id]=0.00
# return res
#
# _columns = {
# 'tot_planned':fields.function(_tot_planned,method=True, string='Total Planned Amount',type='float',store=True),
# }
#
#account_budget_post_dotation()
class account_analytic_account(osv.osv):
_name = 'account.analytic.account'
_inherit = 'account.analytic.account'
@ -266,7 +221,7 @@ account_analytic_account()
#--------------------------------------------------------------
# moved from account/project/project.py
# ---------------------------------------------------------
# Budgets
# Budgets.
# ---------------------------------------------------------
#class account_analytic_budget_post(osv.osv):