summaryrefslogtreecommitdiff
path: root/addons/l10n_in_sale
diff options
context:
space:
mode:
authorForam Katharotiya <fka@tinyerp.com>2017-09-18 22:17:43 +0200
committerqdp-odoo <qdp@odoo.com>2017-09-18 22:17:43 +0200
commit2b3c8e6ca9777f6264ecb3d1510dd292ed30ab9f (patch)
tree3f958808a62b08c60e1f042e27cf66fa2fa8ded5 /addons/l10n_in_sale
parent194c38f09d2a76aaec6a514f86484eb8e9b6e08c (diff)
[IMP] l10n_in: GST introduced as new legal requirements.
aka 'Indian localization out of the box'. Details: GST introduced, module refactored. Update GST chart of account, tags and SGST, CGST & IGST taxes. Replace vat label with GSTIN in reports & views. Added HSN Code field and display it on invoice form view & report. Added pin number field in res_country_state. Show the total amount in words based on Indian numbering system on form view of customer/supplier invoice/refund. Arrange address format of India country. l10n_in_schedule6: Introduce new GST taxes, chart of accounts & account tags. l10n_in_sale, l10n_in_purchase, l10n_in_stock: added modules to add hsn code and replace vat with gstin in sale, purchase & stock reports Was task: 33241. Was PR #18952
Diffstat (limited to 'addons/l10n_in_sale')
-rw-r--r--addons/l10n_in_sale/__init__.py2
-rw-r--r--addons/l10n_in_sale/__manifest__.py20
-rw-r--r--addons/l10n_in_sale/views/report_invoice_view.xml114
-rw-r--r--addons/l10n_in_sale/views/report_sale_order.xml10
4 files changed, 146 insertions, 0 deletions
diff --git a/addons/l10n_in_sale/__init__.py b/addons/l10n_in_sale/__init__.py
new file mode 100644
index 00000000000..67dee8c60db
--- /dev/null
+++ b/addons/l10n_in_sale/__init__.py
@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
diff --git a/addons/l10n_in_sale/__manifest__.py b/addons/l10n_in_sale/__manifest__.py
new file mode 100644
index 00000000000..6547ae0aa9d
--- /dev/null
+++ b/addons/l10n_in_sale/__manifest__.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+{
+ 'name': 'Indian - Sale Report(GST)',
+ 'version': '1.0',
+ 'description': """GST Sale Report""",
+ 'category': 'Localization',
+ 'depends': [
+ 'l10n_in',
+ 'sale',
+ ],
+ 'data': [
+ 'views/report_sale_order.xml',
+ 'views/report_invoice_view.xml',
+ ],
+ 'installable': True,
+ 'application': False,
+ 'auto_install': True,
+}
diff --git a/addons/l10n_in_sale/views/report_invoice_view.xml b/addons/l10n_in_sale/views/report_invoice_view.xml
new file mode 100644
index 00000000000..f3be1383da1
--- /dev/null
+++ b/addons/l10n_in_sale/views/report_invoice_view.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <template id="gst_report_invoice_layouted_inherit" inherit_id="sale.report_invoice_layouted">
+ <xpath expr="//t[@name='lines_layouted']" position="replace">
+ <t groups="sale.group_sale_layout" t-foreach="o.order_lines_layouted()" t-as="page" name="lines_layouted">
+ <table class="table table-condensed">
+ <thead>
+ <th>Description</th>
+ <th class="text-right">Quantity</th>
+ <th class="text-right">Unit Price</th>
+ <th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">Disc.(%)</th>
+ <th class="text-right" t-if="len(o.tax_line_ids) > 0">Tax</th>
+ <th class="text-right">Price</th>
+ <t t-if="o.company_id.country_id.code == 'IN'">
+ <th class="text-right" t-if="is_cgst">CGST</th>
+ <th class="text-right" t-if="is_cgst">SGST</th>
+ <th class="text-right" t-if="is_igst">IGST</th>
+ <th class="text-right" t-if="is_cess">CESS</th>
+ </t>
+ </thead>
+ <tbody class="invoice_tbody">
+ <t t-foreach="page" t-as="layout_category">
+
+ <t t-if="layout_category_size > 1 or page_size > 1" groups="sale.group_sale_layout">
+ <tr class="active">
+ <td colspan="7" style="font-weight: bold; border-bottom: 1px solid black;">&amp;bull;
+ <t t-esc="layout_category['name']"/>
+ </td>
+ </tr>
+ </t>
+
+ <!-- Lines associated -->
+ <t t-foreach="layout_category['lines']" t-as="l">
+ <tr>
+ <td><span t-field="l.name"/>
+ <t t-if="l.product_id.l10n_in_hsn_code"><h6><strong class="ml16">HSN/SAC Code:</strong> <span t-field="l.product_id.l10n_in_hsn_code"/></h6></t></td>
+ <td class="text-right">
+ <span t-field="l.quantity"/>
+ <span t-field="l.uom_id" groups="product.group_uom"/>
+ </td>
+ <td class="text-right">
+ <span t-field="l.price_unit"/>
+ </td>
+ <td t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">
+ <span t-field="l.discount"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="', '.join(map(lambda x: x.description or x.name, l.invoice_line_tax_ids))"/>
+ </td>
+ <td class="text-right" groups="sale.group_show_price_subtotal">
+ <span t-field="l.price_subtotal"
+ t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
+ </td>
+ <td class="text-right" groups="sale.group_show_price_total">
+ <span t-field="l.price_total"
+ t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
+ </td>
+ <t t-if="o.company_id.country_id.code == 'IN'">
+ <td class="text-right" t-if="is_cgst">
+ <t t-foreach="tax_datas[l.id]" t-as="tax_data">
+ <t t-if="tag_cgst_id in tax_data['tag_ids']">
+ <t t-esc="tax_data['amount']"/>
+ </t>
+ </t>
+ </td>
+ <td class="text-right" t-if="is_cgst">
+ <t t-foreach="tax_datas[l.id]" t-as="tax_data">
+ <t t-if="tag_sgst_id in tax_data['tag_ids']">
+ <t t-esc="tax_data['amount']"/>
+ </t>
+ </t>
+ </td>
+ <td class="text-right" t-if="is_igst">
+ <t t-foreach="tax_datas[l.id]" t-as="tax_data">
+ <t t-if="tag_igst_id in tax_data['tag_ids']">
+ <t t-esc="tax_data['amount']"/>
+ </t>
+ </t>
+ </td>
+ <t t-set="total_cess" t-value="0.0"/>
+ <td class="text-right" t-if="is_cess">
+ <t t-foreach="tax_datas[l.id]" t-as="tax_data">
+ <t t-if="tag_cess_id in tax_data['tag_ids']">
+ <t t-set="total_cess" t-value="total_cess + tax_data['amount']"/>
+ </t>
+ </t>
+ <t t-esc="total_cess"/>
+ </td>
+ </t>
+ </tr>
+ </t>
+
+ <t t-if="(layout_category_size > 1 or page_size > 1) and layout_category['subtotal']" groups="sale.group_sale_layout">
+ <tr class="text-right">
+ <td t-att-colspan="o.company_id.country_id.code == 'IN' and 9 or 6">
+ <strong>Subtotal: </strong>
+ <t t-set="subtotal" t-value="sum(line.price_subtotal for line in layout_category['lines'])"/>
+ <span t-esc="subtotal" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}"/>
+ </td>
+ </tr>
+ </t>
+ </t>
+ </tbody>
+ </table>
+
+ <t t-if="page_index &lt; page_size - 1" groups="sale.group_sale_layout">
+ <p style="page-break-before:always;"> </p>
+ </t>
+ </t>
+ </xpath>
+ </template>
+
+</odoo>
diff --git a/addons/l10n_in_sale/views/report_sale_order.xml b/addons/l10n_in_sale/views/report_sale_order.xml
new file mode 100644
index 00000000000..c9d241cb043
--- /dev/null
+++ b/addons/l10n_in_sale/views/report_sale_order.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <template id="gst_report_saleorder_document_inherit" inherit_id="sale.report_saleorder_document">
+ <xpath expr="//span[@t-field='l.name']" position="after">
+ <t t-if="l.product_id.l10n_in_hsn_code"><h6><strong class="ml16">HSN/SAC Code:</strong> <span t-field="l.product_id.l10n_in_hsn_code"/></h6></t>
+ </xpath>
+ </template>
+
+</odoo>