Initial commit: L10N_Asia Pacific packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:52 +02:00
commit 54c86b612c
828 changed files with 58224 additions and 0 deletions

View file

@ -0,0 +1,47 @@
# Indian - Point of Sale
GST Point of Sale
## Installation
```bash
pip install odoo-bringout-oca-ocb-l10n_in_pos
```
## Dependencies
This addon depends on:
- l10n_in
- point_of_sale
## Manifest Information
- **Name**: Indian - Point of Sale
- **Version**: 1.0
- **Category**: Accounting/Localizations/Point of Sale
- **License**: LGPL-3
- **Installable**: False
## Source
Based on [OCA/OCB](https://github.com/OCA/OCB) branch 16.0, addon `l10n_in_pos`.
## License
This package maintains the original LGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Reports: doc/REPORTS.md
- Security: doc/SECURITY.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph L10n_in_pos Module - l10n_in_pos
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for l10n_in_pos. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,6 @@
# Dependencies
This addon depends on:
- [l10n_in](../../odoo-bringout-oca-ocb-l10n_in)
- [point_of_sale](../../odoo-bringout-oca-ocb-point_of_sale)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon l10n_in_pos or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-ocb-l10n_in_pos"
# or
uv pip install odoo-bringout-oca-ocb-l10n_in_pos"
```

View file

@ -0,0 +1,14 @@
# Models
Detected core models and extensions in l10n_in_pos.
```mermaid
classDiagram
class pos_config
class pos_order
class pos_session
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: l10n_in_pos. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon l10n_in_pos
- License: LGPL-3

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,8 @@
# Security
This module does not define custom security rules or access controls beyond Odoo defaults.
Default Odoo security applies:
- Base user access through standard groups
- Model access inherited from dependencies
- No custom row-level security rules

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon l10n_in_pos
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models

View file

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Indian - Point of Sale',
'icon': '/l10n_in/static/description/icon.png',
'version': '1.0',
'description': """GST Point of Sale""",
'category': 'Accounting/Localizations/Point of Sale',
'depends': [
'l10n_in',
'point_of_sale'
],
'demo': [
'data/product_demo.xml',
],
'auto_install': True,
'assets': {
'point_of_sale.assets': [
'l10n_in_pos/static/src/js/**/*',
'l10n_in_pos/static/src/xml/**/*',
],
},
'license': 'LGPL-3',
}

View file

@ -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>

View file

@ -0,0 +1,54 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_in_pos
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-12 07:24+0000\n"
"PO-Revision-Date: 2023-06-12 07:24+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: l10n_in_pos
#: code:addons/l10n_in_pos/models/pos_config.py:0
#, python-format
msgid "Go to Company configuration"
msgstr ""
#. module: l10n_in_pos
#. openerp-web
#: code:addons/l10n_in_pos/static/src/xml/pos_receipt.xml:0
#, python-format
msgid "HSN Code:"
msgstr ""
#. module: l10n_in_pos
#. openerp-web
#: code:addons/l10n_in_pos/static/src/xml/pos_receipt.xml:0
#, python-format
msgid "Phone:"
msgstr ""
#. module: l10n_in_pos
#: model:ir.model,name:l10n_in_pos.model_pos_config
msgid "Point of Sale Configuration"
msgstr ""
#. module: l10n_in_pos
#: model:ir.model,name:l10n_in_pos.model_pos_order
msgid "Point of Sale Orders"
msgstr ""
#. module: l10n_in_pos
#: code:addons/l10n_in_pos/models/pos_config.py:0
#, python-format
msgid ""
"Your company %s needs to have a correct address in order to open the session.\n"
"Set the address of your company (Don't forget the State field)"
msgstr ""

View file

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import pos_order
from . import pos_session
from . import pos_config

View file

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.exceptions import RedirectWarning
from odoo.tools.translate import _
class PosConfig(models.Model):
_inherit = 'pos.config'
def open_ui(self):
for config in self:
if config.company_id.country_id.code == 'IN' and not config.company_id.state_id:
msg = _("Your company %s needs to have a correct address in order to open the session.\n"
"Set the address of your company (Don't forget the State field)") % (config.company_id.name)
action = {
"view_mode": "form",
"res_model": "res.company",
"type": "ir.actions.act_window",
"res_id" : config.company_id.id,
"views": [[self.env.ref("base.view_company_form").id, "form"]],
}
raise RedirectWarning(msg, action, _('Go to Company configuration'))
return super(PosConfig, self).open_ui()

View file

@ -0,0 +1,20 @@
# -*- 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'
def _prepare_invoice_vals(self):
vals = super()._prepare_invoice_vals()
if self.session_id.company_id.country_id.code == 'IN':
partner = self.partner_id
l10n_in_gst_treatment = partner.l10n_in_gst_treatment
if not l10n_in_gst_treatment and partner.country_id and partner.country_id.code != 'IN':
l10n_in_gst_treatment = 'overseas'
if not l10n_in_gst_treatment:
l10n_in_gst_treatment = partner.vat and 'regular' or 'consumer'
vals['l10n_in_gst_treatment'] = l10n_in_gst_treatment
return vals

View file

@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class PosSession(models.Model):
_inherit = 'pos.session'
def _loader_params_product_product(self):
result = super()._loader_params_product_product()
result['search_params']['fields'].append('l10n_in_hsn_code')
return result

View file

@ -0,0 +1,17 @@
odoo.define('l10n_in_pos.receipt', function (require) {
"use strict";
var { Orderline } = require('point_of_sale.models');
const Registries = require('point_of_sale.Registries');
const L10nInOrderline = (Orderline) => class L10nInOrderline extends Orderline {
export_for_printing() {
var line = super.export_for_printing(...arguments);
line.l10n_in_hsn_code = this.get_product().l10n_in_hsn_code;
return line;
}
}
Registries.Model.extend(Orderline, L10nInOrderline);
});

View file

@ -0,0 +1,30 @@
<?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.partner and env.pos.company.country and env.pos.company.country.code == 'IN'">
<div class="pos-receipt-center-align">
<div><t t-esc="receipt.partner.name" /></div>
<t t-if="receipt.partner.phone">
<div>
<span>Phone: </span>
<t t-esc="receipt.partner.phone" />
</div>
</t>
<br />
</div>
</t>
</xpath>
</t>
<t t-name="OrderLinesReceipt" t-inherit="point_of_sale.OrderLinesReceipt" t-inherit-mode="extension" owl="1">
<xpath expr="//t[@t-foreach='receipt.orderlines']" position="inside">
<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>

View file

@ -0,0 +1,43 @@
[project]
name = "odoo-bringout-oca-ocb-l10n_in_pos"
version = "16.0.0"
description = "Indian - Point of Sale - Odoo addon"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-l10n_in>=16.0.0",
"odoo-bringout-oca-ocb-point_of_sale>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["l10n_in_pos"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]