diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 12f3682cf56..f9d2dea38cc 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -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' diff --git a/addons/account_budget/crossovered_budget.py b/addons/account_budget/crossovered_budget.py index 420926bbaf4..c5a81a2398b 100644 --- a/addons/account_budget/crossovered_budget.py +++ b/addons/account_budget/crossovered_budget.py @@ -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):