*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' \ 'There is no default default credit account defined \n' \
'on journal "%s"' % move.journal_id.name) '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 # 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)) cr.execute('select id from account_move_line where move_id=%d and centralisation=%s limit 1', (move.id, mode))
res = cr.fetchone() res = cr.fetchone()
@ -909,7 +909,7 @@ account_move_reconcile()
# Tax # Tax
#---------------------------------------------------------- #----------------------------------------------------------
""" """
a documenter a documenter
child_depend: la taxe depend des taxes filles child_depend: la taxe depend des taxes filles
""" """
class account_tax_code(osv.osv): class account_tax_code(osv.osv):
@ -1079,7 +1079,7 @@ class account_tax(osv.osv):
'company_id': _default_company, 'company_id': _default_company,
} }
_order = 'sequence' _order = 'sequence'
def _applicable(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None): def _applicable(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None):
res = [] res = []
for tax in taxes: for tax in taxes:
@ -1297,7 +1297,7 @@ class account_budget_post(osv.osv):
_defaults = { _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') dobj = self.pool.get('account.budget.post.dotation')
for o in self.browse(cr, uid, ids): for o in self.browse(cr, uid, ids):
# delete dotations for this post # 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] fy = self.pool.get('account.fiscalyear').browse(cr, uid, [fiscalyear_id])[0]
num = len(fy.period_ids) num = len(fy.period_ids)
for p in 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 return True
account_budget_post() account_budget_post()
@ -1318,7 +1318,7 @@ class account_budget_post_dotation(osv.osv):
'name': fields.char('Name', size=64), 'name': fields.char('Name', size=64),
'post_id': fields.many2one('account.budget.post', 'Item', select=True), 'post_id': fields.many2one('account.budget.post', 'Item', select=True),
'period_id': fields.many2one('account.period', 'Period'), '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)), 'amount': fields.float('Amount', digits=(16,2)),
} }
account_budget_post_dotation() 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="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="account_id" domain="[('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]"/>
<field name="amount"/> <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"/> <field name="ref"/>
<separator string="Notes" colspan="4"/> <separator string="Notes" colspan="4"/>
<field name="note" nolabel="1" colspan="4"/> <field name="note" nolabel="1" colspan="4"/>
@ -973,7 +973,7 @@
domain="[('journal_id', '=', parent.journal_id)]"/> domain="[('journal_id', '=', parent.journal_id)]"/>
<field name="amount"/> <field name="amount"/>
<field name="reconcile_id" <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> </form>
</field> </field>
</page> </page>
@ -995,7 +995,7 @@
<field name="view_mode">form,tree</field> <field name="view_mode">form,tree</field>
<field name="view_id" ref="view_bank_statement_reconcile_form"/> <field name="view_id" ref="view_bank_statement_reconcile_form"/>
</record> </record>
<menuitem <menuitem
name="Financial Management/Periodical Processing/Bank Reconciliation/Statement by Importing Entries" name="Financial Management/Periodical Processing/Bank Reconciliation/Statement by Importing Entries"
id="menu_action_account_bank_reconcile_tree" id="menu_action_account_bank_reconcile_tree"
action="action_bank_statement_reconciliation_form" action="action_bank_statement_reconciliation_form"
@ -1056,14 +1056,14 @@
<field name="res_model">account.journal.period</field> <field name="res_model">account.journal.period</field>
<field name="view_type">tree</field> <field name="view_type">tree</field>
</record> </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"> <record model="ir.actions.act_window" id="action_account_budget_post_tree">
<field name="name">Budgets</field> <field name="name">Budgets</field>
<field name="res_model">account.budget.post</field> <field name="res_model">account.budget.post</field>
<field name="view_type">tree</field> <field name="view_type">tree</field>
</record> </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 Budgets
@ -1078,10 +1078,12 @@
<page string="Definition"> <page string="Definition">
<field name="code" select="1"/> <field name="code" select="1"/>
<field name="name" 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"/> <button string="Spread" name="%(wizard_budget_spread)d" type="action"/>
<field name="dotation_ids" colspan="4" nolabel="1"/> <field name="dotation_ids" colspan="4" nolabel="1"/>
</page><page string="Accounts"> </page>
<page string="Accounts">
<field name="account_ids" colspan="4" nolabel="1"/> <field name="account_ids" colspan="4" nolabel="1"/>
</page> </page>
</notebook> </notebook>
@ -1106,8 +1108,6 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Master Budget Expenses"> <form string="Master Budget Expenses">
<field name="period_id"/> <field name="period_id"/>
<newline/>
<field name="quantity"/>
<field name="amount"/> <field name="amount"/>
</form> </form>
</field> </field>
@ -1119,12 +1119,11 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Master Budget Expenses"> <tree string="Master Budget Expenses">
<field name="period_id"/> <field name="period_id"/>
<field name="quantity"/>
<field name="amount"/> <field name="amount"/>
</tree> </tree>
</field> </field>
</record> </record>
<record model="ir.actions.act_window" id="open_budget_post_form"> <record model="ir.actions.act_window" id="open_budget_post_form">
<field name="res_model">account.budget.post</field> <field name="res_model">account.budget.post</field>
<field name="view_type">form</field> <field name="view_type">form</field>

View File

@ -31,14 +31,11 @@ import netsvc
_spread_form = '''<?xml version="1.0"?> _spread_form = '''<?xml version="1.0"?>
<form string="Spread"> <form string="Spread">
<field name="fiscalyear"/> <field name="fiscalyear"/>
<newline/>
<field name="quantity"/>
<field name="amount"/> <field name="amount"/>
</form>''' </form>'''
_spread_fields = { _spread_fields = {
'fiscalyear': {'string':'Fiscal Year', 'type':'many2one', 'relation':'account.fiscalyear', 'required':True}, '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)}, '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): def _spread(self, cr, uid, data, context):
service = netsvc.LocalService("object_proxy") service = netsvc.LocalService("object_proxy")
form = data['form'] 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 {} return {}
states = { states = {
'init': { 'init': {
'actions': [], 'actions': [],