revert changes from account_budget_crossover
bzr revid: mra@tinyerp.com-20080911070025-jcw72l28a8xg785k
This commit is contained in:
@@ -191,94 +191,6 @@ class account_analytic_account(osv.osv):
|
||||
|
||||
account_analytic_account()
|
||||
|
||||
#moved from account modules
|
||||
# ---------------------------------------------------------
|
||||
# Budgets (project)
|
||||
# ---------------------------------------------------------
|
||||
|
||||
#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()
|
||||
|
||||
#==================================================================================
|
||||
|
||||
# from account module...account.py
|
||||
# ---------------------------------------------------------
|
||||
# Budgets
|
||||
# ---------------------------------------------------------
|
||||
|
||||
class account_budget_post(osv.osv):
|
||||
_name = 'account.budget.post'
|
||||
_description = 'Budget item'
|
||||
_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'),
|
||||
'account_ids': fields.many2many('account.account', 'account_budget_rel', 'budget_id', 'account_id', 'Accounts'),
|
||||
}
|
||||
_defaults = {
|
||||
}
|
||||
|
||||
def spread(self, cr, uid, ids, fiscalyear_id=False, amount=0.0):
|
||||
dobj = self.pool.get('account.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, 'amount': amount/num})
|
||||
return True
|
||||
account_budget_post()
|
||||
|
||||
class account_budget_post_dotation(osv.osv):
|
||||
_name = 'account.budget.post.dotation'
|
||||
_description = "Budget item endowment"
|
||||
_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)),
|
||||
}
|
||||
account_budget_post_dotation()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -40,9 +40,5 @@
|
||||
rml="account_budget_crossover/report/analytic_account_budget_report.rml"
|
||||
auto="False"
|
||||
menu="False"/>
|
||||
|
||||
<!-- moved from account module -->
|
||||
<report auto="False" id="account_budget" menu="False" model="account.budget.post" name="account.budget" rml="account/report/budget_report.rml" string="Print Budget"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -250,96 +250,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- moved from account module project_view -->
|
||||
<!--Budget(project) -->
|
||||
<!--<report
|
||||
id="account_analytic_budget_print"
|
||||
string="Print Budget"
|
||||
model="account.analytic.budget.post"
|
||||
name="account.analytic.budget.print"
|
||||
rml="account/project/report/account_analytic_budget_report.rml"
|
||||
auto="False"
|
||||
menu="False"/>-->
|
||||
|
||||
|
||||
<!-- to be corect..mra account_view-->
|
||||
<record id="action_account_budget_post_tree" model="ir.actions.act_window">
|
||||
<field name="name">Budgets</field>
|
||||
<field name="res_model">account.budget.post</field>
|
||||
<field name="view_type">tree</field>
|
||||
</record>
|
||||
<menuitem action="action_account_budget_post_tree" id="menu_action_account_budget_post_tree" parent="account.menu_finance_reporting"/>
|
||||
|
||||
<!--
|
||||
Budgets
|
||||
-->
|
||||
<record id="view_budget_post_form" model="ir.ui.view">
|
||||
<field name="name">account.budget.post.form</field>
|
||||
<field name="model">account.budget.post</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Master Budget">
|
||||
<notebook>
|
||||
<page string="Definition">
|
||||
<field name="code" select="1"/>
|
||||
<field name="name" select="1"/>
|
||||
</page>
|
||||
<page string="Dotations">
|
||||
<button name="%(wizard_budget_spread)d" string="Spread" type="action"/>
|
||||
<field colspan="4" name="dotation_ids" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Accounts">
|
||||
<field colspan="4" name="account_ids" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_budget_post_tree" model="ir.ui.view">
|
||||
<field name="name">account.budget.post.tree</field>
|
||||
<field name="model">account.budget.post</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Master Budget">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_budget_post_dotation_form" model="ir.ui.view">
|
||||
<field name="name">account.budget.post.dotation.form</field>
|
||||
<field name="model">account.budget.post.dotation</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Master Budget Expenses">
|
||||
<field name="period_id"/>
|
||||
<field name="amount"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_budget_post_dotation_tree" model="ir.ui.view">
|
||||
<field name="name">account.budget.post.dotation.tree</field>
|
||||
<field name="model">account.budget.post.dotation</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Master Budget Expenses">
|
||||
<field name="period_id"/>
|
||||
<field name="amount"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="open_budget_post_form" model="ir.actions.act_window">
|
||||
<field name="name">Master Budgets</field>
|
||||
<field name="res_model">account.budget.post</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_budget_post_tree"/>
|
||||
</record>
|
||||
<menuitem id="next_id_31" name="Budgets" parent="account.menu_finance_accounting"/><menuitem action="open_budget_post_form" id="menu_budget_post_form" parent="next_id_31"/>
|
||||
|
||||
<!-- finish -->
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import crossovered_budget_report
|
||||
import analytic_account_budget_report
|
||||
|
||||
import budget_report
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_crossovered_budget","crossovered.budget","model_crossovered_budget","account.group_account_manager",1,1,1,1
|
||||
"access_crossovered_budget_lines","crossovered.budget.lines","model_crossovered_budget_lines","account.group_account_manager",1,1,1,1
|
||||
"access_account_budget_post","account.budget.post","model_account_budget_post","account.group_account_manager",1,1,1,1
|
||||
"access_account_budget_post_dotation","account.budget.post.dotation","model_account_budget_post_dotation","account.group_account_manager",1,1,1,1
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_crossovered_budget,crossovered.budget,model_crossovered_budget,account.group_account_manager,1,1,1,1
|
||||
access_crossovered_budget_lines,crossovered.budget.lines,model_crossovered_budget_lines,account.group_account_manager,1,1,1,1
|
||||
|
||||
|
@@ -2,7 +2,5 @@
|
||||
import wizard_crossovered_budget_report
|
||||
import wizard_analytic_account_budget
|
||||
import wizard_crossovered_budget_summary_report
|
||||
import wizard_budget_report
|
||||
import wizard_budget_spread
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user