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,52 @@
# Indian - UPI
Invoice with UPI QR code
=========================
This module adds QR code in invoice report for UPI payment allowing to make payment via any UPI app.
To print UPI Qr code add UPI id in company and tick "QR Codes" in configuration
## Installation
```bash
pip install odoo-bringout-oca-ocb-l10n_in_upi
```
## Dependencies
This addon depends on:
- l10n_in
## Manifest Information
- **Name**: Indian - UPI
- **Version**: 1.0
- **Category**: Accounting/Localizations
- **License**: LGPL-3
- **Installable**: False
## Source
Based on [OCA/OCB](https://github.com/OCA/OCB) branch 16.0, addon `l10n_in_upi`.
## 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_upi Module - l10n_in_upi
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_upi. 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,5 @@
# Dependencies
This addon depends on:
- [l10n_in](../../odoo-bringout-oca-ocb-l10n_in)

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_upi or install in UI.

View file

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

View file

@ -0,0 +1,13 @@
# Models
Detected core models and extensions in l10n_in_upi.
```mermaid
classDiagram
class account_move
class res_company
```
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_upi. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon l10n_in_upi
- 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_upi
```

View file

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

View file

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

View file

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Indian - UPI',
'version': '1.0',
'description': """
Invoice with UPI QR code
=========================
This module adds QR code in invoice report for UPI payment allowing to make payment via any UPI app.
To print UPI Qr code add UPI id in company and tick "QR Codes" in configuration
""",
'category': 'Accounting/Localizations',
'depends': ['l10n_in'],
'data': ['views/res_company_views.xml'],
'license': 'LGPL-3',
'auto_install': True,
}

View file

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

View file

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from odoo import models
from odoo.tools.image import image_data_uri
class AccountMove(models.Model):
_inherit = "account.move"
def _generate_qr_code(self, silent_errors=False):
self.ensure_one()
if self.company_id.country_code == 'IN' and self.is_sale_document(include_receipts=True):
payment_url = 'upi://pay?pa=%s&pn=%s&am=%s&tr=%s&tn=%s' % (
self.company_id.l10n_in_upi_id,
self.company_id.name,
self.amount_residual,
self.payment_reference or self.name,
("Payment for %s" % self.name))
barcode = self.env['ir.actions.report'].barcode(barcode_type="QR", value=payment_url, width=120, height=120)
return image_data_uri(base64.b64encode(barcode))
return super()._generate_qr_code(silent_errors)

View file

@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class Company(models.Model):
_inherit = 'res.company'
l10n_in_upi_id = fields.Char(string="UPI Id")

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_company_form" model="ir.ui.view">
<field name="name">res.company.form.inherit.l10n_in_upi</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='currency_id']" position="after">
<field name="l10n_in_upi_id" attrs="{'invisible': [('country_code', '!=', 'IN')]}"/>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,42 @@
[project]
name = "odoo-bringout-oca-ocb-l10n_in_upi"
version = "16.0.0"
description = "Indian - UPI - Odoo addon"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-l10n_in>=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_upi"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]