summaryrefslogtreecommitdiff
path: root/addons/l10n_in_pos
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_pos
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/l10n_in_pos')
-rw-r--r--addons/l10n_in_pos/__init__.py4
-rw-r--r--addons/l10n_in_pos/__manifest__.py24
-rw-r--r--addons/l10n_in_pos/data/product_demo.xml57
-rw-r--r--addons/l10n_in_pos/models/__init__.py4
-rw-r--r--addons/l10n_in_pos/models/pos_order.py26
-rw-r--r--addons/l10n_in_pos/static/src/js/receipt.js17
-rw-r--r--addons/l10n_in_pos/static/src/xml/pos_receipt.xml27
-rw-r--r--addons/l10n_in_pos/views/point_of_sale.xml8
8 files changed, 167 insertions, 0 deletions
diff --git a/addons/l10n_in_pos/__init__.py b/addons/l10n_in_pos/__init__.py
new file mode 100644
index 00000000..dc5e6b69
--- /dev/null
+++ b/addons/l10n_in_pos/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from . import models
diff --git a/addons/l10n_in_pos/__manifest__.py b/addons/l10n_in_pos/__manifest__.py
new file mode 100644
index 00000000..d6b0e5d7
--- /dev/null
+++ b/addons/l10n_in_pos/__manifest__.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+{
+ 'name': 'Indian - Point of Sale',
+ 'version': '1.0',
+ 'description': """GST Point of Sale""",
+ 'category': 'Accounting/Localizations/Point of Sale',
+ 'depends': [
+ 'l10n_in',
+ 'point_of_sale'
+ ],
+ 'data': [
+ 'views/point_of_sale.xml',
+ ],
+ 'demo': [
+ 'data/product_demo.xml',
+ ],
+ 'qweb': [
+ 'static/src/xml/pos_receipt.xml',
+ ],
+ 'auto_install': True,
+ 'license': 'LGPL-3',
+}
diff --git a/addons/l10n_in_pos/data/product_demo.xml b/addons/l10n_in_pos/data/product_demo.xml
new file mode 100644
index 00000000..29d8aeb4
--- /dev/null
+++ b/addons/l10n_in_pos/data/product_demo.xml
@@ -0,0 +1,57 @@
+<odoo>
+ <data noupdate="1">
+ <record id="point_of_sale.desk_organizer" model="product.product">
+ <field name="l10n_in_hsn_code">9403</field>
+ <field name="l10n_in_hsn_description">Other furniture and parts thereof.</field>
+ </record>
+ <record id="point_of_sale.desk_pad" model="product.product">
+ <field name="l10n_in_hsn_code">9403</field>
+ <field name="l10n_in_hsn_description">Other furniture and parts thereof.</field>
+ </record>
+ <record id="point_of_sale.led_lamp" model="product.product">
+ <field name="l10n_in_hsn_code">8539.50.00</field>
+ <field name="l10n_in_hsn_description">Light-emitting diode (LED) lamps</field>
+ </record>
+ <record id="point_of_sale.letter_tray" model="product.product">
+ <field name="l10n_in_hsn_code">4819.60.00</field>
+ <field name="l10n_in_hsn_description">Box files, letter trays, storage boxes and similar articles, of a kind used in offices, shops or the like</field>
+ </record>
+ <record id="point_of_sale.magnetic_board" model="product.product">
+ <field name="l10n_in_hsn_code">3921.90.99</field>
+ <field name="l10n_in_hsn_description">Other plates, sheets film , foil and strip, of plastics</field>
+ </record>
+ <record id="point_of_sale.product_product_consumable" model="product.product">
+ <field name="l10n_in_hsn_code">8443.32.90</field>
+ <field name="l10n_in_hsn_description">Other, capable of connecting to an automatic data processing machine or to a network</field>
+ </record>
+ <record id="point_of_sale.monitor_stand" model="product.product">
+ <field name="l10n_in_hsn_code">9403</field>
+ <field name="l10n_in_hsn_description">Other furniture and parts thereof.</field>
+ </record>
+ <record id="point_of_sale.newspaper_rack" model="product.product">
+ <field name="l10n_in_hsn_code">9403.10.90</field>
+ <field name="l10n_in_hsn_description">Metal furniture of a kind used in offices</field>
+ </record>
+ <record id="point_of_sale.small_shelf" model="product.product">
+ <field name="l10n_in_hsn_code">9403.10.90</field>
+ <field name="l10n_in_hsn_description">Metal furniture of a kind used in offices</field>
+ </record>
+ <record id="point_of_sale.product_product_tip" model="product.product">
+ <field name="l10n_in_hsn_code">8209.00.90</field>
+ <field name="l10n_in_hsn_description">Plates, sticks, tips and the like for tools, unmounted, of cermets.</field>
+ </record>
+ <record id="point_of_sale.wall_shelf" model="product.product">
+ <field name="l10n_in_hsn_code">9403.10.90</field>
+ <field name="l10n_in_hsn_description">Metal furniture of a kind used in offices</field>
+ </record>
+ <record id="point_of_sale.whiteboard" model="product.product">
+ <field name="l10n_in_hsn_code">3926.10.99</field>
+ <field name="l10n_in_hsn_description">Office supplies of a kind classified as stationary other than pins,clips, and writing instruments</field>
+ </record>
+ <record id="point_of_sale.whiteboard_pen" model="product.product">
+ <field name="l10n_in_hsn_code">9608</field>
+ <field name="l10n_in_hsn_description">Ball point pens; felt tipped and other porous-tipped pens and markers; fountain pens, stylograph pens and other pens; duplicating stylos; propelling or sliding pencils; pen-holders, pencilholders and similar holders; parts (including caps and clips) of the foregoing articles, othe than those of heading 9609
+ </field>
+ </record>
+ </data>
+</odoo>
diff --git a/addons/l10n_in_pos/models/__init__.py b/addons/l10n_in_pos/models/__init__.py
new file mode 100644
index 00000000..04f8c2cc
--- /dev/null
+++ b/addons/l10n_in_pos/models/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from . import pos_order
diff --git a/addons/l10n_in_pos/models/pos_order.py b/addons/l10n_in_pos/models/pos_order.py
new file mode 100644
index 00000000..7b0caba6
--- /dev/null
+++ b/addons/l10n_in_pos/models/pos_order.py
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import api, fields, models
+
+
+class PosOrder(models.Model):
+ _inherit = 'pos.order'
+
+ @api.model
+ def _get_account_move_line_group_data_type_key(self, data_type, values, options={}):
+ res = super(PosOrder, self)._get_account_move_line_group_data_type_key(data_type, values, options)
+ if data_type == 'tax' and res:
+ if self.env['account.tax'].browse(values['tax_line_id']).company_id.country_id.code == 'IN':
+ return res + (values['product_uom_id'], values['product_id'])
+ return res
+
+ def _prepare_account_move_line(self, line, partner_id, current_company, currency_id, rounding_method):
+ res = super(PosOrder, self)._prepare_account_move_line(line, partner_id, current_company, currency_id, rounding_method)
+ for line_values in res:
+ if line_values.get('data_type') in ['tax','product']:
+ line_values['values'].update({
+ 'product_id': line.product_id.id,
+ 'product_uom_id': line.product_id.uom_id.id
+ })
+ return res
diff --git a/addons/l10n_in_pos/static/src/js/receipt.js b/addons/l10n_in_pos/static/src/js/receipt.js
new file mode 100644
index 00000000..89ccc681
--- /dev/null
+++ b/addons/l10n_in_pos/static/src/js/receipt.js
@@ -0,0 +1,17 @@
+odoo.define('l10n_in_pos.receipt', function (require) {
+"use strict";
+
+var models = require('point_of_sale.models');
+
+models.load_fields('product.product', 'l10n_in_hsn_code');
+
+var _super_orderline = models.Orderline.prototype;
+models.Orderline = models.Orderline.extend({
+ export_for_printing: function() {
+ var line = _super_orderline.export_for_printing.apply(this,arguments);
+ line.l10n_in_hsn_code = this.get_product().l10n_in_hsn_code;
+ return line;
+ },
+});
+
+});
diff --git a/addons/l10n_in_pos/static/src/xml/pos_receipt.xml b/addons/l10n_in_pos/static/src/xml/pos_receipt.xml
new file mode 100644
index 00000000..ab6e4cb2
--- /dev/null
+++ b/addons/l10n_in_pos/static/src/xml/pos_receipt.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<templates id="template" xml:space="preserve">
+ <t t-name="OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension" owl="1">
+ <xpath expr="//div[hasclass('orderlines')]" position="before">
+ <t t-if="receipt.client and env.pos.company.country and env.pos.company.country.code == 'IN'">
+ <div class="pos-receipt-center-align">
+ <div><t t-esc="receipt.client.name" /></div>
+ <t t-if="receipt.client.phone">
+ <div>
+ <span>Phone: </span>
+ <t t-esc="receipt.client.phone" />
+ </div>
+ </t>
+ <br />
+ </div>
+ </t>
+ </xpath>
+ <xpath expr="//WrappedProductNameLines" position="after">
+ <t t-if="line.l10n_in_hsn_code and env.pos.company.country and env.pos.company.country.code == 'IN'">
+ <div class="pos-receipt-left-padding">
+ <span>HSN Code: </span>
+ <t t-esc="line.l10n_in_hsn_code"/>
+ </div>
+ </t>
+ </xpath>
+ </t>
+</templates>
diff --git a/addons/l10n_in_pos/views/point_of_sale.xml b/addons/l10n_in_pos/views/point_of_sale.xml
new file mode 100644
index 00000000..49c54c79
--- /dev/null
+++ b/addons/l10n_in_pos/views/point_of_sale.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <template id="assets" inherit_id="point_of_sale.assets">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/l10n_in_pos/static/src/js/receipt.js"></script>
+ </xpath>
+ </template>
+</odoo>