mirror of
https://github.com/bringout/oca-ocb-l10n_me-africa.git
synced 2026-04-27 06:02:04 +02:00
Initial commit: L10N_Me Africa packages
This commit is contained in:
commit
c265268138
611 changed files with 75334 additions and 0 deletions
46
odoo-bringout-oca-ocb-l10n_mt_pos/README.md
Normal file
46
odoo-bringout-oca-ocb-l10n_mt_pos/README.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# Malta - Point of Sale
|
||||
|
||||
Malta Compliance Letter for EXO Number
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-ocb-l10n_mt_pos
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
This addon depends on:
|
||||
- point_of_sale
|
||||
|
||||
## Manifest Information
|
||||
|
||||
- **Name**: Malta - 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_mt_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
|
||||
32
odoo-bringout-oca-ocb-l10n_mt_pos/doc/ARCHITECTURE.md
Normal file
32
odoo-bringout-oca-ocb-l10n_mt_pos/doc/ARCHITECTURE.md
Normal 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_mt_pos Module - l10n_mt_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.
|
||||
3
odoo-bringout-oca-ocb-l10n_mt_pos/doc/CONFIGURATION.md
Normal file
3
odoo-bringout-oca-ocb-l10n_mt_pos/doc/CONFIGURATION.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Configuration
|
||||
|
||||
Refer to Odoo settings for l10n_mt_pos. Configure related models, access rights, and options as needed.
|
||||
3
odoo-bringout-oca-ocb-l10n_mt_pos/doc/CONTROLLERS.md
Normal file
3
odoo-bringout-oca-ocb-l10n_mt_pos/doc/CONTROLLERS.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Controllers
|
||||
|
||||
This module does not define custom HTTP controllers.
|
||||
5
odoo-bringout-oca-ocb-l10n_mt_pos/doc/DEPENDENCIES.md
Normal file
5
odoo-bringout-oca-ocb-l10n_mt_pos/doc/DEPENDENCIES.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Dependencies
|
||||
|
||||
This addon depends on:
|
||||
|
||||
- [point_of_sale](../../odoo-bringout-oca-ocb-point_of_sale)
|
||||
4
odoo-bringout-oca-ocb-l10n_mt_pos/doc/FAQ.md
Normal file
4
odoo-bringout-oca-ocb-l10n_mt_pos/doc/FAQ.md
Normal 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_mt_pos or install in UI.
|
||||
7
odoo-bringout-oca-ocb-l10n_mt_pos/doc/INSTALL.md
Normal file
7
odoo-bringout-oca-ocb-l10n_mt_pos/doc/INSTALL.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Install
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-ocb-l10n_mt_pos"
|
||||
# or
|
||||
uv pip install odoo-bringout-oca-ocb-l10n_mt_pos"
|
||||
```
|
||||
11
odoo-bringout-oca-ocb-l10n_mt_pos/doc/MODELS.md
Normal file
11
odoo-bringout-oca-ocb-l10n_mt_pos/doc/MODELS.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Models
|
||||
|
||||
Detected core models and extensions in l10n_mt_pos.
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
```
|
||||
|
||||
Notes
|
||||
- Classes show model technical names; fields omitted for brevity.
|
||||
- Items listed under _inherit are extensions of existing models.
|
||||
6
odoo-bringout-oca-ocb-l10n_mt_pos/doc/OVERVIEW.md
Normal file
6
odoo-bringout-oca-ocb-l10n_mt_pos/doc/OVERVIEW.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Overview
|
||||
|
||||
Packaged Odoo addon: l10n_mt_pos. Provides features documented in upstream Odoo 16 under this addon.
|
||||
|
||||
- Source: OCA/OCB 16.0, addon l10n_mt_pos
|
||||
- License: LGPL-3
|
||||
3
odoo-bringout-oca-ocb-l10n_mt_pos/doc/REPORTS.md
Normal file
3
odoo-bringout-oca-ocb-l10n_mt_pos/doc/REPORTS.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Reports
|
||||
|
||||
This module does not define custom reports.
|
||||
34
odoo-bringout-oca-ocb-l10n_mt_pos/doc/SECURITY.md
Normal file
34
odoo-bringout-oca-ocb-l10n_mt_pos/doc/SECURITY.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Security
|
||||
|
||||
Access control and security definitions in l10n_mt_pos.
|
||||
|
||||
## Access Control Lists (ACLs)
|
||||
|
||||
Model access permissions defined in:
|
||||
- **[ir.model.access.csv](../l10n_mt_pos/security/ir.model.access.csv)**
|
||||
- 2 model access rules
|
||||
|
||||
## Record Rules
|
||||
|
||||
Row-level security rules defined in:
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Security Layers"
|
||||
A[Users] --> B[Groups]
|
||||
B --> C[Access Control Lists]
|
||||
C --> D[Models]
|
||||
B --> E[Record Rules]
|
||||
E --> F[Individual Records]
|
||||
end
|
||||
```
|
||||
|
||||
Security files overview:
|
||||
- **[ir.model.access.csv](../l10n_mt_pos/security/ir.model.access.csv)**
|
||||
- Model access permissions (CRUD rights)
|
||||
|
||||
Notes
|
||||
- Access Control Lists define which groups can access which models
|
||||
- Record Rules provide row-level security (filter records by user/group)
|
||||
- Security groups organize users and define permission sets
|
||||
- All security is enforced at the ORM level by Odoo
|
||||
5
odoo-bringout-oca-ocb-l10n_mt_pos/doc/TROUBLESHOOTING.md
Normal file
5
odoo-bringout-oca-ocb-l10n_mt_pos/doc/TROUBLESHOOTING.md
Normal 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.
|
||||
7
odoo-bringout-oca-ocb-l10n_mt_pos/doc/USAGE.md
Normal file
7
odoo-bringout-oca-ocb-l10n_mt_pos/doc/USAGE.md
Normal 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_mt_pos
|
||||
```
|
||||
3
odoo-bringout-oca-ocb-l10n_mt_pos/doc/WIZARDS.md
Normal file
3
odoo-bringout-oca-ocb-l10n_mt_pos/doc/WIZARDS.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Wizards
|
||||
|
||||
This module does not include UI wizards.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
from . import wizards
|
||||
from . import reports
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
{
|
||||
"name": "Malta - Point of Sale",
|
||||
"version": "1.0",
|
||||
"category": "Accounting/Localizations/Point of Sale",
|
||||
"description": """Malta Compliance Letter for EXO Number""",
|
||||
"depends": [
|
||||
"point_of_sale",
|
||||
],
|
||||
"data": [
|
||||
'security/ir.model.access.csv',
|
||||
'wizards/compliance_letter_view.xml',
|
||||
'reports/compliance_letter_report.xml',
|
||||
],
|
||||
"auto_install": True,
|
||||
"license": "LGPL-3",
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<odoo>
|
||||
<template id="report_compliance_letter_template">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page px-4">
|
||||
<h3 class="text-center mb-4">
|
||||
Odoo Point Of Sale application, version
|
||||
<t t-esc="version"/>
|
||||
</h3>
|
||||
<div class="mb-1"><t t-esc="date"/></div>
|
||||
<div class="mb-1"><t t-esc="name"/></div>
|
||||
<div class="mb-1"><t t-esc="address"/></div>
|
||||
<div class="mb-4"><t t-esc="vat"/></div>
|
||||
<div class="mb-3">Dear Sir/Madam,</div>
|
||||
<div class="ps-3 mb-4" style="line-height: 1.5;">
|
||||
Odoo S.A., (Belgium) is a registered company with the Trade and Companies Register of Nivelles with VAT number BE0477472701, having its registered office at Chaussée de Namur, 40, 1367 Grand-Rosière, Belgium ("Odoo"). Odoo provides Enterprise Resource Planning (ERP) cloud and on-premise applications to customers worldwide, incorporating a browser-based Point-of-Sale (POS) application.
|
||||
</div>
|
||||
<div class="ps-3 mb-3" style="line-height: 1.5;">
|
||||
Odoo hereby declares that the POS application in the version
|
||||
<t t-esc="version"/> provides the following functions and controls:
|
||||
</div>
|
||||
<ol class="ps-5 py-1 mb-4">
|
||||
<li class="mb-2">Monitor cash register adjustments and easily verify cash contents at the end of the day</li>
|
||||
<li class="mb-2">Keep track of daily sales and totals for every payment type</li>
|
||||
<li class="mb-2">View all past orders as well as search by customer, product, cashier, or date</li>
|
||||
<li class="mb-2">Advertise your current promotions, hours of operation, and upcoming events on your printed receipts</li>
|
||||
<li class="mb-2">Set customer prices or offer percentage-based discounts on either a single product or the entire order</li>
|
||||
<li class="mb-2">Payments are directly integrated into Odoo Accounting, making bookkeeping simple and reliable</li>
|
||||
<li class="mb-2">Generate and print invoices for your business customers</li>
|
||||
<li class="mb-2">Cash, checks, and credit card payment methods are available. New types of payments can also be added</li>
|
||||
<li class="mb-2">Quickly find products by their name or barcode with the built-in search</li>
|
||||
<li class="mb-2">Register customers' VAT numbers and apply them to invoices</li>
|
||||
<li class="mb-2">Point-of-sale transactions cannot be tampered with through the application</li>
|
||||
</ol>
|
||||
<div class="ps-3 mb-4">Signed this day: <t t-esc="date"/></div>
|
||||
<div class="text-center mb-2">Odoo SA, BE0477472701</div>
|
||||
<div class="text-center">40 Chaussée de Namur, 1367 Grand-Rosière, Belgium</div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
<record id="report_compliance_letter" model="ir.actions.report">
|
||||
<field name="name">Compliance Letter</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">l10n_mt_pos.report_compliance_letter_template</field>
|
||||
<field name="report_file">l10n_mt_pos.report_compliance_letter_template</field>
|
||||
<field name="binding_model_id" ref="web.model_res_company"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="print_report_name">'Compliance Letter'</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_compliance_letter_user,compliance.letter user,model_compliance_letter_wizard,base.group_user,1,1,1,1
|
||||
access_compliance_letter_admin,compliance.letter admin,model_compliance_letter_wizard,base.group_system,1,1,1,1
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
from . import compliance_letter
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
from odoo import models, fields, release, _
|
||||
from datetime import datetime
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
class ComplianceLetter(models.TransientModel):
|
||||
_name = 'compliance.letter.wizard'
|
||||
_description = 'Compliance Letter for EXO Number'
|
||||
|
||||
company_id = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.company)
|
||||
|
||||
def generate_letter(self):
|
||||
if self.company_id.country_id.code != 'MT':
|
||||
raise UserError(_("Compliance letters can only be created for companies registered in Malta. Please ensure the company's country is set to Malta."))
|
||||
|
||||
data = {
|
||||
"version": self.get_odoo_version(),
|
||||
"date": self.get_formatted_date(),
|
||||
"name": self.company_id.name,
|
||||
"vat": self.company_id.vat,
|
||||
"address": self.company_id.partner_id.contact_address,
|
||||
}
|
||||
return self.env.ref('l10n_mt_pos.report_compliance_letter').report_action([], data=data)
|
||||
|
||||
def get_formatted_date(self):
|
||||
"""Returns the formatted date as 'Date (Month, xxth, 20XX)'."""
|
||||
date_obj = datetime.strptime(str(fields.Date.today()), '%Y-%m-%d')
|
||||
day = date_obj.day
|
||||
day_suffix = 'th' if 11 <= day <= 13 else {1: 'st', 2: 'nd', 3: 'rd'}.get(day % 10, 'th')
|
||||
formatted_date = date_obj.strftime(f"%B {day}{day_suffix}, %Y")
|
||||
return formatted_date
|
||||
|
||||
def get_odoo_version(self):
|
||||
return release.major_version
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<odoo>
|
||||
<record id="view_generate_compliance_letter" model="ir.ui.view">
|
||||
<field name="name">compliance.letter.wizard.form</field>
|
||||
<field name="model">compliance.letter.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Compliance Letter">
|
||||
<label string="Company" for="company_id"/>
|
||||
<field name="company_id"/>
|
||||
<footer>
|
||||
<button name="generate_letter" string="Print" type="object" class="btn-primary"/>
|
||||
<button string="Cancel" class="btn-secondary" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_generate_compliance_letter" model="ir.actions.act_window">
|
||||
<field name="name">Compliance Letter</field>
|
||||
<field name="res_model">compliance.letter.wizard</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<menuitem id="menu_compliance_letter" name="Compliance Letter"
|
||||
action="l10n_mt_pos.action_generate_compliance_letter"
|
||||
parent="point_of_sale.menu_point_rep" sequence="6"/>
|
||||
</odoo>
|
||||
42
odoo-bringout-oca-ocb-l10n_mt_pos/pyproject.toml
Normal file
42
odoo-bringout-oca-ocb-l10n_mt_pos/pyproject.toml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
[project]
|
||||
name = "odoo-bringout-oca-ocb-l10n_mt_pos"
|
||||
version = "16.0.0"
|
||||
description = "Malta - 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",
|
||||
"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_mt_pos"]
|
||||
|
||||
[tool.rye]
|
||||
managed = true
|
||||
dev-dependencies = [
|
||||
"pytest>=8.4.1",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue