From 86b8f7b259d95c4b06155bc658aa993d9117d486 Mon Sep 17 00:00:00 2001 From: AjmalCybro Date: Wed, 9 Sep 2020 17:38:24 +0530 Subject: [PATCH] [UPDT] Refund, Credit note removed --- base_accounting_kit/__manifest__.py | 2 +- base_accounting_kit/doc/changelog.md | 5 ++ .../models/account_dashboard.py | 75 ++----------------- 3 files changed, 14 insertions(+), 68 deletions(-) diff --git a/base_accounting_kit/__manifest__.py b/base_accounting_kit/__manifest__.py index 9e5d12dff..b9e2e93dd 100644 --- a/base_accounting_kit/__manifest__.py +++ b/base_accounting_kit/__manifest__.py @@ -22,7 +22,7 @@ { 'name': 'Odoo 13 Full Accounting Kit', - 'version': '13.0.4.8.10', + 'version': '13.0.4.8.11', 'category': 'Accounting', 'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs', 'summary': """ Asset and Budget Management, diff --git a/base_accounting_kit/doc/changelog.md b/base_accounting_kit/doc/changelog.md index b1846efec..ae9302f90 100644 --- a/base_accounting_kit/doc/changelog.md +++ b/base_accounting_kit/doc/changelog.md @@ -88,3 +88,8 @@ #### Version 13.0.4.8.10 #### UPDT - Multi Company in Dashboard + +#### 10.09.2020 +#### Version 13.0.4.8.11 +#### UPDT +- Credit note, refund removed from dashboard diff --git a/base_accounting_kit/models/account_dashboard.py b/base_accounting_kit/models/account_dashboard.py index ad83f0c99..1a915261f 100644 --- a/base_accounting_kit/models/account_dashboard.py +++ b/base_accounting_kit/models/account_dashboard.py @@ -776,21 +776,8 @@ class DashBoard(models.Model): AND account_move.company_id in ''' + str(tuple(company_id)) + ''' ''') % (states_arg)) record_supplier_current_year = self._cr.dictfetchall() - - self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as credit_note from account_move where type ='out_refund' - AND %s - AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) - AND account_move.company_id in ''' + str(tuple(company_id)) + ''' - ''') % (states_arg)) - result_credit_note_current_year = self._cr.dictfetchall() - - self._cr.execute(('''select sum(-(amount_total_signed)) as refund from account_move where type ='in_refund' - AND %s - AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) - AND account_move.company_id in ''' + str(tuple(company_id)) + ''' - ''') % (states_arg)) - result_refund_current_year = self._cr.dictfetchall() - + result_credit_note_current_year = [{'credit_note': 0.0}] + result_refund_current_year = [{'refund': 0.0}] self._cr.execute(('''select sum(amount_total_signed) - sum(amount_residual_signed) as customer_invoice_paid from account_move where type ='out_invoice' AND %s AND invoice_payment_state = 'paid' @@ -806,23 +793,8 @@ class DashBoard(models.Model): AND account_move.company_id in ''' + str(tuple(company_id)) + ''' ''') % (states_arg)) result_paid_supplier_invoice_current_year = self._cr.dictfetchall() - - self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as customer_credit_paid from account_move where type ='out_refund' - AND %s - AND invoice_payment_state = 'paid' - AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) - AND account_move.company_id in ''' + str(tuple(company_id)) + ''' - ''') % (states_arg)) - record_paid_customer_credit_current_year = self._cr.dictfetchall() - - self._cr.execute(('''select sum(amount_total_signed) - sum(amount_residual_signed) as supplier_refund_paid from account_move where type ='in_refund' - AND %s - AND invoice_payment_state = 'paid' - AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) - AND account_move.company_id in ''' + str(tuple(company_id)) + ''' - ''') % (states_arg)) - result_paid_supplier_refund_current_year = self._cr.dictfetchall() - + record_paid_customer_credit_current_year = [{'customer_credit_paid': 0.0}] + result_paid_supplier_refund_current_year = [{'supplier_refund_paid': 0.0}] customer_invoice_current_year = [item['customer_invoice'] for item in record_customer_current_year] supplier_invoice_current_year = [item['supplier_invoice'] for item in record_supplier_current_year] @@ -867,23 +839,8 @@ class DashBoard(models.Model): AND account_move.company_id in ''' + str(tuple(company_id)) + ''' ''') % (states_arg)) record_supplier_current_month = self._cr.dictfetchall() - - self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as credit_note from account_move where type ='out_refund' - AND %s - AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) - AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) - AND account_move.company_id in ''' + str(tuple(company_id)) + ''' - ''') % (states_arg)) - result_credit_note_current_month = self._cr.dictfetchall() - - self._cr.execute(('''select sum(-(amount_total_signed)) as refund from account_move where type ='in_refund' - AND %s - AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) - AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) - AND account_move.company_id in ''' + str(tuple(company_id)) + ''' - ''') % (states_arg)) - result_refund_current_month = self._cr.dictfetchall() - + result_credit_note_current_month = [{'credit_note': 0.0}] + result_refund_current_month = [{'refund': 0.0}] self._cr.execute(('''select sum(amount_total_signed) - sum(amount_residual_signed) as customer_invoice_paid from account_move where type ='out_invoice' AND %s AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) @@ -899,24 +856,8 @@ class DashBoard(models.Model): AND account_move.company_id in ''' + str(tuple(company_id)) + ''' ''') % (states_arg)) result_paid_supplier_invoice_current_month = self._cr.dictfetchall() - - self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as customer_credit_paid from account_move where type ='out_refund' - AND %s - AND invoice_payment_state = 'paid' - AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) - AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) - AND account_move.company_id in ''' + str(tuple(company_id)) + ''' - ''') % (states_arg)) - record_paid_customer_credit_current_month = self._cr.dictfetchall() - - self._cr.execute(('''select sum(amount_total_signed) - sum(amount_residual_signed) as supplier_refund_paid from account_move where type ='in_refund' - AND %s - AND invoice_payment_state = 'paid' - AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) - AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) - AND account_move.company_id in ''' + str(tuple(company_id)) + ''' - ''') % (states_arg)) - result_paid_supplier_refund_current_month = self._cr.dictfetchall() + record_paid_customer_credit_current_month = [{'customer_credit_paid': 0.0}] + result_paid_supplier_refund_current_month = [{'supplier_refund_paid': 0.0}] customer_invoice_current_month = [item['customer_invoice'] for item in record_customer_current_month] supplier_invoice_current_month = [item['supplier_invoice'] for item in record_supplier_current_month]