mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] fix a few docstrings
small code improvement in account_statement_transactionid_completion/statement.py AccountStatementCompletionRule.get_from_transaction_id_and_so)
This commit is contained in:
@@ -190,7 +190,7 @@ class AccountStatementCompletionRule(orm.Model):
|
|||||||
line. Then, call the generic get_values_for_line method to complete other values.
|
line. Then, call the generic get_values_for_line method to complete other values.
|
||||||
If more than one partner matched, raise the ErrorTooManyPartner error.
|
If more than one partner matched, raise the ErrorTooManyPartner error.
|
||||||
|
|
||||||
:param int/long st_line: read of the concerned account.bank.statement.line
|
:param dict line: read of the concerned account.bank.statement.line
|
||||||
:return:
|
:return:
|
||||||
A dict of value that can be passed directly to the write method of
|
A dict of value that can be passed directly to the write method of
|
||||||
the statement line or {}
|
the statement line or {}
|
||||||
@@ -208,7 +208,7 @@ class AccountStatementCompletionRule(orm.Model):
|
|||||||
line. Then, call the generic get_values_for_line method to complete other values.
|
line. Then, call the generic get_values_for_line method to complete other values.
|
||||||
If more than one partner matched, raise the ErrorTooManyPartner error.
|
If more than one partner matched, raise the ErrorTooManyPartner error.
|
||||||
|
|
||||||
:param int/long st_line: read of the concerned account.bank.statement.line
|
:param dict line: read of the concerned account.bank.statement.line
|
||||||
:return:
|
:return:
|
||||||
A dict of value that can be passed directly to the write method of
|
A dict of value that can be passed directly to the write method of
|
||||||
the statement line or {}
|
the statement line or {}
|
||||||
@@ -270,7 +270,7 @@ class AccountStatementCompletionRule(orm.Model):
|
|||||||
get_values_for_line method to complete other values.
|
get_values_for_line method to complete other values.
|
||||||
If more than one partner matched, raise the ErrorTooManyPartner error.
|
If more than one partner matched, raise the ErrorTooManyPartner error.
|
||||||
|
|
||||||
:param int/long st_line: read of the concerned account.bank.statement.line
|
:param dict st_line: read of the concerned account.bank.statement.line
|
||||||
:return:
|
:return:
|
||||||
A dict of value that can be passed directly to the write method of
|
A dict of value that can be passed directly to the write method of
|
||||||
the statement line or {}
|
the statement line or {}
|
||||||
@@ -328,7 +328,7 @@ class AccountStatementCompletionRule(orm.Model):
|
|||||||
Then, call the generic get_values_for_line method to complete other values.
|
Then, call the generic get_values_for_line method to complete other values.
|
||||||
If more than one partner matched, raise the ErrorTooManyPartner error.
|
If more than one partner matched, raise the ErrorTooManyPartner error.
|
||||||
|
|
||||||
:param int/long st_line: read of the concerned account.bank.statement.line
|
:param dict st_line: read of the concerned account.bank.statement.line
|
||||||
:return:
|
:return:
|
||||||
A dict of value that can be passed directly to the write method of
|
A dict of value that can be passed directly to the write method of
|
||||||
the statement line or {}
|
the statement line or {}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ from openerp.tools.translate import _
|
|||||||
# Monkey patch to fix bad write implementation...
|
# Monkey patch to fix bad write implementation...
|
||||||
def fixed_write(self, cr, uid, ids, vals, context=None):
|
def fixed_write(self, cr, uid, ids, vals, context=None):
|
||||||
""" Fix performance desing of original function
|
""" Fix performance desing of original function
|
||||||
Ideally we should use a real postgres sequence or serial fields.
|
Ideally we should use a real PostgreSQL sequence or serial fields.
|
||||||
I will do it when I have time."""
|
I will do it when I have time."""
|
||||||
res = super(stat_mod.account_bank_statement, self).write(cr, uid, ids,
|
res = super(stat_mod.account_bank_statement, self).write(cr, uid, ids,
|
||||||
vals, context=context)
|
vals, context=context)
|
||||||
@@ -425,8 +425,8 @@ class AccountBankSatement(Model):
|
|||||||
- If the customer checkbox is checked on the found partner, type and account will be customer and receivable
|
- If the customer checkbox is checked on the found partner, type and account will be customer and receivable
|
||||||
- If the supplier checkbox is checked on the found partner, type and account will be supplier and payable
|
- If the supplier checkbox is checked on the found partner, type and account will be supplier and payable
|
||||||
- If both checkbox are checked or none of them, it'll be based on the amount :
|
- If both checkbox are checked or none of them, it'll be based on the amount :
|
||||||
If amount is positif the type and account will be customer and receivable,
|
If amount is positive, the type and account will be customer and receivable,
|
||||||
If amount is negativ, the type and account will be supplier and payable
|
If amount is negative, the type and account will be supplier and payable
|
||||||
Note that we return the payable or receivable account from agrs and not from the optional partner_id
|
Note that we return the payable or receivable account from agrs and not from the optional partner_id
|
||||||
given!
|
given!
|
||||||
|
|
||||||
@@ -567,8 +567,8 @@ class AccountBankSatementLine(Model):
|
|||||||
- If the customer checkbox is checked on the found partner, type and account will be customer and receivable
|
- If the customer checkbox is checked on the found partner, type and account will be customer and receivable
|
||||||
- If the supplier checkbox is checked on the found partner, type and account will be supplier and payable
|
- If the supplier checkbox is checked on the found partner, type and account will be supplier and payable
|
||||||
- If both checkbox are checked or none of them, it'll be based on the amount :
|
- If both checkbox are checked or none of them, it'll be based on the amount :
|
||||||
If amount is positif the type and account will be customer and receivable,
|
If amount is positive, the type and account will be customer and receivable,
|
||||||
If amount is negativ, the type and account will be supplier an payable
|
If amount is negative, the type and account will be supplier an payable
|
||||||
- Then, if no partner are given we look and take the property from the company so we always give a value
|
- Then, if no partner are given we look and take the property from the company so we always give a value
|
||||||
for account_id. Note that in that case, we return the receivable one.
|
for account_id. Note that in that case, we return the receivable one.
|
||||||
:param int/long profile_id of the related bank statement
|
:param int/long profile_id of the related bank statement
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class AccountStatementCompletionRule(Model):
|
|||||||
Match the partner based on the transaction ID field of the SO.
|
Match the partner based on the transaction ID field of the SO.
|
||||||
Then, call the generic st_line method to complete other values.
|
Then, call the generic st_line method to complete other values.
|
||||||
In that case, we always fullfill the reference of the line with the SO name.
|
In that case, we always fullfill the reference of the line with the SO name.
|
||||||
:param int/long line_id: ID of the concerned account.bank.statement.line
|
:param dict st_line: read of the concerned account.bank.statement.line
|
||||||
:return:
|
:return:
|
||||||
A dict of value that can be passed directly to the write method of
|
A dict of value that can be passed directly to the write method of
|
||||||
the statement line or {}
|
the statement line or {}
|
||||||
@@ -61,14 +61,13 @@ class AccountStatementCompletionRule(Model):
|
|||||||
uid,
|
uid,
|
||||||
[('transaction_id', '=', st_line['transaction_id'])],
|
[('transaction_id', '=', st_line['transaction_id'])],
|
||||||
context=context)
|
context=context)
|
||||||
if so_id and len(so_id) == 1:
|
if len(so_id) > 1:
|
||||||
|
raise ErrorTooManyPartner(_('Line named "%s" (Ref:%s) was matched by more than '
|
||||||
|
'one partner.') % (st_line['name'], st_line['ref']))
|
||||||
|
if len(so_id) == 1:
|
||||||
so = so_obj.browse(cr, uid, so_id[0], context=context)
|
so = so_obj.browse(cr, uid, so_id[0], context=context)
|
||||||
res['partner_id'] = so.partner_id.id
|
res['partner_id'] = so.partner_id.id
|
||||||
res['ref'] = so.name
|
res['ref'] = so.name
|
||||||
elif so_id and len(so_id) > 1:
|
|
||||||
raise ErrorTooManyPartner(_('Line named "%s" (Ref:%s) was matched by more than '
|
|
||||||
'one partner.') % (st_line['name'], st_line['ref']))
|
|
||||||
if so_id:
|
|
||||||
st_vals = st_obj.get_values_for_line(cr,
|
st_vals = st_obj.get_values_for_line(cr,
|
||||||
uid,
|
uid,
|
||||||
profile_id=st_line['profile_id'],
|
profile_id=st_line['profile_id'],
|
||||||
|
|||||||
Reference in New Issue
Block a user