mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
IMP sale_credit_limit Include the Currency and Currency formatting in SO warning.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from odoo import api, models
|
||||
from odoo.addons.mail.models.mail_template import format_amount
|
||||
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
@@ -9,8 +10,9 @@ class SaleOrder(models.Model):
|
||||
for so in self:
|
||||
partner = so.partner_invoice_id.commercial_partner_id
|
||||
if partner.credit_limit and partner.credit_limit <= partner.credit:
|
||||
m = 'Partner outstanding receivables %0.2f is above their credit limit of %0.2f' \
|
||||
% (partner.credit, partner.credit_limit)
|
||||
m = 'Partner outstanding receivables %s is above their credit limit of %s' \
|
||||
% (format_amount(self.env, partner.credit, so.currency_id),
|
||||
format_amount(self.env, partner.credit_limit, so.currency_id))
|
||||
return {
|
||||
'warning': {'title': 'Sale Credit Limit',
|
||||
'message': m}
|
||||
|
||||
Reference in New Issue
Block a user