remove all reference of budget from account module..now it will move in account_budget_crossover

bzr revid: mra@tinyerp.com-20080911064328-hsqms2eovfwq2g03
This commit is contained in:
Mustufa Rangwala 2008-09-11 12:13:28 +05:30
parent 606165c849
commit 2fc78c00c8
19 changed files with 278 additions and 725 deletions

View File

@ -1321,49 +1321,6 @@ class account_tax(osv.osv):
return res
account_tax()
# ---------------------------------------------------------
# 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()
# ---------------------------------------------------------
# Account Entries Models
# ---------------------------------------------------------
@ -1789,7 +1746,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
Create a new account chart for a company.
Wizards ask:
* a company
* an account chart template
* an account chart template
* a number of digits for formatting code of non-view accounts
* a list of bank account owned by the company
Then, the wizard:

View File

@ -5,7 +5,6 @@
<report auto="False" id="account_3rdparty_ledger" menu="False" model="res.partner" name="account.third_party_ledger" rml="account/report/third_party_ledger.rml" string="Partner ledger"/>
<report auto="False" id="account_account_balance" menu="False" model="account.account" name="account.account.balance" rml="account/report/account_balance.rml" string="Account balance"/>
<report auto="False" id="account_3rdparty_account_balance" menu="False" model="account.account" name="account.partner.balance" rml="account/report/partner_balance.rml" string="Partner balance"/>
<report auto="False" id="account_budget" menu="False" model="account.budget.post" name="account.budget" rml="account/report/budget_report.rml" string="Print Budget"/>
<report auto="False" id="account_central_journal" model="account.journal.period" name="account.central.journal" rml="account/report/central_journal.rml" string="Print Central Journal"/>
<report auto="False" id="account_general_journal" model="account.journal.period" name="account.general.journal" rml="account/report/general_journal.rml" string="Print General Journal"/>
<report auto="False" id="account_journal" model="account.journal.period" name="account.journal.period.print" rml="account/report/account_journal.rml" string="Print Journal"/>

View File

@ -982,80 +982,6 @@
</record>
<menuitem action="action_account_journal_period_tree" id="menu_action_account_journal_period_tree" parent="account.menu_finance_reporting"/>
<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"/>
<!--
# Account Models
@ -1416,7 +1342,7 @@
<field name="target">new</field>
</record>
<!-- register configuration wizard -->

View File

@ -6,8 +6,6 @@
<wizard id="wizard_invoice_pay" model="account.invoice" name="account.invoice.pay" string="Pay invoice"/>
<wizard id="wizard_budget_spread" menu="False" model="account.budget.post" name="account.budget.spread" string="Spread amount"/>
<!-- close year, period, journal -->
<wizard id="wizard_fiscalyear_close" menu="False" model="account.fiscalyear" name="account.fiscalyear.close" string="Close a Fiscal Year"/>
<menuitem id="menu_finance" name="Financial Management"/><menuitem action="wizard_fiscalyear_close" id="menu_wizard_fy_close" parent="menu_account_end_year_treatments" sequence="11" type="wizard"/>
@ -26,8 +24,8 @@
<wizard
string="Import invoices"
model="account.bank.statement"
name="populate_statement_from_inv"
menu="False"
name="populate_statement_from_inv"
menu="False"
id="wizard_populate_statement_from_inv"/>
<!-- manual reconcile -->
@ -61,7 +59,6 @@
<wizard id="wizard_third_party_ledger" menu="False" model="res.partner" name="account.third_party_ledger.report" string="Partner ledger"/>
<menuitem icon="STOCK_PRINT" action="wizard_third_party_ledger" id="menu_third_party_ledger" parent="account.next_id_22" type="wizard"/>
<wizard id="wizard_budget_report" keyword="client_print_multi" model="account.budget.post" name="account.budget.report" string="Budget"/>
<wizard id="wizard_balance_report" keyword="client_print_multi" model="account.account" name="account.account.balance.report" string="Account balance"/>
<wizard id="wizard_general_ledger_report" keyword="client_print_multi" model="account.account" name="account.general.ledger.report" string="General ledger"/>

View File

@ -245,51 +245,5 @@ class account_journal(osv.osv):
}
account_journal()
# ---------------------------------------------------------
# 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:

View File

@ -2,43 +2,33 @@
<openerp>
<data>
<report auto="False" id="analytic_journal_print" menu="False" model="account.analytic.journal" name="account.analytic.account.journal" rml="account/project/report/analytic_journal.rml" string="Analytic Journal"/>
<wizard id="account_analytic_account_journal_report" keyword="client_print_multi" model="account.analytic.journal" name="account.analytic.account.journal.report" string="Analytic Journal"/>
<report auto="False" id="account_analytic_account_balance" menu="False" model="account.analytic.account" name="account.analytic.account.balance" rml="account/project/report/analytic_balance.rml" string="Analytic Balance"/>
<wizard id="account_analytic_account_balance_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.balance.report" string="Analytic Balance"/>
<report auto="False" id="account_analytic_account_inverted_balance" menu="False" model="account.analytic.account" name="account.analytic.account.inverted.balance" rml="account/project/report/inverted_analytic_balance.rml" string="Inverted Analytic Balance"/>
<wizard id="account_analytic_account_inverted_balance_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.inverted.balance.report" string="Inverted Analytic Balance"/>
<report auto="False" id="account_analytic_account_cost_ledger" menu="False" model="account.analytic.account" name="account.analytic.account.cost_ledger" rml="account/project/report/cost_ledger.rml" string="Cost Ledger"/>
<wizard id="account_analytic_account_cost_ledger_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.cost_ledger.report" string="Cost Ledger"/>
<report auto="False" id="account_analytic_account_quantity_cost_ledger" menu="False" model="account.analytic.account" name="account.analytic.account.quantity_cost_ledger" rml="account/project/report/quantity_cost_ledger.rml" string="Cost Ledger (Only quantities)"/>
<wizard id="account_analytic_account_quantity_cost_ledger_report" keyword="client_print_multi" model="account.analytic.account" name="account.analytic.account.quantity_cost_ledger.report" string="Cost Ledger (Only quantities)"/>
<report auto="False" id="account_analytic_account_analytic_check" menu="False" model="account.account" name="account.analytic.account.analytic.check" rml="account/project/report/analytic_check.rml" string="Analytic Check"/>
<wizard id="account_analytic_account_analytic_check_report" keyword="client_print_multi" model="account.account" name="account.analytic.account.analytic.check.report" string="Analytic Check"/>
<!--Budget -->
<!--<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"/>-->
</data>
</openerp>

View File

@ -28,7 +28,6 @@
#
##############################################################################
import budget_report
import central_journal
import general_journal
import account_journal

View File

@ -1,78 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import time
from report import report_sxw
import datetime
import operator
class budget_report(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(budget_report, self).__init__(cr, uid, name, context)
self.localcontext.update( {
'lines': self.lines,
'budget_total': self.budget_total,
'post_total': self.post_total,
'time': time,
})
def post_total(self, post_obj, date1, date2):
def str2date(date_str):
return datetime.date.fromtimestamp(time.mktime(time.strptime(date_str, '%Y-%m-%d')))
def interval(d1str, d2str):
return (str2date(d2str) - str2date(d1str) + datetime.timedelta(days=1)).days
prev = reduce(lambda x,d: x + d.amount, post_obj.dotation_ids, 0.0)
period_days = interval(date1, date2)
for d in post_obj.dotation_ids:
i = interval(d.period_id.date_start, d.period_id.date_stop)
total_days = reduce(lambda x,d: x+interval(d.period_id.date_start, d.period_id.date_stop), post_obj.dotation_ids, 0)
achievements = reduce(lambda x,l: x+l['achievements'], self.lines(post_obj, date1, date2), 0.0)
return [{'prev': prev, 'prev_period': prev * period_days / total_days, 'achievements': achievements}]
def budget_total(self, post_objs, date1, date2):
res = {'prev': 0.0, 'prev_period': 0.0, 'achievements': 0.0}
for post_obj in post_objs:
r = self.post_total(post_obj, date1, date2)[0]
for k in r:
res[k] += r[k]
return [res]
def lines(self, post_obj, date1, date2):
res = []
for a in post_obj.account_ids:
self.cr.execute("SELECT COALESCE(SUM(debit-credit), 0) FROM account_move_line WHERE account_id=%d AND date>=%s AND date<=%s and state<>'draft'", (a.id, date1, date2))
achievements = float(self.cr.fetchone()[0]) * (post_obj.sens=='produit' and -1 or 1)
res.append({'name': a.name, 'code': a.code, 'achievements': achievements})
return res
report_sxw.report_sxw('report.account.budget', 'account.budget.post', 'addons/account/report/budget_report.rml',parser=budget_report)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,248 +0,0 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(612.0,792.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="498" height="678"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
<blockBackground colorName="#e6e6e6" start="0,1" stop="0,1"/>
<blockBackground colorName="#e6e6e6" start="1,1" stop="1,1"/>
<blockBackground colorName="#e6e6e6" start="2,1" stop="2,1"/>
</blockTableStyle>
<blockTableStyle id="Table5">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
<blockTableStyle id="Table8">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table9">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table10">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table7">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Times-Bold" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P4" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Times-Bold" fontSize="18.0" leading="22" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P6" fontName="Times-Roman" alignment="CENTER"/>
<paraStyle name="P7" fontName="Times-BoldItalic" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P8" fontName="Times-Roman"/>
<paraStyle name="P9" fontName="Times-Bold"/>
<paraStyle name="P10" fontName="Times-Bold" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P11" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P13" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P14" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P15" fontName="Times-Bold" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P16" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P17" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P18" fontName="Times-Bold" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
</stylesheet>
<story>
<blockTable colWidths="145.0,189.0,164.0" repeatRows="1" style="Table2">
<tr>
<td>
<para style="P1">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P2">Budget Analysis</para>
</td>
<td>
<para style="P3">From [[ data['form']['date1'] ]]</para>
<para style="P3">to [[ data['form']['date2'] ]]</para>
</td>
</tr>
<tr>
<td>
<para style="P4">[[ company.name ]]</para>
</td>
<td>
<para style="P5">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P3">Currency: <font face="Times-Roman" size="11.0">[[ company.currency_id.name ]]</font></para>
</td>
</tr>
</blockTable>
<para style="Standard">
<font color="white"> </font>
</para>
<para style="P6">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
<para style="P6">
<font color="white"> </font>
</para>
<blockTable colWidths="104.0,53.0,60.0,72.0,73.0,63.0,73.0" repeatRows="1" style="Table5">
<tr>
<td>
<para style="P7">Budget item detail</para>
</td>
<td>
<para style="P7">Account Number</para>
</td>
<td>
<para style="P7">Budget</para>
<para style="P7">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P7">Period Budget</para>
<para style="P7">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P7">Performance</para>
</td>
<td>
<para style="P7">Spread</para>
</td>
<td>
<para style="P7">% performance</para>
</td>
</tr>
</blockTable>
<para style="P8">
<font color="white"> </font>
</para>
<section>
<para style="P8">[[ repeatIn(objects, 'o') ]]</para>
<blockTable colWidths="75.0,424.0" style="Table8">
<tr>
<td>
<para style="P9">[[ o.code ]]</para>
</td>
<td>
<para style="P10">[[ o.name ]]</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="103.0,53.0,61.0,72.0,72.0,66.0,71.0" style="Table9">
<tr>
<td>
<para style="P11">
<font face="Times-Roman">[[ repeatIn(lines(o, data['form']['date1'], data['form']['date2']), 'a') ]] </font>
<font face="Times-Roman">[[ a['name'] ]]</font>
</para>
</td>
<td>
<para style="P12">[[ a['code'] ]]</para>
</td>
<td>
<para style="P13">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P13">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P14">[[ '%.2f' % a['achievements'] ]]</para>
</td>
<td>
<para style="P13">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P13">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="156.0,61.0,72.0,72.0,66.0,70.0" style="Table10">
<tr>
<td>
<para style="P15">Total [[ o.code ]]</para>
<para style="Table Contents">[[ repeatIn( post_total(o, data['form']['date1'], data['form']['date2']), 'total') ]]</para>
</td>
<td>
<para style="P16">[[ '%.2f' % total['prev'] ]]</para>
</td>
<td>
<para style="P16">[[ '%.2f' % total['prev_period'] ]]</para>
</td>
<td>
<para style="P16">[[ '%.2f' % total['achievements'] ]]</para>
</td>
<td>
<para style="P16">[[ '%.2f' % (total['prev_period'] - total['achievements']) ]]</para>
</td>
<td>
<para style="P16">[[ total['prev_period'] and ('%.2f' % (total['achievements'] / total['prev_period'] * 100.0)) or 0.0]] %</para>
</td>
</tr>
</blockTable>
<para style="Standard">
<font color="white"> </font>
</para>
</section>
<blockTable colWidths="156.0,61.0,72.0,72.0,67.0,68.0" style="Table7">
<tr>
<td>
<para style="P17">Results</para>
<para style="Table Contents">[[ repeatIn( budget_total(objects, data['form']['date1'], data['form']['date2']), 'total') ]]</para>
</td>
<td>
<para style="P18">[[ '%.2f' % total['prev'] ]]</para>
</td>
<td>
<para style="P18">[[ '%.2f' % total['prev_period'] ]]</para>
</td>
<td>
<para style="P18">[[ '%.2f' % total['achievements'] ]]</para>
</td>
<td>
<para style="P18">[[ '%.2f' % (total['prev_period'] - total['achievements']) ]]</para>
</td>
<td>
<para style="P18">[[ '%.2f' % (total['achievements'] / total['prev_period'] * 100.0) ]] %</para>
</td>
</tr>
</blockTable>
<para style="Standard">
<font color="white"> </font>
</para>
</story>
</document>

View File

@ -1,67 +1,65 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_payment_term,account.payment.term,model_account_payment_term,account.group_account_user,1,0,0,0
access_account_payment_term_line,account.payment.term.line,model_account_payment_term_line,account.group_account_user,1,0,0,0
access_account_account_type,account.account.type,model_account_account_type,account.group_account_user,1,0,0,0
access_account_tax,account.tax,model_account_tax,account.group_account_user,1,0,0,0
access_account_account,account.account,model_account_account,account.group_account_user,1,0,0,0
access_account_journal_view,account.journal.view,model_account_journal_view,account.group_account_user,1,0,0,0
access_account_journal_column,account.journal.column,model_account_journal_column,account.group_account_user,1,0,0,0
access_account_journal,account.journal,model_account_journal,account.group_account_user,1,0,0,0
access_account_period,account.period,model_account_period,account.group_account_user,1,0,0,0
access_account_journal_period,account.journal.period,model_account_journal_period,account.group_account_user,1,1,1,1
access_account_move,account.move,model_account_move,account.group_account_user,1,1,1,1
access_account_move_reconcile,account.move.reconcile,model_account_move_reconcile,account.group_account_user,1,1,1,1
access_account_tax_code,account.tax.code,model_account_tax_code,account.group_account_user,1,0,0,0
access_account_tax,account.tax,model_account_tax,account.group_account_user,1,0,0,0
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
access_account_model,account.model,model_account_model,account.group_account_user,1,1,1,1
access_account_model_line,account.model.line,model_account_model_line,account.group_account_user,1,1,1,1
access_account_subscription,account.subscription,model_account_subscription,account.group_account_user,1,1,1,1
access_account_subscription_line,account.subscription.line,model_account_subscription_line,account.group_account_user,1,1,1,1
access_account_config_fiscalyear,account.config.fiscalyear,model_account_config_fiscalyear,account.group_account_manager,1,1,1,1
access_account_tax_template,account.tax.template,model_account_tax_template,account.group_account_manager,1,1,1,1
access_account_account_template,account.account.template,model_account_account_template,account.group_account_manager,1,1,1,1
access_account_tax_code_template,account.tax.code.template,model_account_tax_code_template,account.group_account_manager,1,1,1,1
access_account_chart_template,account.chart.template,model_account_chart_template,account.group_account_manager,1,1,1,1
access_account_tax_template,account.tax.template,model_account_tax_template,account.group_account_manager,1,1,1,1
access_wizard_multi_charts_accounts,wizard.multi.charts.accounts,model_wizard_multi_charts_accounts,account.group_account_manager,1,1,1,1
access_account_bank_accounts_wizard,account.bank.accounts.wizard,model_account_bank_accounts_wizard,account.group_account_manager,1,1,1,1
access_account_move_line,account.move.line,model_account_move_line,account.group_account_user,1,1,1,1
access_account_bank_statement,account.bank.statement,model_account_bank_statement,account.group_account_user,1,1,1,1
access_account_bank_statement_reconcile,account.bank.statement.reconcile,model_account_bank_statement_reconcile,account.group_account_user,1,1,1,1
access_account_bank_statement_reconcile_line,account.bank.statement.reconcile.line,model_account_bank_statement_reconcile_line,account.group_account_user,1,1,1,1
access_account_bank_statement_line,account.bank.statement.line,model_account_bank_statement_line,account.group_account_user,1,1,1,1
access_account_analytic_line,account.analytic.line,model_account_analytic_line,account.group_account_user,1,1,1,1
access_report_hr_timesheet_invoice_journal,report.hr.timesheet.invoice.journal,model_report_hr_timesheet_invoice_journal,account.group_account_manager,1,0,0,0
access_account_invoice,account.invoice,model_account_invoice,account.group_account_user,1,0,0,0
access_account_invoice_line,account.invoice.line,model_account_invoice_line,account.group_account_user,1,0,0,0
access_account_invoice_tax,account.invoice.tax,model_account_invoice_tax,account.group_account_user,1,0,0,0
access_account_analytic_account,account.analytic.account,model_account_analytic_account,account.group_account_user,1,0,0,0
access_account_analytic_journal,account.analytic.journal,model_account_analytic_journal,account.group_account_user,1,0,0,0
access_account_invoice_uinvoice,account.invoice,model_account_invoice,account.group_account_user,1,1,1,1
access_account_invoice_line_uinvoice,account.invoice.line,model_account_invoice_line,account.group_account_user,1,1,1,1
access_account_invoice_tax_uinvoice,account.invoice.tax,model_account_invoice_tax,account.group_account_user,1,1,1,1
access_account_analytic_line_uinvoice,account.analytic.line,model_account_analytic_line,account.group_account_user,1,1,1,1
access_account_move_uinvoice,account.move,model_account_move,account.group_account_user,1,1,1,1
access_account_move_reconcile_uinvoice,account.move.reconcile,model_account_move_reconcile,account.group_account_user,1,1,1,1
access_account_journal_period_uinvoice,account.journal.period,model_account_journal_period,account.group_account_user,1,1,1,1
access_account_payment_term_manager,account.payment.term,model_account_payment_term,account.group_account_manager,1,1,1,1
access_account_payment_term_line_manager,account.payment.term.line,model_account_payment_term_line,account.group_account_manager,1,1,1,1
access_account_account_type_manager,account.account.type,model_account_account_type,account.group_account_manager,1,1,1,1
access_account_tax_manager,account.tax,model_account_tax,account.group_account_manager,1,1,1,1
access_account_account_manager,account.account,model_account_account,account.group_account_manager,1,1,1,1
access_account_journal_view_manager,account.journal.view,model_account_journal_view,account.group_account_manager,1,1,1,1
access_account_journal_column_manager,account.journal.column,model_account_journal_column,account.group_account_manager,1,1,1,1
access_account_journal_manager,account.journal,model_account_journal,account.group_account_manager,1,1,1,1
access_account_period_manager,account.period,model_account_period,account.group_account_manager,1,1,1,1
access_account_tax_code_manager,account.tax.code,model_account_tax_code,account.group_account_manager,1,1,1,1
access_account_tax_manager,account.tax,model_account_tax,account.group_account_manager,1,1,1,1
access_account_invoice_manager,account.invoice,model_account_invoice,account.group_account_manager,1,1,1,1
access_account_invoice_line_manager,account.invoice.line,model_account_invoice_line,account.group_account_manager,1,1,1,1
access_account_invoice_tax_manager,account.invoice.tax,model_account_invoice_tax,account.group_account_manager,1,1,1,1
access_account_analytic_account_manager,account.analytic.account,model_account_analytic_account,account.group_account_manager,1,1,1,1
access_account_analytic_journal_manager,account.analytic.journal,model_account_analytic_journal,account.group_account_manager,1,1,1,1
access_account_fiscalyear,account.fiscalyear,model_account_fiscalyear,account.group_account_manager,1,1,1,1
access_account_fiscalyear_user,account.fiscalyear.user,model_account_fiscalyear,account.group_account_user,1,0,0,0
access_account_fiscalyear_invoice,account.fiscalyear.invoice,model_account_fiscalyear,account.group_account_invoice,1,0,0,0
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_account_payment_term","account.payment.term","model_account_payment_term","account.group_account_user",1,0,0,0
"access_account_payment_term_line","account.payment.term.line","model_account_payment_term_line","account.group_account_user",1,0,0,0
"access_account_account_type","account.account.type","model_account_account_type","account.group_account_user",1,0,0,0
"access_account_tax","account.tax","model_account_tax","account.group_account_user",1,0,0,0
"access_account_account","account.account","model_account_account","account.group_account_user",1,0,0,0
"access_account_journal_view","account.journal.view","model_account_journal_view","account.group_account_user",1,0,0,0
"access_account_journal_column","account.journal.column","model_account_journal_column","account.group_account_user",1,0,0,0
"access_account_journal","account.journal","model_account_journal","account.group_account_user",1,0,0,0
"access_account_period","account.period","model_account_period","account.group_account_user",1,0,0,0
"access_account_journal_period","account.journal.period","model_account_journal_period","account.group_account_user",1,1,1,1
"access_account_move","account.move","model_account_move","account.group_account_user",1,1,1,1
"access_account_move_reconcile","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1
"access_account_tax_code","account.tax.code","model_account_tax_code","account.group_account_user",1,0,0,0
"access_account_tax","account.tax","model_account_tax","account.group_account_user",1,0,0,0
"access_account_model","account.model","model_account_model","account.group_account_user",1,1,1,1
"access_account_model_line","account.model.line","model_account_model_line","account.group_account_user",1,1,1,1
"access_account_subscription","account.subscription","model_account_subscription","account.group_account_user",1,1,1,1
"access_account_subscription_line","account.subscription.line","model_account_subscription_line","account.group_account_user",1,1,1,1
"access_account_config_fiscalyear","account.config.fiscalyear","model_account_config_fiscalyear","account.group_account_manager",1,1,1,1
"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,1,1,1
"access_account_account_template","account.account.template","model_account_account_template","account.group_account_manager",1,1,1,1
"access_account_tax_code_template","account.tax.code.template","model_account_tax_code_template","account.group_account_manager",1,1,1,1
"access_account_chart_template","account.chart.template","model_account_chart_template","account.group_account_manager",1,1,1,1
"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,1,1,1
"access_wizard_multi_charts_accounts","wizard.multi.charts.accounts","model_wizard_multi_charts_accounts","account.group_account_manager",1,1,1,1
"access_account_bank_accounts_wizard","account.bank.accounts.wizard","model_account_bank_accounts_wizard","account.group_account_manager",1,1,1,1
"access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1
"access_account_bank_statement","account.bank.statement","model_account_bank_statement","account.group_account_user",1,1,1,1
"access_account_bank_statement_reconcile","account.bank.statement.reconcile","model_account_bank_statement_reconcile","account.group_account_user",1,1,1,1
"access_account_bank_statement_reconcile_line","account.bank.statement.reconcile.line","model_account_bank_statement_reconcile_line","account.group_account_user",1,1,1,1
"access_account_bank_statement_line","account.bank.statement.line","model_account_bank_statement_line","account.group_account_user",1,1,1,1
"access_account_analytic_line","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
"access_report_hr_timesheet_invoice_journal","report.hr.timesheet.invoice.journal","model_report_hr_timesheet_invoice_journal","account.group_account_manager",1,0,0,0
"access_account_invoice","account.invoice","model_account_invoice","account.group_account_user",1,0,0,0
"access_account_invoice_line","account.invoice.line","model_account_invoice_line","account.group_account_user",1,0,0,0
"access_account_invoice_tax","account.invoice.tax","model_account_invoice_tax","account.group_account_user",1,0,0,0
"access_account_analytic_account","account.analytic.account","model_account_analytic_account","account.group_account_user",1,0,0,0
"access_account_analytic_journal","account.analytic.journal","model_account_analytic_journal","account.group_account_user",1,0,0,0
"access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_user",1,1,1,1
"access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_user",1,1,1,1
"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_user",1,1,1,1
"access_account_analytic_line_uinvoice","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
"access_account_move_uinvoice","account.move","model_account_move","account.group_account_user",1,1,1,1
"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1
"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_user",1,1,1,1
"access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,1,1,1
"access_account_payment_term_line_manager","account.payment.term.line","model_account_payment_term_line","account.group_account_manager",1,1,1,1
"access_account_account_type_manager","account.account.type","model_account_account_type","account.group_account_manager",1,1,1,1
"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1
"access_account_account_manager","account.account","model_account_account","account.group_account_manager",1,1,1,1
"access_account_journal_view_manager","account.journal.view","model_account_journal_view","account.group_account_manager",1,1,1,1
"access_account_journal_column_manager","account.journal.column","model_account_journal_column","account.group_account_manager",1,1,1,1
"access_account_journal_manager","account.journal","model_account_journal","account.group_account_manager",1,1,1,1
"access_account_period_manager","account.period","model_account_period","account.group_account_manager",1,1,1,1
"access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,1,1,1
"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1
"access_account_invoice_manager","account.invoice","model_account_invoice","account.group_account_manager",1,1,1,1
"access_account_invoice_line_manager","account.invoice.line","model_account_invoice_line","account.group_account_manager",1,1,1,1
"access_account_invoice_tax_manager","account.invoice.tax","model_account_invoice_tax","account.group_account_manager",1,1,1,1
"access_account_analytic_account_manager","account.analytic.account","model_account_analytic_account","account.group_account_manager",1,1,1,1
"access_account_analytic_journal_manager","account.analytic.journal","model_account_analytic_journal","account.group_account_manager",1,1,1,1
"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,1,1,1
"access_account_fiscalyear_user","account.fiscalyear.user","model_account_fiscalyear","account.group_account_user",1,0,0,0
"access_account_fiscalyear_invoice","account.fiscalyear.invoice","model_account_fiscalyear","account.group_account_invoice",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_payment_term account.payment.term model_account_payment_term account.group_account_user 1 0 0 0
3 access_account_payment_term_line account.payment.term.line model_account_payment_term_line account.group_account_user 1 0 0 0
4 access_account_account_type account.account.type model_account_account_type account.group_account_user 1 0 0 0
5 access_account_tax account.tax model_account_tax account.group_account_user 1 0 0 0
6 access_account_account account.account model_account_account account.group_account_user 1 0 0 0
7 access_account_journal_view account.journal.view model_account_journal_view account.group_account_user 1 0 0 0
8 access_account_journal_column account.journal.column model_account_journal_column account.group_account_user 1 0 0 0
9 access_account_journal account.journal model_account_journal account.group_account_user 1 0 0 0
10 access_account_period account.period model_account_period account.group_account_user 1 0 0 0
11 access_account_journal_period account.journal.period model_account_journal_period account.group_account_user 1 1 1 1
12 access_account_move account.move model_account_move account.group_account_user 1 1 1 1
13 access_account_move_reconcile account.move.reconcile model_account_move_reconcile account.group_account_user 1 1 1 1
14 access_account_tax_code account.tax.code model_account_tax_code account.group_account_user 1 0 0 0
15 access_account_tax account.tax model_account_tax account.group_account_user 1 0 0 0
16 access_account_budget_post access_account_model account.budget.post account.model model_account_budget_post model_account_model account.group_account_manager account.group_account_user 1 1 1 1
17 access_account_budget_post_dotation access_account_model_line account.budget.post.dotation account.model.line model_account_budget_post_dotation model_account_model_line account.group_account_manager account.group_account_user 1 1 1 1
18 access_account_model access_account_subscription account.model account.subscription model_account_model model_account_subscription account.group_account_user 1 1 1 1
19 access_account_model_line access_account_subscription_line account.model.line account.subscription.line model_account_model_line model_account_subscription_line account.group_account_user 1 1 1 1
20 access_account_subscription access_account_config_fiscalyear account.subscription account.config.fiscalyear model_account_subscription model_account_config_fiscalyear account.group_account_user account.group_account_manager 1 1 1 1
21 access_account_subscription_line access_account_tax_template account.subscription.line account.tax.template model_account_subscription_line model_account_tax_template account.group_account_user account.group_account_manager 1 1 1 1
22 access_account_config_fiscalyear access_account_account_template account.config.fiscalyear account.account.template model_account_config_fiscalyear model_account_account_template account.group_account_manager 1 1 1 1
23 access_account_tax_template access_account_tax_code_template account.tax.template account.tax.code.template model_account_tax_template model_account_tax_code_template account.group_account_manager 1 1 1 1
24 access_account_account_template access_account_chart_template account.account.template account.chart.template model_account_account_template model_account_chart_template account.group_account_manager 1 1 1 1
25 access_account_tax_code_template access_account_tax_template account.tax.code.template account.tax.template model_account_tax_code_template model_account_tax_template account.group_account_manager 1 1 1 1
26 access_account_chart_template access_wizard_multi_charts_accounts account.chart.template wizard.multi.charts.accounts model_account_chart_template model_wizard_multi_charts_accounts account.group_account_manager 1 1 1 1
27 access_account_tax_template access_account_bank_accounts_wizard account.tax.template account.bank.accounts.wizard model_account_tax_template model_account_bank_accounts_wizard account.group_account_manager 1 1 1 1
28 access_wizard_multi_charts_accounts access_account_move_line wizard.multi.charts.accounts account.move.line model_wizard_multi_charts_accounts model_account_move_line account.group_account_manager account.group_account_user 1 1 1 1
29 access_account_bank_accounts_wizard access_account_bank_statement account.bank.accounts.wizard account.bank.statement model_account_bank_accounts_wizard model_account_bank_statement account.group_account_manager account.group_account_user 1 1 1 1
30 access_account_move_line access_account_bank_statement_reconcile account.move.line account.bank.statement.reconcile model_account_move_line model_account_bank_statement_reconcile account.group_account_user 1 1 1 1
31 access_account_bank_statement access_account_bank_statement_reconcile_line account.bank.statement account.bank.statement.reconcile.line model_account_bank_statement model_account_bank_statement_reconcile_line account.group_account_user 1 1 1 1
32 access_account_bank_statement_reconcile access_account_bank_statement_line account.bank.statement.reconcile account.bank.statement.line model_account_bank_statement_reconcile model_account_bank_statement_line account.group_account_user 1 1 1 1
33 access_account_bank_statement_reconcile_line access_account_analytic_line account.bank.statement.reconcile.line account.analytic.line model_account_bank_statement_reconcile_line model_account_analytic_line account.group_account_user 1 1 1 1
34 access_account_bank_statement_line access_report_hr_timesheet_invoice_journal account.bank.statement.line report.hr.timesheet.invoice.journal model_account_bank_statement_line model_report_hr_timesheet_invoice_journal account.group_account_user account.group_account_manager 1 1 0 1 0 1 0
35 access_account_analytic_line access_account_invoice account.analytic.line account.invoice model_account_analytic_line model_account_invoice account.group_account_user 1 1 0 1 0 1 0
36 access_report_hr_timesheet_invoice_journal access_account_invoice_line report.hr.timesheet.invoice.journal account.invoice.line model_report_hr_timesheet_invoice_journal model_account_invoice_line account.group_account_manager account.group_account_user 1 0 0 0
37 access_account_invoice access_account_invoice_tax account.invoice account.invoice.tax model_account_invoice model_account_invoice_tax account.group_account_user 1 0 0 0
38 access_account_invoice_line access_account_analytic_account account.invoice.line account.analytic.account model_account_invoice_line model_account_analytic_account account.group_account_user 1 0 0 0
39 access_account_invoice_tax access_account_analytic_journal account.invoice.tax account.analytic.journal model_account_invoice_tax model_account_analytic_journal account.group_account_user 1 0 0 0
40 access_account_analytic_account access_account_invoice_uinvoice account.analytic.account account.invoice model_account_analytic_account model_account_invoice account.group_account_user 1 0 1 0 1 0 1
41 access_account_analytic_journal access_account_invoice_line_uinvoice account.analytic.journal account.invoice.line model_account_analytic_journal model_account_invoice_line account.group_account_user 1 0 1 0 1 0 1
42 access_account_invoice_uinvoice access_account_invoice_tax_uinvoice account.invoice account.invoice.tax model_account_invoice model_account_invoice_tax account.group_account_user 1 1 1 1
43 access_account_invoice_line_uinvoice access_account_analytic_line_uinvoice account.invoice.line account.analytic.line model_account_invoice_line model_account_analytic_line account.group_account_user 1 1 1 1
44 access_account_invoice_tax_uinvoice access_account_move_uinvoice account.invoice.tax account.move model_account_invoice_tax model_account_move account.group_account_user 1 1 1 1
45 access_account_analytic_line_uinvoice access_account_move_reconcile_uinvoice account.analytic.line account.move.reconcile model_account_analytic_line model_account_move_reconcile account.group_account_user 1 1 1 1
46 access_account_move_uinvoice access_account_journal_period_uinvoice account.move account.journal.period model_account_move model_account_journal_period account.group_account_user 1 1 1 1
47 access_account_move_reconcile_uinvoice access_account_payment_term_manager account.move.reconcile account.payment.term model_account_move_reconcile model_account_payment_term account.group_account_user account.group_account_manager 1 1 1 1
48 access_account_journal_period_uinvoice access_account_payment_term_line_manager account.journal.period account.payment.term.line model_account_journal_period model_account_payment_term_line account.group_account_user account.group_account_manager 1 1 1 1
49 access_account_payment_term_manager access_account_account_type_manager account.payment.term account.account.type model_account_payment_term model_account_account_type account.group_account_manager 1 1 1 1
50 access_account_payment_term_line_manager access_account_tax_manager account.payment.term.line account.tax model_account_payment_term_line model_account_tax account.group_account_manager 1 1 1 1
51 access_account_account_type_manager access_account_account_manager account.account.type account.account model_account_account_type model_account_account account.group_account_manager 1 1 1 1
52 access_account_tax_manager access_account_journal_view_manager account.tax account.journal.view model_account_tax model_account_journal_view account.group_account_manager 1 1 1 1
53 access_account_account_manager access_account_journal_column_manager account.account account.journal.column model_account_account model_account_journal_column account.group_account_manager 1 1 1 1
54 access_account_journal_view_manager access_account_journal_manager account.journal.view account.journal model_account_journal_view model_account_journal account.group_account_manager 1 1 1 1
55 access_account_journal_column_manager access_account_period_manager account.journal.column account.period model_account_journal_column model_account_period account.group_account_manager 1 1 1 1
56 access_account_journal_manager access_account_tax_code_manager account.journal account.tax.code model_account_journal model_account_tax_code account.group_account_manager 1 1 1 1
57 access_account_period_manager access_account_tax_manager account.period account.tax model_account_period model_account_tax account.group_account_manager 1 1 1 1
58 access_account_tax_code_manager access_account_invoice_manager account.tax.code account.invoice model_account_tax_code model_account_invoice account.group_account_manager 1 1 1 1
59 access_account_tax_manager access_account_invoice_line_manager account.tax account.invoice.line model_account_tax model_account_invoice_line account.group_account_manager 1 1 1 1
60 access_account_invoice_manager access_account_invoice_tax_manager account.invoice account.invoice.tax model_account_invoice model_account_invoice_tax account.group_account_manager 1 1 1 1
61 access_account_invoice_line_manager access_account_analytic_account_manager account.invoice.line account.analytic.account model_account_invoice_line model_account_analytic_account account.group_account_manager 1 1 1 1
62 access_account_invoice_tax_manager access_account_analytic_journal_manager account.invoice.tax account.analytic.journal model_account_invoice_tax model_account_analytic_journal account.group_account_manager 1 1 1 1
63 access_account_analytic_account_manager access_account_fiscalyear account.analytic.account account.fiscalyear model_account_analytic_account model_account_fiscalyear account.group_account_manager 1 1 1 1
64 access_account_analytic_journal_manager access_account_fiscalyear_user account.analytic.journal account.fiscalyear.user model_account_analytic_journal model_account_fiscalyear account.group_account_manager account.group_account_user 1 1 0 1 0 1 0
65 access_account_fiscalyear access_account_fiscalyear_invoice account.fiscalyear account.fiscalyear.invoice model_account_fiscalyear account.group_account_manager account.group_account_invoice 1 1 0 1 0 1 0
access_account_fiscalyear_user account.fiscalyear.user model_account_fiscalyear account.group_account_user 1 0 0 0
access_account_fiscalyear_invoice account.fiscalyear.invoice model_account_fiscalyear account.group_account_invoice 1 0 0 0

View File

@ -39,11 +39,9 @@ import wizard_pay_invoice
import wizard_journal
import wizard_journal_select
import wizard_bank_reconcile
import wizard_budget_spread
import wizard_subscription_generate
import wizard_aged_trial_balance
import wizard_budget_report
import wizard_general_ledger_report
import wizard_third_party_ledger
import wizard_account_balance_report

View File

@ -1,61 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import time
import wizard
dates_form = '''<?xml version="1.0"?>
<form string="Select period">
<field name="date1"/>
<field name="date2"/>
</form>'''
dates_fields = {
'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
}
class wizard_report(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('report','Print')]}
},
'report': {
'actions': [],
'result': {'type':'print', 'report':'account.budget', 'state':'end'}
}
}
wizard_report('account.budget.report')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,66 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import wizard
import netsvc
_spread_form = '''<?xml version="1.0"?>
<form string="Spread">
<field name="fiscalyear"/>
<field name="amount"/>
</form>'''
_spread_fields = {
'fiscalyear': {'string':'Fiscal Year', 'type':'many2one', 'relation':'account.fiscalyear', 'required':True},
'amount': {'string':'Amount', 'type':'float', 'digits':(16,2)},
}
class wizard_budget_spread(wizard.interface):
def _spread(self, cr, uid, data, context):
service = netsvc.LocalService("object_proxy")
form = data['form']
res = service.execute(cr.dbname, uid, 'account.budget.post', 'spread', data['ids'], form['fiscalyear'], form['amount'])
return {}
states = {
'init': {
'actions': [],
'result': {'type':'form', 'arch':_spread_form, 'fields':_spread_fields, 'state':[('end','Cancel'),('spread','Spread')]}
},
'spread': {
'actions': [_spread],
'result': {'type':'state', 'state':'end'}
}
}
wizard_budget_spread('account.budget.spread')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -191,6 +191,94 @@ class account_analytic_account(osv.osv):
account_analytic_account()
#moved from account modules
# ---------------------------------------------------------
# Budgets (project)
# ---------------------------------------------------------
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#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()

View File

@ -40,5 +40,9 @@
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>

View File

@ -250,6 +250,96 @@
</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>

View File

@ -1,5 +1,7 @@
# -*- encoding: utf-8 -*-
import crossovered_budget_report
import analytic_account_budget_report
import budget_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,3 +1,5 @@
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
"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

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_crossovered_budget crossovered.budget model_crossovered_budget account.group_account_manager 1 1 1 1
3 access_crossovered_budget_lines crossovered.budget.lines model_crossovered_budget_lines account.group_account_manager 1 1 1 1
4 access_account_budget_post account.budget.post model_account_budget_post account.group_account_manager 1 1 1 1
5 access_account_budget_post_dotation account.budget.post.dotation model_account_budget_post_dotation account.group_account_manager 1 1 1 1

View File

@ -2,5 +2,7 @@
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: