diff --git a/addons/account_budget/crossovered_budget.py b/addons/account_budget/crossovered_budget.py index e9808f760f6..60ca40411ea 100644 --- a/addons/account_budget/crossovered_budget.py +++ b/addons/account_budget/crossovered_budget.py @@ -30,17 +30,17 @@ import datetime def strToDate(dt): dt_date=datetime.date(int(dt[0:4]),int(dt[5:7]),int(dt[8:10])) return dt_date -#moved from account/account.py + # --------------------------------------------------------- # Budgets # --------------------------------------------------------- class account_budget_post(osv.osv): _name = 'account.budget.post' - _description = 'Budget item' + _description = 'Budgetary Position' _columns = { 'code': fields.char('Code', size=64, required=True), 'name': fields.char('Name', size=256, required=True), - 'dotation_ids': fields.one2many('account.budget.post.dotation', 'post_id', 'Expenses'), + 'dotation_ids': fields.one2many('account.budget.post.dotation', 'post_id', 'Spreading'), 'account_ids': fields.many2many('account.account', 'account_budget_rel', 'budget_id', 'account_id', 'Accounts'), 'crossovered_budget_line': fields.one2many('crossovered.budget.lines', 'general_budget_id', 'Budget Lines'), } @@ -88,22 +88,20 @@ class account_budget_post_dotation(osv.osv): return res _name = 'account.budget.post.dotation' - _description = "Budget item endowment" + _description = "Budget Dotation" _columns = { 'name': fields.char('Name', size=64), 'post_id': fields.many2one('account.budget.post', 'Item', select=True), 'period_id': fields.many2one('account.period', 'Period'), -# 'quantity': fields.float('Quantity', digits=(16,2)), 'amount': fields.float('Amount', digits=(16,2)), 'tot_planned':fields.function(_tot_planned,method=True, string='Total Planned Amount',type='float',store=True), } account_budget_post_dotation() -#=== class crossovered_budget(osv.osv): _name = "crossovered.budget" - _description = "Crossovered Budget" + _description = "Budget" _columns = { 'name': fields.char('Name', size=50, required=True,states={'done':[('readonly',True)]}), @@ -227,11 +225,11 @@ class crossovered_budget_lines(osv.osv): res[line.id]=0.00 return res _name="crossovered.budget.lines" - _description = "Crossovered Budget Lines" + _description = "Budget Lines" _columns = { - 'crossovered_budget_id': fields.many2one('crossovered.budget', 'Budget Ref', ondelete='cascade', select=True, required=True), - 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account Ref',required=True), - 'general_budget_id': fields.many2one('account.budget.post', 'Master Budget Ref',required=True), + 'crossovered_budget_id': fields.many2one('crossovered.budget', 'Budget', ondelete='cascade', select=True, required=True), + 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account',required=True), + 'general_budget_id': fields.many2one('account.budget.post', 'Budgetary Position',required=True), 'date_from': fields.date('Start Date',required=True), 'date_to': fields.date('End Date',required=True), 'paid_date': fields.date('Paid Date'), @@ -252,52 +250,5 @@ class account_analytic_account(osv.osv): account_analytic_account() -#-------------------------------------------------------------- -# moved from account/project/project.py -# --------------------------------------------------------- -# Budgets. -# --------------------------------------------------------- - -#class account_analytic_budget_post(osv.osv): -# _name = 'account.analytic.budget.post' -# _description = 'Budget item' -# _columns = { -# 'code': fields.char('Code', size=64, required=True), -# 'name': fields.char('Name', size=256, required=True), -# 'sens': fields.selection( [('charge','Charge'), ('produit','Product')], 'Direction', required=True), -# 'dotation_ids': fields.one2many('account.analytic.budget.post.dotation', 'post_id', 'Expenses'), -# 'account_ids': fields.many2many('account.analytic.account', 'account_analytic_budget_rel', 'budget_id', 'account_id', 'Accounts'), -# } -# _defaults = { -# 'sens': lambda *a: 'produit', -# } -# -# def spread(self, cr, uid, ids, fiscalyear_id=False, quantity=0.0, amount=0.0): -# -# dobj = self.pool.get('account.analytic.budget.post.dotation') -# for o in self.browse(cr, uid, ids): -# # delete dotations for this post -# dobj.unlink(cr, uid, dobj.search(cr, uid, [('post_id','=',o.id)])) -# -# # create one dotation per period in the fiscal year, and spread the total amount/quantity over those dotations -# fy = self.pool.get('account.fiscalyear').browse(cr, uid, [fiscalyear_id])[0] -# num = len(fy.period_ids) -# for p in fy.period_ids: -# dobj.create(cr, uid, {'post_id': o.id, 'period_id': p.id, 'quantity': quantity/num, 'amount': amount/num}) -# return True -#account_analytic_budget_post() -# -#class account_analytic_budget_post_dotation(osv.osv): -# _name = 'account.analytic.budget.post.dotation' -# _description = "Budget item endowment" -# _columns = { -# 'name': fields.char('Name', size=64), -# 'post_id': fields.many2one('account.analytic.budget.post', 'Item', select=True), -# 'period_id': fields.many2one('account.period', 'Period'), -# 'quantity': fields.float('Quantity', digits=(16,2)), -# 'amount': fields.float('Amount', digits=(16,2)), -# } -#account_analytic_budget_post_dotation() - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_budget/crossovered_budget_view.xml b/addons/account_budget/crossovered_budget_view.xml index c61e6a19805..059a73175b6 100644 --- a/addons/account_budget/crossovered_budget_view.xml +++ b/addons/account_budget/crossovered_budget_view.xml @@ -12,34 +12,13 @@ - + account.budget.post.tree account.budget.post tree - + @@ -50,7 +29,7 @@ account.budget.post.dotation form -
+ @@ -62,7 +41,7 @@ account.budget.post.dotation tree - + @@ -71,59 +50,34 @@ - Master Budgets + Budgetary Positions account.budget.post form - + + - - - - - account.budget.post.form.inherit account.budget.post form - - - - - + + + + + +