*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

@ -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

@ -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,7 +1119,6 @@
<field name="arch" type="xml">
<tree string="Master Budget Expenses">
<field name="period_id"/>
<field name="quantity"/>
<field name="amount"/>
</tree>
</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,7 +43,7 @@ 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 = {