mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] add dependency on account_report_company + remove unnecessary conditions
This commit is contained in:
@@ -26,7 +26,8 @@
|
|||||||
'maintainer': 'Camptocamp',
|
'maintainer': 'Camptocamp',
|
||||||
'category': 'Finance',
|
'category': 'Finance',
|
||||||
'complexity': 'normal',
|
'complexity': 'normal',
|
||||||
'depends': ['account_statement_ext'],
|
'depends': ['account_statement_ext',
|
||||||
|
'account_report_company'],
|
||||||
'description': """
|
'description': """
|
||||||
The goal of this module is to improve the basic bank statement, help dealing
|
The goal of this module is to improve the basic bank statement, help dealing
|
||||||
with huge volume of reconciliation by providing basic rules to identify the
|
with huge volume of reconciliation by providing basic rules to identify the
|
||||||
|
|||||||
@@ -189,13 +189,7 @@ class AccountStatementCompletionRule(orm.Model):
|
|||||||
res = {}
|
res = {}
|
||||||
inv = self._find_invoice(cr, uid, line, inv_type, context=context)
|
inv = self._find_invoice(cr, uid, line, inv_type, context=context)
|
||||||
if inv:
|
if inv:
|
||||||
# FIXME use only commercial_partner_id of invoice in 7.1
|
partner_id = inv.commercial_partner_id.id
|
||||||
# this is for backward compatibility in 7.0 before
|
|
||||||
# the refactoring of res.partner
|
|
||||||
if hasattr(inv, 'commercial_partner_id'):
|
|
||||||
partner_id = inv.commercial_partner_id.id
|
|
||||||
else:
|
|
||||||
partner_id = inv.partner_id.id
|
|
||||||
res = {'partner_id': partner_id,
|
res = {'partner_id': partner_id,
|
||||||
'account_id': inv.account_id.id,
|
'account_id': inv.account_id.id,
|
||||||
'type': inv_type}
|
'type': inv_type}
|
||||||
|
|||||||
@@ -110,16 +110,7 @@ class AccountStatementCompletionRule(Model):
|
|||||||
elif len(invoice_id) == 1:
|
elif len(invoice_id) == 1:
|
||||||
invoice = invoice_obj.browse(cr, uid, invoice_id[0],
|
invoice = invoice_obj.browse(cr, uid, invoice_id[0],
|
||||||
context=context)
|
context=context)
|
||||||
# if account_report_company is installed, the field to be
|
res['partner_id'] = invoice.commercial_partner_id.id
|
||||||
# used as partner is the commercial partner; otherwise,
|
|
||||||
# the basic partner must be used.
|
|
||||||
#
|
|
||||||
# This is used to keep consistent behavior from the module
|
|
||||||
# account_statement_base_completion.
|
|
||||||
if hasattr(invoice, 'commercial_partner_id'):
|
|
||||||
res['partner_id'] = invoice.commercial_partner_id.id
|
|
||||||
else:
|
|
||||||
res['partner_id'] = invoice.partner_id.id
|
|
||||||
# we want the move to have the same ref than the found
|
# we want the move to have the same ref than the found
|
||||||
# invoice's move, thus it will be easier to link them for the
|
# invoice's move, thus it will be easier to link them for the
|
||||||
# accountants
|
# accountants
|
||||||
|
|||||||
Reference in New Issue
Block a user