[FIX] add dependency on account_report_company + remove unnecessary conditions

This commit is contained in:
Matthieu Dietrich
2014-08-11 14:37:48 +02:00
parent dda528671c
commit 4871fc66f7
3 changed files with 4 additions and 18 deletions

View File

@@ -110,16 +110,7 @@ class AccountStatementCompletionRule(Model):
elif len(invoice_id) == 1:
invoice = invoice_obj.browse(cr, uid, invoice_id[0],
context=context)
# if account_report_company is installed, the field to be
# 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
res['partner_id'] = invoice.commercial_partner_id.id
# 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
# accountants