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 @@
# Ecuador - Stock
Ecuador - Stock
## Installation
```bash
pip install odoo-bringout-oca-ocb-l10n_ec_stock
```
## Dependencies
This addon depends on:
- l10n_ec
- stock
## Manifest Information
- **Name**: Ecuador - Stock
- **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_ec_stock`.
## 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_ec_stock Module - l10n_ec_stock
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_ec_stock. 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_ec](../../odoo-bringout-oca-ocb-l10n_ec)
- [stock](../../odoo-bringout-oca-ocb-stock)

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
from odoo import api, SUPERUSER_ID
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
companies = env['res.company'].search([('account_fiscal_country_id.code', '=', 'EC')])
env['account.chart.template']._l10n_ec_setup_location_accounts(companies)

View file

@ -0,0 +1,16 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Ecuador - Stock',
'icon': '/l10n_ec/static/description/icon.png',
'version': '1.0',
'description': """Ecuador - Stock""",
'category': 'Accounting/Localizations',
'depends': [
'l10n_ec',
'stock',
],
'auto_install': True,
'post_init_hook': 'post_init_hook',
'license': 'LGPL-3',
}

View file

@ -0,0 +1,3 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import account_chart_template

View file

@ -0,0 +1,28 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class AccountChartTemplate(models.Model):
_inherit = 'account.chart.template'
def _l10n_ec_setup_location_accounts(self, companies):
parent_location = self.env.ref('stock.stock_location_locations_virtual', raise_if_not_found=False)
loss_locs = parent_location and parent_location.child_ids.filtered(lambda l: l.usage == 'inventory' and l.company_id in companies and not l.scrap_location)
loss_loc_accounts = self._get_account_from_template(companies, self.env.ref('l10n_ec.ec510112', raise_if_not_found=False))
prod_locs = parent_location and parent_location.child_ids.filtered(lambda l: l.usage == 'production' and l.company_id in companies and not l.scrap_location)
prod_loc_accounts = self._get_account_from_template(companies, self.env.ref('l10n_ec.ec110302', raise_if_not_found=False))
for company in companies:
loss_loc = loss_locs.filtered(lambda l: l.company_id == company)
loss_loc_account = loss_loc_accounts.filtered(lambda l: l.company_id == company)
if loss_loc and loss_loc_account:
loss_loc.write({
'valuation_in_account_id': loss_loc_account.id,
'valuation_out_account_id': loss_loc_account.id,
})
prod_loc = prod_locs.filtered(lambda l: l.company_id == company)
prod_loc_account = prod_loc_accounts.filtered(lambda l: l.company_id == company)
if prod_loc and prod_loc_account:
prod_loc.write({
'valuation_in_account_id': prod_loc_account.id,
'valuation_out_account_id': prod_loc_account.id,
})

View file

@ -0,0 +1,43 @@
[project]
name = "odoo-bringout-oca-ocb-l10n_ec_stock"
version = "16.0.0"
description = "Ecuador - Stock - Odoo addon"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-l10n_ec>=16.0.0",
"odoo-bringout-oca-ocb-stock>=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_ec_stock"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]