mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] fix api and put the incorrect method in deprecated
This commit is contained in:
@@ -25,7 +25,7 @@ Advanced reconciliation method for the module account_easy_reconcile
|
|||||||
Reconcile rules with transaction_ref
|
Reconcile rules with transaction_ref
|
||||||
|
|
||||||
""",
|
""",
|
||||||
'version': '1.0',
|
'version': '1.0.1',
|
||||||
'author': 'Camptocamp',
|
'author': 'Camptocamp',
|
||||||
'category': 'Finance',
|
'category': 'Finance',
|
||||||
'website': 'http://www.camptocamp.com',
|
'website': 'http://www.camptocamp.com',
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class AccountMoveLine(Model):
|
|||||||
'transaction_ref': fields.char('Transaction Ref.', size=128),
|
'transaction_ref': fields.char('Transaction Ref.', size=128),
|
||||||
}
|
}
|
||||||
|
|
||||||
class AccountBankSatement(Model):
|
class AccountBankStatement(Model):
|
||||||
"""
|
"""
|
||||||
Inherit account.bank.statement class in order to set transaction_ref info on account.move.line
|
Inherit account.bank.statement class in order to set transaction_ref info on account.move.line
|
||||||
"""
|
"""
|
||||||
@@ -43,7 +43,7 @@ class AccountBankSatement(Model):
|
|||||||
|
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
res = super(AccountBankSatement, self)._prepare_move_line_vals(
|
res = super(AccountBankStatement, self)._prepare_move_line_vals(
|
||||||
cr, uid, st_line, move_id, debit, credit,
|
cr, uid, st_line, move_id, debit, credit,
|
||||||
currency_id=currency_id,
|
currency_id=currency_id,
|
||||||
amount_currency=amount_currency,
|
amount_currency=amount_currency,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
{'name': "Bank statement base completion",
|
{'name': "Bank statement base completion",
|
||||||
'version': '1.0',
|
'version': '1.0.1',
|
||||||
'author': 'Camptocamp',
|
'author': 'Camptocamp',
|
||||||
'maintainer': 'Camptocamp',
|
'maintainer': 'Camptocamp',
|
||||||
'category': 'Finance',
|
'category': 'Finance',
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ class AccountStatementLine(orm.Model):
|
|||||||
sql_err.pgerror)
|
sql_err.pgerror)
|
||||||
|
|
||||||
|
|
||||||
class AccountBankSatement(orm.Model):
|
class AccountBankStatement(orm.Model):
|
||||||
"""
|
"""
|
||||||
We add a basic button and stuff to support the auto-completion
|
We add a basic button and stuff to support the auto-completion
|
||||||
of the bank statement once line have been imported or manually fullfill.
|
of the bank statement once line have been imported or manually fullfill.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
{'name': "Bank statement base import",
|
{'name': "Bank statement base import",
|
||||||
'version': '1.0',
|
'version': '1.0.1',
|
||||||
'author': 'Camptocamp',
|
'author': 'Camptocamp',
|
||||||
'maintainer': 'Camptocamp',
|
'maintainer': 'Camptocamp',
|
||||||
'category': 'Finance',
|
'category': 'Finance',
|
||||||
|
|||||||
@@ -85,7 +85,11 @@ class AccountStatementProfil(Model):
|
|||||||
context=context)
|
context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def prepare_statetement_lines_vals(
|
#Deprecated remove on V8
|
||||||
|
def prepare_statetement_lines_vals(self, *args, **kwargs):
|
||||||
|
return self.prepare_statement_lines_vals(*args, **kwargs)
|
||||||
|
|
||||||
|
def prepare_statement_lines_vals(
|
||||||
self, cr, uid, parser_vals, account_payable, account_receivable,
|
self, cr, uid, parser_vals, account_payable, account_receivable,
|
||||||
statement_id, context):
|
statement_id, context):
|
||||||
"""
|
"""
|
||||||
@@ -183,7 +187,7 @@ class AccountStatementProfil(Model):
|
|||||||
statement_store = []
|
statement_store = []
|
||||||
for line in result_row_list:
|
for line in result_row_list:
|
||||||
parser_vals = parser.get_st_line_vals(line)
|
parser_vals = parser.get_st_line_vals(line)
|
||||||
values = self.prepare_statetement_lines_vals(
|
values = self.prepare_statement_lines_vals(
|
||||||
cr, uid, parser_vals, account_payable, account_receivable, statement_id,
|
cr, uid, parser_vals, account_payable, account_receivable, statement_id,
|
||||||
context)
|
context)
|
||||||
statement_store.append(values)
|
statement_store.append(values)
|
||||||
@@ -218,7 +222,6 @@ class AccountStatementProfil(Model):
|
|||||||
context)
|
context)
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
statement_obj.unlink(cr, uid, [statement_id], context=context)
|
|
||||||
error_type, error_value, trbk = sys.exc_info()
|
error_type, error_value, trbk = sys.exc_info()
|
||||||
st = "Error: %s\nDescription: %s\nTraceback:" % (error_type.__name__, error_value)
|
st = "Error: %s\nDescription: %s\nTraceback:" % (error_type.__name__, error_value)
|
||||||
st += ''.join(traceback.format_tb(trbk, 30))
|
st += ''.join(traceback.format_tb(trbk, 30))
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
{'name': "Bank statement extension and profiles",
|
{'name': "Bank statement extension and profiles",
|
||||||
'version': '1.3.1',
|
'version': '1.3.2',
|
||||||
'author': 'Camptocamp',
|
'author': 'Camptocamp',
|
||||||
'maintainer': 'Camptocamp',
|
'maintainer': 'Camptocamp',
|
||||||
'category': 'Finance',
|
'category': 'Finance',
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class AccountStatementProfile(Model):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AccountBankSatement(Model):
|
class AccountBankStatement(Model):
|
||||||
"""
|
"""
|
||||||
We improve the bank statement class mostly for :
|
We improve the bank statement class mostly for :
|
||||||
- Removing the period and compute it from the date of each line.
|
- Removing the period and compute it from the date of each line.
|
||||||
@@ -207,7 +207,8 @@ class AccountBankSatement(Model):
|
|||||||
profile_obj = self.pool.get('account.statement.profile')
|
profile_obj = self.pool.get('account.statement.profile')
|
||||||
profile = profile_obj.browse(cr, uid, vals['profile_id'], context=context)
|
profile = profile_obj.browse(cr, uid, vals['profile_id'], context=context)
|
||||||
vals['journal_id'] = profile.journal_id.id
|
vals['journal_id'] = profile.journal_id.id
|
||||||
return super(AccountBankSatement, self).create(cr, uid, vals, context=context)
|
return super(AccountBankStatement, self
|
||||||
|
).create(cr, uid, vals, context=context)
|
||||||
|
|
||||||
def _get_period(self, cr, uid, date, context=None):
|
def _get_period(self, cr, uid, date, context=None):
|
||||||
"""Return matching period for a date."""
|
"""Return matching period for a date."""
|
||||||
@@ -255,8 +256,9 @@ class AccountBankSatement(Model):
|
|||||||
"""
|
"""
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
res = super(AccountBankSatement, self)._prepare_move(
|
res = super(AccountBankStatement, self
|
||||||
cr, uid, st_line, st_line_number, context=context)
|
)._prepare_move(cr, uid, st_line, st_line_number,
|
||||||
|
context=context)
|
||||||
ctx = context.copy()
|
ctx = context.copy()
|
||||||
ctx['company_id'] = st_line.company_id.id
|
ctx['company_id'] = st_line.company_id.id
|
||||||
period_id = self._get_period(cr, uid, st_line.date, context=ctx)
|
period_id = self._get_period(cr, uid, st_line.date, context=ctx)
|
||||||
@@ -285,7 +287,7 @@ class AccountBankSatement(Model):
|
|||||||
"""
|
"""
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
res = super(AccountBankSatement, self)._prepare_move_line_vals(
|
res = super(AccountBankStatement, self)._prepare_move_line_vals(
|
||||||
cr, uid, st_line, move_id, debit, credit,
|
cr, uid, st_line, move_id, debit, credit,
|
||||||
currency_id=currency_id,
|
currency_id=currency_id,
|
||||||
amount_currency=amount_currency,
|
amount_currency=amount_currency,
|
||||||
@@ -309,9 +311,8 @@ class AccountBankSatement(Model):
|
|||||||
create the move from.
|
create the move from.
|
||||||
:return: int/long of the res.partner to use as counterpart
|
:return: int/long of the res.partner to use as counterpart
|
||||||
"""
|
"""
|
||||||
bank_partner_id = super(AccountBankSatement, self)._get_counter_part_partner(cr,
|
bank_partner_id = super(AccountBankStatement, self
|
||||||
uid,
|
)._get_counter_part_partner(cr, uid, st_line,
|
||||||
st_line,
|
|
||||||
context=context)
|
context=context)
|
||||||
# get the right partner according to the chosen profile
|
# get the right partner according to the chosen profile
|
||||||
if st_line.statement_id.profile_id.force_partner_on_bank:
|
if st_line.statement_id.profile_id.force_partner_on_bank:
|
||||||
@@ -542,8 +543,9 @@ class AccountBankSatement(Model):
|
|||||||
"""
|
"""
|
||||||
st = self.browse(cr, uid, st_id, context=context)
|
st = self.browse(cr, uid, st_id, context=context)
|
||||||
if st.balance_check:
|
if st.balance_check:
|
||||||
return super(AccountBankSatement, self).balance_check(
|
return super(AccountBankStatement, self
|
||||||
cr, uid, st_id, journal_type, context=context)
|
).balance_check(cr, uid, st_id, journal_type,
|
||||||
|
context=context)
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -563,7 +565,7 @@ class AccountBankSatement(Model):
|
|||||||
'balance_check': import_config.balance_check}}
|
'balance_check': import_config.balance_check}}
|
||||||
|
|
||||||
|
|
||||||
class AccountBankSatementLine(Model):
|
class AccountBankStatementLine(Model):
|
||||||
"""
|
"""
|
||||||
Override to compute the period from the date of the line, add a method to retrieve
|
Override to compute the period from the date of the line, add a method to retrieve
|
||||||
the values for a line from the profile. Override the on_change method to take care of
|
the values for a line from the profile. Override the on_change method to take care of
|
||||||
@@ -698,11 +700,9 @@ class AccountBankSatementLine(Model):
|
|||||||
Keep the same features as in standard and call super. If an account is returned,
|
Keep the same features as in standard and call super. If an account is returned,
|
||||||
call the method to compute line values.
|
call the method to compute line values.
|
||||||
"""
|
"""
|
||||||
res = super(AccountBankSatementLine, self).onchange_type(cr, uid,
|
res = super(AccountBankStatementLine, self
|
||||||
line_id,
|
).onchange_type(cr, uid, line_id, partner_id,
|
||||||
partner_id,
|
line_type, context=context)
|
||||||
line_type,
|
|
||||||
context=context)
|
|
||||||
if 'account_id' in res['value']:
|
if 'account_id' in res['value']:
|
||||||
result = self.get_values_for_line(cr, uid,
|
result = self.get_values_for_line(cr, uid,
|
||||||
profile_id=profile_id,
|
profile_id=profile_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user