[REF] account
bzr revid: vth@tinyerp.com-20101020101202-rawxy5lwtqnvqnkh
This commit is contained in:
parent
a5b9973495
commit
91b5200c8c
|
@ -38,12 +38,13 @@ class account_bank_statement(osv.osv):
|
|||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
res = super(account_bank_statement, self).write(cr, uid, ids, vals, context=context)
|
||||
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
|
||||
for statement in self.browse(cr, uid, ids, context):
|
||||
seq = 0
|
||||
for line in statement.line_ids:
|
||||
seq += 1
|
||||
if not line.sequence:
|
||||
self.pool.get('account.bank.statement.line').write(cr, uid, [line.id], {'sequence': seq}, context=context)
|
||||
account_bank_statement_line_obj.write(cr, uid, [line.id], {'sequence': seq}, context=context)
|
||||
return res
|
||||
|
||||
def button_import_invoice(self, cr, uid, ids, context=None):
|
||||
|
@ -381,13 +382,14 @@ class account_bank_statement(osv.osv):
|
|||
|
||||
def button_cancel(self, cr, uid, ids, context=None):
|
||||
done = []
|
||||
account_move_obj = self.pool.get('account.move')
|
||||
for st in self.browse(cr, uid, ids, context):
|
||||
if st.state=='draft':
|
||||
continue
|
||||
ids = []
|
||||
for line in st.line_ids:
|
||||
ids += [x.id for x in line.move_ids]
|
||||
self.pool.get('account.move').unlink(cr, uid, ids, context)
|
||||
account_move_obj.unlink(cr, uid, ids, context)
|
||||
done.append(st.id)
|
||||
return self.write(cr, uid, done, {'state':'draft'}, context=context)
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
##############################################################################
|
||||
|
||||
import time
|
||||
import copy
|
||||
|
||||
import rml_parse
|
||||
from report import report_sxw
|
||||
|
|
|
@ -39,7 +39,7 @@ class account_vat_declaration(osv.osv_memory):
|
|||
company_obj = self.pool.get('res.company')
|
||||
user = user_obj.browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
return user.company_id.id
|
||||
return user.company_id.id
|
||||
else:
|
||||
return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
|
||||
|
|
Loading…
Reference in New Issue