[IMP] l10n_in_edi: negative discount now allowed
Before this commit: Negative discounts could be applied to products, which is not allowed in Indian EDI. After this commit: Applied conditions to check for negative discounts and raise an error in case of such discounts. task_id: 3293247 closes odoo/odoo#135790 X-original-commit: fb1352bc1937d54183173c57094b5b176525d8d6 Signed-off-by: Josse Colpaert <jco@odoo.com>
This commit is contained in:
@@ -77,6 +77,8 @@ class AccountEdiFormat(models.Model):
|
||||
if not move._l10n_in_edi_is_managing_invoice_negative_lines_allowed():
|
||||
raise ValidationError(_("Invoice lines having a negative amount are not allowed to generate the IRN. "
|
||||
"Please create a credit note instead."))
|
||||
if line.display_type == 'product' and line.discount < 0:
|
||||
error_message.append(_("Negative discount is not allowed, set in line %s", line.name))
|
||||
if line.product_id:
|
||||
hsn_code = self._l10n_in_edi_extract_digits(line.product_id.l10n_in_hsn_code)
|
||||
if not hsn_code:
|
||||
|
||||
Reference in New Issue
Block a user