From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- addons/l10n_in_pos/__init__.py | 4 ++ addons/l10n_in_pos/__manifest__.py | 24 ++++++++++ addons/l10n_in_pos/data/product_demo.xml | 57 +++++++++++++++++++++++ addons/l10n_in_pos/models/__init__.py | 4 ++ addons/l10n_in_pos/models/pos_order.py | 26 +++++++++++ addons/l10n_in_pos/static/src/js/receipt.js | 17 +++++++ addons/l10n_in_pos/static/src/xml/pos_receipt.xml | 27 +++++++++++ addons/l10n_in_pos/views/point_of_sale.xml | 8 ++++ 8 files changed, 167 insertions(+) create mode 100644 addons/l10n_in_pos/__init__.py create mode 100644 addons/l10n_in_pos/__manifest__.py create mode 100644 addons/l10n_in_pos/data/product_demo.xml create mode 100644 addons/l10n_in_pos/models/__init__.py create mode 100644 addons/l10n_in_pos/models/pos_order.py create mode 100644 addons/l10n_in_pos/static/src/js/receipt.js create mode 100644 addons/l10n_in_pos/static/src/xml/pos_receipt.xml create mode 100644 addons/l10n_in_pos/views/point_of_sale.xml (limited to 'addons/l10n_in_pos') 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 @@ + + + + 9403 + Other furniture and parts thereof. + + + 9403 + Other furniture and parts thereof. + + + 8539.50.00 + Light-emitting diode (LED) lamps + + + 4819.60.00 + Box files, letter trays, storage boxes and similar articles, of a kind used in offices, shops or the like + + + 3921.90.99 + Other plates, sheets film , foil and strip, of plastics + + + 8443.32.90 + Other, capable of connecting to an automatic data processing machine or to a network + + + 9403 + Other furniture and parts thereof. + + + 9403.10.90 + Metal furniture of a kind used in offices + + + 9403.10.90 + Metal furniture of a kind used in offices + + + 8209.00.90 + Plates, sticks, tips and the like for tools, unmounted, of cermets. + + + 9403.10.90 + Metal furniture of a kind used in offices + + + 3926.10.99 + Office supplies of a kind classified as stationary other than pins,clips, and writing instruments + + + 9608 + 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 + + + + 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 @@ + + + + + +
+
+ +
+ Phone: + +
+
+
+
+
+
+ + +
+ HSN Code: + +
+
+
+
+
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 @@ + + + + -- cgit v1.2.3