diff --git a/partner_financial_risk/__openerp__.py b/partner_financial_risk/__openerp__.py index a6eb5161c..a23c078d5 100644 --- a/partner_financial_risk/__openerp__.py +++ b/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)', diff --git a/partner_financial_risk/models/account_invoice.py b/partner_financial_risk/models/account_invoice.py index 30714f102..843d60718 100644 --- a/partner_financial_risk/models/account_invoice.py +++ b/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 = _(