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,48 @@
# Gulf Cooperation Council - Point of Sale
GCC POS Localization
=======================================================
## Installation
```bash
pip install odoo-bringout-oca-ocb-l10n_gcc_pos
```
## Dependencies
This addon depends on:
- point_of_sale
- l10n_gcc_invoice
## Manifest Information
- **Name**: Gulf Cooperation Council - Point of Sale
- **Version**: N/A
- **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_gcc_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
- 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_gcc_pos Module - l10n_gcc_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_gcc_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:
- [point_of_sale](../../odoo-bringout-oca-ocb-point_of_sale)
- [l10n_gcc_invoice](../../odoo-bringout-oca-ocb-l10n_gcc_invoice)

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Gulf Cooperation Council - Point of Sale',
'author': 'Odoo S.A',
'category': 'Accounting/Localizations/Point of Sale',
'description': """
GCC POS Localization
=======================================================
""",
'license': 'LGPL-3',
'depends': ['point_of_sale', 'l10n_gcc_invoice'],
'assets': {
'point_of_sale.assets': [
'l10n_gcc_pos/static/src/js/OrderReceipt.js',
'l10n_gcc_pos/static/src/css/OrderReceipt.css',
'l10n_gcc_pos/static/src/xml/OrderReceipt.xml',
]
},
'auto_install': True,
}

View file

@ -0,0 +1,3 @@
.pos-receipt-amount-arabic {
padding-left: 0em !important;
}

View file

@ -0,0 +1,20 @@
odoo.define('l10n_gcc_pos.OrderReceipt', function (require) {
'use strict';
const OrderReceipt = require('point_of_sale.OrderReceipt')
const Registries = require('point_of_sale.Registries');
const OrderReceiptGCC = OrderReceipt =>
class extends OrderReceipt {
get receiptEnv() {
let receipt_render_env = super.receiptEnv;
let receipt = receipt_render_env.receipt;
const country = receipt_render_env.order.pos.company.country;
receipt.is_gcc_country = country ? ['SA', 'AE', 'BH', 'OM', 'QA', 'KW'].includes(country && country.code) : false;
return receipt_render_env;
}
}
Registries.Component.extend(OrderReceipt, OrderReceiptGCC)
return OrderReceiptGCC
});

View file

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension" owl="1">
<xpath expr="//div[hasclass('pos-receipt-contact')]" position="after">
<t t-if="receipt.is_gcc_country">
<br/>
<br/>
<div class="pos-receipt-header">
<span id="title_english" t-translation="off">Tax Invoice</span>
</div>
<div class="pos-receipt-header">
<span id="title_arabic" t-translation="off">الفاتورة الضريبية</span>
</div>
</t>
</xpath>
<xpath expr="//t[@t-esc='receipt.cashier']/.." position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//t[@t-esc='receipt.cashier']/.." position="after">
<div t-if="receipt.is_gcc_country" t-translation="off">
<div>Served by / خدم بواسطة <t t-esc="receipt.cashier"/></div>
</div>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.subtotal)']/.." position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.subtotal)']/.." position="after">
<div t-if="receipt.is_gcc_country" t-translation="off">
Subtotal / الإجمالي الفرعي
<span t-esc="env.pos.format_currency(receipt.subtotal)" class="pos-receipt-right-align"/>
</div>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.total_with_tax)']/.." position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.total_with_tax)']/.." position="after">
<div t-if="receipt.is_gcc_country" class="pos-receipt-amount pos-receipt-amount-arabic" t-translation="off">
TOTAL / الإجمالي
<span t-esc="env.pos.format_currency(receipt.total_with_tax)" class="pos-receipt-right-align"/>
</div>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.rounding_applied)']/.." position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.rounding_applied)']/.." position="after">
<div t-if="receipt.is_gcc_country" class="pos-receipt-amount pos-receipt-amount-arabic" t-translation="off">
Rounding / التقريب
<span t-esc="env.pos.format_currency(receipt.rounding_applied)" class="pos-receipt-right-align"/>
</div>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.total_rounded)']/.." position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.total_rounded)']/.." position="after">
<div t-if="receipt.is_gcc_country" class="pos-receipt-amount pos-receipt-amount-arabic" t-translation="off">
To Pay / للسداد
<span t-esc="env.pos.format_currency(receipt.total_rounded)" class="pos-receipt-right-align"/>
</div>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.change)']/.." position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.change)']/.." position="after">
<div t-if="receipt.is_gcc_country" class="pos-receipt-amount receipt-change pos-receipt-amount-arabic" t-translation="off">
CHANGE / الباقي
<span t-esc="env.pos.format_currency(receipt.change)" class="pos-receipt-right-align"/>
</div>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.total_discount)']/.." position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.total_discount)']/.." position="after">
<div t-if="receipt.is_gcc_country" t-translation="off">
Discounts / الخصومات
<span t-esc="env.pos.format_currency(receipt.total_discount)" class="pos-receipt-right-align"/>
</div>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.total_tax)']/.." position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//span[@t-esc='env.pos.format_currency(receipt.total_tax)']/.." position="after">
<div t-if="receipt.is_gcc_country" t-translation="off">
Total Taxes / إجمالي الضرائب
<span t-esc="env.pos.format_currency(receipt.total_tax)" class="pos-receipt-right-align"/>
</div>
</xpath>
</t>
<t t-inherit="point_of_sale.OrderLinesReceipt" t-inherit-mode="extension" owl="1">
<xpath expr="//t[@t-if='isSimple(line)']/div/span[hasclass('price_display')]" position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//t[@t-if='isSimple(line)']/WrappedProductNameLines" position="after">
<div class="responsive-price" t-if="receipt.is_gcc_country">
<div class="pos-receipt-left-padding" style="display: inline-flex;">
<div t-translation="off">Taxes / الضرائب</div>:<span t-esc="env.pos.format_currency_no_symbol(line.tax)" style="margin-left: 5px"/>
</div>
<span t-esc="env.pos.format_currency_no_symbol(line.price_display)" class="price_display pos-receipt-right-align"/>
</div>
</xpath>
<xpath expr="//t[@t-esc='line.unit_name']/.." position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//t[@t-esc='line.unit_name']/.." position="after">
<t t-if="receipt.is_gcc_country">
<div class="pos-receipt-left-padding">
<t t-esc="Math.round(line.quantity * Math.pow(10, env.pos.dp['Product Unit of Measure'])) / Math.pow(10, env.pos.dp['Product Unit of Measure'])"/>
<t t-if="!line.is_in_unit" t-esc="line.unit_name" />
x
<t t-esc="env.pos.format_currency_no_symbol(line.price_display_one)" />
</div>
<div class="responsive-price">
<div class="pos-receipt-left-padding" style="display: inline-flex;">
<div t-translation="off">Taxes / الضرائب</div>:<span t-esc="env.pos.format_currency_no_symbol(line.tax)" style="margin-left: 5px"/>
</div>
<span t-esc="env.pos.format_currency_no_symbol(line.price_display)" class="price_display pos-receipt-right-align"/>
</div>
</t>
</xpath>
<xpath expr="//t[@t-esc='line.discount']/.." position="attributes">
<attribute name="t-if">!receipt.is_gcc_country</attribute>
</xpath>
<xpath expr="//t[@t-esc='line.discount']/.." position="after">
<div class="pos-receipt-left-padding" style="display: inline-flex;" t-if="receipt.is_gcc_country" t-translation="off">
<div>Discount / الخصم</div>: <t t-esc="line.discount" />%
</div>
</xpath>
</t>
</templates>

View file

@ -0,0 +1,43 @@
[project]
name = "odoo-bringout-oca-ocb-l10n_gcc_pos"
version = "16.0.0"
description = "Gulf Cooperation Council - Point of Sale - Odoo addon"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-point_of_sale>=16.0.0",
"odoo-bringout-oca-ocb-l10n_gcc_invoice>=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_gcc_pos"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]