summaryrefslogtreecommitdiff
path: root/addons/l10n_in_sale/report
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/l10n_in_sale/report
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/l10n_in_sale/report')
-rw-r--r--addons/l10n_in_sale/report/__init__.py6
-rw-r--r--addons/l10n_in_sale/report/account_invoice_report.py25
-rw-r--r--addons/l10n_in_sale/report/exempted_gst_report.py15
-rw-r--r--addons/l10n_in_sale/report/hsn_gst_report.py15
4 files changed, 61 insertions, 0 deletions
diff --git a/addons/l10n_in_sale/report/__init__.py b/addons/l10n_in_sale/report/__init__.py
new file mode 100644
index 00000000..1d16e0da
--- /dev/null
+++ b/addons/l10n_in_sale/report/__init__.py
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from . import account_invoice_report
+from . import exempted_gst_report
+from . import hsn_gst_report
diff --git a/addons/l10n_in_sale/report/account_invoice_report.py b/addons/l10n_in_sale/report/account_invoice_report.py
new file mode 100644
index 00000000..1150be0c
--- /dev/null
+++ b/addons/l10n_in_sale/report/account_invoice_report.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models
+
+
+class L10nInAccountInvoiceReport(models.Model):
+ _inherit = "l10n_in.account.invoice.report"
+
+ def _from(self):
+ from_str = super(L10nInAccountInvoiceReport, self)._from()
+ return from_str.replace(
+ "LEFT JOIN res_country_state ps ON ps.id = p.state_id",
+ """
+ LEFT JOIN res_partner dp ON dp.id = am.partner_shipping_id
+ LEFT JOIN res_country_state ps ON ps.id = dp.state_id
+ """
+ )
+
+ def _where(self):
+ where_str = super(L10nInAccountInvoiceReport, self)._where()
+ where_str += """ AND (aml.product_id IS NULL or aml.product_id != COALESCE(
+ (SELECT value from ir_config_parameter where key = 'sale.default_deposit_product_id'), '0')::int)
+ """
+ return where_str
diff --git a/addons/l10n_in_sale/report/exempted_gst_report.py b/addons/l10n_in_sale/report/exempted_gst_report.py
new file mode 100644
index 00000000..9664f12d
--- /dev/null
+++ b/addons/l10n_in_sale/report/exempted_gst_report.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models
+
+
+class L10nInExemptedReport(models.Model):
+ _inherit = "l10n_in.exempted.report"
+
+ def _from(self):
+ from_str = super(L10nInExemptedReport, self)._from()
+ from_str += """ AND aml.product_id != COALESCE(
+ (SELECT value from ir_config_parameter where key = 'sale.default_deposit_product_id'), '0')::int
+ """
+ return from_str
diff --git a/addons/l10n_in_sale/report/hsn_gst_report.py b/addons/l10n_in_sale/report/hsn_gst_report.py
new file mode 100644
index 00000000..615eaef1
--- /dev/null
+++ b/addons/l10n_in_sale/report/hsn_gst_report.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models
+
+
+class L10nInProductHsnReport(models.Model):
+ _inherit = "l10n_in.product.hsn.report"
+
+ def _from(self):
+ from_str = super(L10nInProductHsnReport, self)._from()
+ from_str += """ AND aml.product_id != COALESCE(
+ (SELECT value from ir_config_parameter where key = 'sale.default_deposit_product_id'), '0')::int
+ """
+ return from_str