*removed everything related to quantity in budgets

bzr revid: qdp-1d7e21a90c48947fecfe1b44d5e21db8d335d76f
This commit is contained in:
qdp 2008-05-26 10:06:34 +00:00
parent 3724cb49a2
commit 47df4cdafa
3 changed files with 18 additions and 22 deletions

View File

@ -722,7 +722,7 @@ class account_move(osv.osv):
'There is no default default credit account defined \n' \
'on journal "%s"' % move.journal_id.name)
# find the first line of this move with the current mode
# find the first line of this move with the current mode
# or create it if it doesn't exist
cr.execute('select id from account_move_line where move_id=%d and centralisation=%s limit 1', (move.id, mode))
res = cr.fetchone()
@ -909,7 +909,7 @@ account_move_reconcile()
# Tax
#----------------------------------------------------------
"""
a documenter
a documenter
child_depend: la taxe depend des taxes filles
"""
class account_tax_code(osv.osv):
@ -1079,7 +1079,7 @@ class account_tax(osv.osv):
'company_id': _default_company,
}
_order = 'sequence'
def _applicable(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None):
res = []
for tax in taxes:
@ -1297,7 +1297,7 @@ class account_budget_post(osv.osv):
_defaults = {
}
def spread(self, cr, uid, ids, fiscalyear_id=False, quantity=0.0, amount=0.0):
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
@ -1307,7 +1307,7 @@ class account_budget_post(osv.osv):
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})
dobj.create(cr, uid, {'post_id': o.id, 'period_id': p.id, 'amount': amount/num})
return True
account_budget_post()
@ -1318,7 +1318,7 @@ class account_budget_post_dotation(osv.osv):
'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)),
# 'quantity': fields.float('Quantity', digits=(16,2)),
'amount': fields.float('Amount', digits=(16,2)),
}
account_budget_post_dotation()

View File

@ -347,7 +347,7 @@
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field name="account_id" domain="[('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]"/>
<field name="amount"/>
<field name="reconcile_id" context="{'partner_id':partner_id,'amount':amount,'account_id':account_id}"/>
<field name="reconcile_id" context="{'partner_id':partner_id,'amount':amount,'account_id':account_id}"/>
<field name="ref"/>
<separator string="Notes" colspan="4"/>
<field name="note" nolabel="1" colspan="4"/>
@ -973,7 +973,7 @@
domain="[('journal_id', '=', parent.journal_id)]"/>
<field name="amount"/>
<field name="reconcile_id"
context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id}"/>
context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id}"/>
</form>
</field>
</page>
@ -995,7 +995,7 @@
<field name="view_mode">form,tree</field>
<field name="view_id" ref="view_bank_statement_reconcile_form"/>
</record>
<menuitem
<menuitem
name="Financial Management/Periodical Processing/Bank Reconciliation/Statement by Importing Entries"
id="menu_action_account_bank_reconcile_tree"
action="action_bank_statement_reconciliation_form"
@ -1056,14 +1056,14 @@
<field name="res_model">account.journal.period</field>
<field name="view_type">tree</field>
</record>
<menuitem name="Financial Management/Reporting/Print Journals" id="menu_action_account_journal_period_tree" action="action_account_journal_period_tree"/>
<menuitem name="Financial Management/Reporting/Print Journals" id="menu_action_account_journal_period_tree" action="action_account_journal_period_tree"/>
<record model="ir.actions.act_window" id="action_account_budget_post_tree">
<field name="name">Budgets</field>
<field name="res_model">account.budget.post</field>
<field name="view_type">tree</field>
</record>
<menuitem name="Financial Management/Reporting/Print Budgets" id="menu_action_account_budget_post_tree" action="action_account_budget_post_tree"/>
<menuitem name="Financial Management/Reporting/Print Budgets" id="menu_action_account_budget_post_tree" action="action_account_budget_post_tree"/>
<!--
Budgets
@ -1078,10 +1078,12 @@
<page string="Definition">
<field name="code" select="1"/>
<field name="name" select="1"/>
</page><page string="Dotations">
</page>
<page string="Dotations">
<button string="Spread" name="%(wizard_budget_spread)d" type="action"/>
<field name="dotation_ids" colspan="4" nolabel="1"/>
</page><page string="Accounts">
</page>
<page string="Accounts">
<field name="account_ids" colspan="4" nolabel="1"/>
</page>
</notebook>
@ -1106,8 +1108,6 @@
<field name="arch" type="xml">
<form string="Master Budget Expenses">
<field name="period_id"/>
<newline/>
<field name="quantity"/>
<field name="amount"/>
</form>
</field>
@ -1119,12 +1119,11 @@
<field name="arch" type="xml">
<tree string="Master Budget Expenses">
<field name="period_id"/>
<field name="quantity"/>
<field name="amount"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="open_budget_post_form">
<field name="res_model">account.budget.post</field>
<field name="view_type">form</field>

View File

@ -31,14 +31,11 @@ import netsvc
_spread_form = '''<?xml version="1.0"?>
<form string="Spread">
<field name="fiscalyear"/>
<newline/>
<field name="quantity"/>
<field name="amount"/>
</form>'''
_spread_fields = {
'fiscalyear': {'string':'Fiscal Year', 'type':'many2one', 'relation':'account.fiscalyear', 'required':True},
'quantity': {'string':'Quantity', 'type':'float', 'digits':(16,2)},
'amount': {'string':'Amount', 'type':'float', 'digits':(16,2)},
}
@ -46,9 +43,9 @@ 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['quantity'], form['amount'])
res = service.execute(cr.dbname, uid, 'account.budget.post', 'spread', data['ids'], form['fiscalyear'], form['amount'])
return {}
states = {
'init': {
'actions': [],