From ba85d5c3ae41be02f37aed8ec1061d8296c51a30 Mon Sep 17 00:00:00 2001 From: Cybrosys Technologies Date: Tue, 10 Sep 2024 12:07:52 +0530 Subject: [PATCH] Sep 10: [FIX] Bug Fixed 'account_journal_discount' --- account_journal_discount/__manifest__.py | 2 +- account_journal_discount/doc/RELEASE_NOTES.md | 6 ++++++ account_journal_discount/models/account_move.py | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/account_journal_discount/__manifest__.py b/account_journal_discount/__manifest__.py index 8f3c0ff8b..70127fb15 100644 --- a/account_journal_discount/__manifest__.py +++ b/account_journal_discount/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################# { 'name': 'Journal Discount on Invoices And Bills', - 'version': '16.0.1.0.0', + 'version': '16.0.1.0.1', 'category': 'Accounting', 'summary': """Create discount journal items for discounts in invoices and bills""", diff --git a/account_journal_discount/doc/RELEASE_NOTES.md b/account_journal_discount/doc/RELEASE_NOTES.md index df3f3082d..0daae642a 100644 --- a/account_journal_discount/doc/RELEASE_NOTES.md +++ b/account_journal_discount/doc/RELEASE_NOTES.md @@ -5,3 +5,9 @@ #### ADD - Initial Commit for Journal Discount on Invoices And Bills. + +#### 10.09.2024 +#### Version 16.0.1.0.1 +#### UPDT + +- Fixed the issue in calculation of debit and credit value of discounted journal diff --git a/account_journal_discount/models/account_move.py b/account_journal_discount/models/account_move.py index 72245f3d2..44156dc2b 100644 --- a/account_journal_discount/models/account_move.py +++ b/account_journal_discount/models/account_move.py @@ -38,7 +38,7 @@ class AccountMove(models.Model): if line.discount > 0 and \ line.product_id.categ_id.customer_account_discount_id: debit_credit_value = abs( - float_round((line.price_subtotal - line.price_unit), + float_round((line.price_subtotal - (line.quantity * line.price_unit)), precision_digits= self.currency_id.decimal_places)) self.env['account.move.line'].create({ @@ -66,7 +66,7 @@ class AccountMove(models.Model): if line.discount > 0 and \ line.product_id.categ_id.vendor_account_discount_id: debit_credit_value = abs( - float_round((line.price_subtotal - line.price_unit), + float_round((line.price_subtotal - (line.quantity * line.price_unit)), precision_digits= self.currency_id.decimal_places)) self.env['account.move.line'].with_context(