[FIX] account: Syntax error
bzr revid: mra@tinyerp.com-20100426044716-83avunremnrzix5q
This commit is contained in:
parent
997a810afd
commit
08f80fef82
|
@ -291,7 +291,7 @@ class account_account(osv.osv):
|
||||||
"special effects in Open ERP: view can not have entries, consolidation are accounts that "\
|
"special effects in Open ERP: view can not have entries, consolidation are accounts that "\
|
||||||
"can have children accounts for multi-company consolidations, payable/receivable are for "\
|
"can have children accounts for multi-company consolidations, payable/receivable are for "\
|
||||||
"partners accounts (for debit/credit computations), closed for depreciated accounts."),
|
"partners accounts (for debit/credit computations), closed for depreciated accounts."),
|
||||||
'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
|
'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
|
||||||
help="These types are defined according to your country. The type contains more information "\
|
help="These types are defined according to your country. The type contains more information "\
|
||||||
"about the account and its specificities."),
|
"about the account and its specificities."),
|
||||||
'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'),
|
'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'),
|
||||||
|
@ -437,18 +437,18 @@ class account_account(osv.osv):
|
||||||
elif method == 'unlink':
|
elif method == 'unlink':
|
||||||
raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. '))
|
raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. '))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def write(self, cr, uid, ids, vals, context=None):
|
def write(self, cr, uid, ids, vals, context=None):
|
||||||
if not context:
|
if not context:
|
||||||
context = {}
|
context = {}
|
||||||
if 'active' in vals and not vals['active']:
|
if 'active' in vals and not vals['active']:
|
||||||
self._check_moves(cr, uid, ids, "write", context)
|
self._check_moves(cr, uid, ids, "write", context)
|
||||||
return super(account_account, self).write(cr, uid, ids, vals, context=context)
|
return super(account_account, self).write(cr, uid, ids, vals, context=context)
|
||||||
|
|
||||||
def unlink(self, cr, uid, ids, context={}):
|
def unlink(self, cr, uid, ids, context={}):
|
||||||
self._check_moves(cr, uid, ids, "unlink", context)
|
self._check_moves(cr, uid, ids, "unlink", context)
|
||||||
return super(account_account, self).unlink(cr, uid, ids, context)
|
return super(account_account, self).unlink(cr, uid, ids, context)
|
||||||
|
|
||||||
account_account()
|
account_account()
|
||||||
|
|
||||||
class account_journal_view(osv.osv):
|
class account_journal_view(osv.osv):
|
||||||
|
@ -791,7 +791,7 @@ class account_move(osv.osv):
|
||||||
for id in ids:
|
for id in ids:
|
||||||
result.setdefault(id, 0.0)
|
result.setdefault(id, 0.0)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _search_amount(self, cr, uid, obj, name, args, context):
|
def _search_amount(self, cr, uid, obj, name, args, context):
|
||||||
ids = []
|
ids = []
|
||||||
cr.execute('select move_id,sum(debit) from account_move_line group by move_id')
|
cr.execute('select move_id,sum(debit) from account_move_line group by move_id')
|
||||||
|
@ -801,10 +801,10 @@ class account_move(osv.osv):
|
||||||
if item[1] == '>=':
|
if item[1] == '>=':
|
||||||
res = [('id', 'in', [k for k,v in result.iteritems() if v >= item[2]])]
|
res = [('id', 'in', [k for k,v in result.iteritems() if v >= item[2]])]
|
||||||
else:
|
else:
|
||||||
res = [('id', 'in', [k for k,v in result.iteritems() if v <= item[2]])]
|
res = [('id', 'in', [k for k,v in result.iteritems() if v <= item[2]])]
|
||||||
ids += res
|
ids += res
|
||||||
|
|
||||||
if not ids:
|
if not ids:
|
||||||
return [('id', '>', '0')]
|
return [('id', '>', '0')]
|
||||||
|
|
||||||
return ids
|
return ids
|
||||||
|
@ -1062,7 +1062,7 @@ class account_move(osv.osv):
|
||||||
# Example:
|
# Example:
|
||||||
# difference == 0.01 is OK iff price_accuracy <= 1!
|
# difference == 0.01 is OK iff price_accuracy <= 1!
|
||||||
# difference == 0.0001 is OK iff price_accuracy <= 3!
|
# difference == 0.0001 is OK iff price_accuracy <= 3!
|
||||||
if abs(amount) < 10 ** -(int(config['price_accuracy'])1):
|
if abs(amount) < 10 ** -(int(config['price_accuracy'])):
|
||||||
if not len(line_draft_ids):
|
if not len(line_draft_ids):
|
||||||
continue
|
continue
|
||||||
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {
|
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {
|
||||||
|
@ -1132,7 +1132,7 @@ class account_move_reconcile(osv.osv):
|
||||||
'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/',
|
'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/',
|
||||||
}
|
}
|
||||||
def reconcile_partial_check(self, cr, uid, ids, type='auto', context={}):
|
def reconcile_partial_check(self, cr, uid, ids, type='auto', context={}):
|
||||||
total = 0.0
|
total = 0.0
|
||||||
for rec in self.browse(cr, uid, ids, context):
|
for rec in self.browse(cr, uid, ids, context):
|
||||||
for line in rec.line_partial_ids:
|
for line in rec.line_partial_ids:
|
||||||
total += (line.debit or 0.0) - (line.credit or 0.0)
|
total += (line.debit or 0.0) - (line.credit or 0.0)
|
||||||
|
@ -1886,7 +1886,7 @@ account_account_template()
|
||||||
|
|
||||||
class account_add_tmpl_wizard(osv.osv_memory):
|
class account_add_tmpl_wizard(osv.osv_memory):
|
||||||
"""Add one more account from the template.
|
"""Add one more account from the template.
|
||||||
|
|
||||||
With the 'nocreate' option, some accounts may not be created. Use this to add them later."""
|
With the 'nocreate' option, some accounts may not be created. Use this to add them later."""
|
||||||
_name = 'account.addtmpl.wizard'
|
_name = 'account.addtmpl.wizard'
|
||||||
|
|
||||||
|
@ -1912,7 +1912,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'cparent_id': _get_def_cparent,
|
'cparent_id': _get_def_cparent,
|
||||||
}
|
}
|
||||||
|
|
||||||
def action_create(self,cr,uid,ids,context=None):
|
def action_create(self,cr,uid,ids,context=None):
|
||||||
acc_obj=self.pool.get('account.account')
|
acc_obj=self.pool.get('account.account')
|
||||||
tmpl_obj=self.pool.get('account.account.template')
|
tmpl_obj=self.pool.get('account.account.template')
|
||||||
|
@ -1939,7 +1939,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
|
||||||
# print "Creating:", vals
|
# print "Creating:", vals
|
||||||
new_account = acc_obj.create(cr,uid,vals)
|
new_account = acc_obj.create(cr,uid,vals)
|
||||||
return {'type':'state', 'state': 'end' }
|
return {'type':'state', 'state': 'end' }
|
||||||
|
|
||||||
def action_cancel(self,cr,uid,ids,context=None):
|
def action_cancel(self,cr,uid,ids,context=None):
|
||||||
return { 'type': 'state', 'state': 'end' }
|
return { 'type': 'state', 'state': 'end' }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue