generate css from last commit
[odoo/odoo.git] / addons / account_budget / account_budget.py
index 1746a44..af9f9cb 100644 (file)
@@ -116,7 +116,7 @@ class crossovered_budget_lines(osv.osv):
         for line in self.browse(cr, uid, ids, context=context):
             acc_ids = [x.id for x in line.general_budget_id.account_ids]
             if not acc_ids:
-                raise osv.except_osv(_('Error!'),_("The General Budget '%s' has no Accounts!") % str(line.general_budget_id.name))
+                raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % str(line.general_budget_id.name))
             date_to = line.date_to
             date_from = line.date_from
             if context.has_key('wizard_date_from'):
@@ -161,7 +161,7 @@ class crossovered_budget_lines(osv.osv):
                 total = strToDate(line.date_to) - strToDate(line.date_from)
                 elapsed = min(strToDate(line.date_to),strToDate(date_to)) - max(strToDate(line.date_from),strToDate(date_from))
                 if strToDate(date_to) < strToDate(line.date_from):
-                    elapsed = strToDate(line.date_from) - strToDate(date_to)
+                    elapsed = strToDate(date_to) - strToDate(date_to)
 
                 if total.days:
                     theo_amt = float(elapsed.days / float(total.days)) * line.planned_amount
@@ -196,9 +196,9 @@ class crossovered_budget_lines(osv.osv):
         'date_to': fields.date('End Date', required=True),
         'paid_date': fields.date('Paid Date'),
         'planned_amount':fields.float('Planned Amount', required=True, digits_compute=dp.get_precision('Account')),
-        'practical_amount':fields.function(_prac, method=True, string='Practical Amount', type='float', digits_compute=dp.get_precision('Account')),
-        'theoritical_amount':fields.function(_theo, method=True, string='Theoretical Amount', type='float', digits_compute=dp.get_precision('Account')),
-        'percentage':fields.function(_perc, method=True, string='Percentage', type='float'),
+        'practical_amount':fields.function(_prac, string='Practical Amount', type='float', digits_compute=dp.get_precision('Account')),
+        'theoritical_amount':fields.function(_theo, string='Theoretical Amount', type='float', digits_compute=dp.get_precision('Account')),
+        'percentage':fields.function(_perc, string='Percentage', type='float'),
         'company_id': fields.related('crossovered_budget_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
     }