Browse Source

[FIX] partner_financial_risk: Error when risk_total includes draft_invoices (#468)

pull/473/head
Carlos Dauden 7 years ago
committed by Pedro M. Baeza
parent
commit
63abcfb519
  1. 2
      partner_financial_risk/__openerp__.py
  2. 4
      partner_financial_risk/models/account_invoice.py

2
partner_financial_risk/__openerp__.py

@ -5,7 +5,7 @@
{
'name': 'Partner Financial Risk',
'summary': 'Manage partner risk',
'version': '9.0.1.0.0',
'version': '9.0.1.0.1',
'category': 'Sales Management',
'license': 'AGPL-3',
'author': 'Tecnativa, Odoo Community Association (OCA)',

4
partner_financial_risk/models/account_invoice.py

@ -22,7 +22,9 @@ class AccountInvoice(models.Model):
partner.risk_invoice_open_limit):
exception_msg = _(
"This invoice exceeds the open invoices risk.\n")
elif partner.risk_invoice_open_include and (
# If risk_invoice_draft_include this invoice included in risk_total
elif not partner.risk_invoice_draft_include and (
partner.risk_invoice_open_include and
(partner.risk_total + invoice.amount_total) >
partner.credit_limit):
exception_msg = _(

Loading…
Cancel
Save