Initial commit: L10N_Americas packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:52 +02:00
commit 12b27ce151
714 changed files with 79328 additions and 0 deletions

View file

@ -0,0 +1,45 @@
# Colombian - Point of Sale
Colombian - Point of Sale
## Installation
```bash
pip install odoo-bringout-oca-ocb-l10n_co_pos
```
## Dependencies
This addon depends on:
- l10n_co
- point_of_sale
## Manifest Information
- **Name**: Colombian - 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_co_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_co_pos Module - l10n_co_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_co_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_co](../../odoo-bringout-oca-ocb-l10n_co)
- [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_co_pos or install in UI.

View file

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

View file

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

View file

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

View file

@ -0,0 +1 @@
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': 'Colombian - Point of Sale',
'icon': '/l10n_co/static/description/icon.png',
'version': '1.0',
'description': """Colombian - Point of Sale""",
'category': 'Accounting/Localizations/Point of Sale',
'auto_install': True,
'depends': [
'l10n_co',
'point_of_sale'
],
'data': [
'views/res_config_settings_views.xml'
],
'assets': {
'point_of_sale.assets': [
'l10n_co_pos/static/src/js/**/*',
'l10n_co_pos/static/src/xml/**/*',
],
},
'license': 'LGPL-3',
}

View file

@ -0,0 +1 @@
from . import pos_order

View file

@ -0,0 +1,11 @@
from odoo import models
class PosOrder(models.Model):
_inherit = "pos.order"
def _prepare_invoice_vals(self):
move_vals = super()._prepare_invoice_vals()
if "l10n_co_edi_description_code_credit" in self.env["account.move"] and move_vals.get("move_type") == "out_refund" and move_vals.get("reversed_entry_id"):
move_vals["l10n_co_edi_description_code_credit"] = move_vals.get("l10n_co_edi_description_code_credit", "1")
return move_vals

View file

@ -0,0 +1,31 @@
odoo.define('l10n_co_pos.PaymentScreen', function(require) {
'use strict';
const PaymentScreen = require('point_of_sale.PaymentScreen');
const Registries = require('point_of_sale.Registries');
const session = require('web.session');
const L10nCoPosPaymentScreen = PaymentScreen =>
class extends PaymentScreen {
async _postPushOrderResolve(order, order_server_ids) {
try {
if (this.env.pos.is_colombian_country()) {
const result = await this.rpc({
model: 'pos.order',
method: 'search_read',
domain: [['id', 'in', order_server_ids]],
fields: ['name'],
context: session.user_context,
});
order.set_l10n_co_dian(result[0].name || false);
}
} finally {
return super._postPushOrderResolve(...arguments);
}
}
};
Registries.Component.extend(PaymentScreen, L10nCoPosPaymentScreen);
return PaymentScreen;
});

View file

@ -0,0 +1,34 @@
odoo.define('l10n_co_pos.pos', function (require) {
"use strict";
var { PosGlobalState, Order } = require('point_of_sale.models');
const Registries = require('point_of_sale.Registries');
const L10nCoPosGlobalState = (PosGlobalState) => class L10nCoPosGlobalState extends PosGlobalState {
is_colombian_country() {
return this.company.country.code === 'CO';
}
}
Registries.Model.extend(PosGlobalState, L10nCoPosGlobalState);
const L10nCoPosOrder = (Order) => class L10nCoPosOrder extends Order {
export_for_printing() {
var result = super.export_for_printing(...arguments);
result.l10n_co_dian = this.get_l10n_co_dian();
return result;
}
set_l10n_co_dian(l10n_co_dian) {
this.l10n_co_dian = l10n_co_dian;
}
get_l10n_co_dian() {
return this.l10n_co_dian;
}
wait_for_push_order() {
var result = super.wait_for_push_order(...arguments);
result = Boolean(result || this.pos.is_colombian_country());
return result;
}
}
Registries.Model.extend(Order, L10nCoPosOrder);
});

View file

@ -0,0 +1,11 @@
<?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('pos-receipt-order-data')]" position="inside">
<t t-if="receipt.l10n_co_dian !== false">
<div style="word-wrap:break-word;"><t t-esc="receipt.l10n_co_dian"/></div>
</t>
</xpath>
</t>
</templates>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.l10n_co_pos</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="point_of_sale.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='order_reference']" position="attributes">
<attribute name="groups"></attribute>
</xpath>
<xpath expr="//field[@name='pos_sequence_id']" position="attributes">
<attribute name="readonly">0</attribute>
</xpath>
</field>
</record>
</odoo>

View file

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