mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-27 16:42:00 +02:00
Initial commit: L10N_Europe packages
This commit is contained in:
commit
9803722600
2377 changed files with 380711 additions and 0 deletions
45
odoo-bringout-oca-ocb-l10n_fi_sale/README.md
Normal file
45
odoo-bringout-oca-ocb-l10n_fi_sale/README.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# Finland - Sale
|
||||
|
||||
Finland Sale
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-ocb-l10n_fi_sale
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
This addon depends on:
|
||||
- l10n_fi
|
||||
- sale
|
||||
|
||||
## Manifest Information
|
||||
|
||||
- **Name**: Finland - Sale
|
||||
- **Version**: 1.0
|
||||
- **Category**: Localization
|
||||
- **License**: LGPL-3
|
||||
- **Installable**: True
|
||||
|
||||
## Source
|
||||
|
||||
Based on [OCA/OCB](https://github.com/OCA/OCB) branch 16.0, addon `l10n_fi_sale`.
|
||||
|
||||
## 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
|
||||
32
odoo-bringout-oca-ocb-l10n_fi_sale/doc/ARCHITECTURE.md
Normal file
32
odoo-bringout-oca-ocb-l10n_fi_sale/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_fi_sale Module - l10n_fi_sale
|
||||
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_fi_sale/doc/CONFIGURATION.md
Normal file
3
odoo-bringout-oca-ocb-l10n_fi_sale/doc/CONFIGURATION.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Configuration
|
||||
|
||||
Refer to Odoo settings for l10n_fi_sale. Configure related models, access rights, and options as needed.
|
||||
3
odoo-bringout-oca-ocb-l10n_fi_sale/doc/CONTROLLERS.md
Normal file
3
odoo-bringout-oca-ocb-l10n_fi_sale/doc/CONTROLLERS.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Controllers
|
||||
|
||||
This module does not define custom HTTP controllers.
|
||||
6
odoo-bringout-oca-ocb-l10n_fi_sale/doc/DEPENDENCIES.md
Normal file
6
odoo-bringout-oca-ocb-l10n_fi_sale/doc/DEPENDENCIES.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Dependencies
|
||||
|
||||
This addon depends on:
|
||||
|
||||
- [l10n_fi](../../odoo-bringout-oca-ocb-l10n_fi)
|
||||
- [sale](../../odoo-bringout-oca-ocb-sale)
|
||||
4
odoo-bringout-oca-ocb-l10n_fi_sale/doc/FAQ.md
Normal file
4
odoo-bringout-oca-ocb-l10n_fi_sale/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_fi_sale or install in UI.
|
||||
7
odoo-bringout-oca-ocb-l10n_fi_sale/doc/INSTALL.md
Normal file
7
odoo-bringout-oca-ocb-l10n_fi_sale/doc/INSTALL.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Install
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-ocb-l10n_fi_sale"
|
||||
# or
|
||||
uv pip install odoo-bringout-oca-ocb-l10n_fi_sale"
|
||||
```
|
||||
12
odoo-bringout-oca-ocb-l10n_fi_sale/doc/MODELS.md
Normal file
12
odoo-bringout-oca-ocb-l10n_fi_sale/doc/MODELS.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Models
|
||||
|
||||
Detected core models and extensions in l10n_fi_sale.
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
class sale_order
|
||||
```
|
||||
|
||||
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_fi_sale/doc/OVERVIEW.md
Normal file
6
odoo-bringout-oca-ocb-l10n_fi_sale/doc/OVERVIEW.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Overview
|
||||
|
||||
Packaged Odoo addon: l10n_fi_sale. Provides features documented in upstream Odoo 16 under this addon.
|
||||
|
||||
- Source: OCA/OCB 16.0, addon l10n_fi_sale
|
||||
- License: LGPL-3
|
||||
3
odoo-bringout-oca-ocb-l10n_fi_sale/doc/REPORTS.md
Normal file
3
odoo-bringout-oca-ocb-l10n_fi_sale/doc/REPORTS.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Reports
|
||||
|
||||
This module does not define custom reports.
|
||||
8
odoo-bringout-oca-ocb-l10n_fi_sale/doc/SECURITY.md
Normal file
8
odoo-bringout-oca-ocb-l10n_fi_sale/doc/SECURITY.md
Normal 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
|
||||
|
|
@ -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_fi_sale/doc/USAGE.md
Normal file
7
odoo-bringout-oca-ocb-l10n_fi_sale/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_fi_sale
|
||||
```
|
||||
3
odoo-bringout-oca-ocb-l10n_fi_sale/doc/WIZARDS.md
Normal file
3
odoo-bringout-oca-ocb-l10n_fi_sale/doc/WIZARDS.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Wizards
|
||||
|
||||
This module does not include UI wizards.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#-*- coding:utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import models
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
{
|
||||
'name': 'Finland - Sale',
|
||||
'version': '1.0',
|
||||
'description': """Finland Sale""",
|
||||
'category': 'Localization',
|
||||
'depends': [
|
||||
'l10n_fi',
|
||||
'sale',
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
'license': 'LGPL-3',
|
||||
}
|
||||
27
odoo-bringout-oca-ocb-l10n_fi_sale/l10n_fi_sale/i18n/fi.po
Normal file
27
odoo-bringout-oca-ocb-l10n_fi_sale/l10n_fi_sale/i18n/fi.po
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * l10n_fi_sale
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 13.0+e\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-04-04 12:50+0000\n"
|
||||
"PO-Revision-Date: 2022-04-04 12:50+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: l10n_fi_sale
|
||||
#: code:addons/l10n_fi_sale/models/sale.py:0
|
||||
#, python-format
|
||||
msgid "Reference must contain numeric characters"
|
||||
msgstr "Viitteen tulee sisältää numeerisia merkkejä"
|
||||
|
||||
#. module: l10n_fi_sale
|
||||
#: model:ir.model,name:l10n_fi_sale.model_sale_order
|
||||
msgid "Sales Order"
|
||||
msgstr "Myyntitilaus"
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * l10n_fi_sale
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 13.0+e\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-04-04 12:50+0000\n"
|
||||
"PO-Revision-Date: 2022-04-04 12:50+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: l10n_fi_sale
|
||||
#: code:addons/l10n_fi_sale/models/sale.py:0
|
||||
#, python-format
|
||||
msgid "Reference must contain numeric characters"
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_fi_sale
|
||||
#: model:ir.model,name:l10n_fi_sale.model_sale_order
|
||||
msgid "Sales Order"
|
||||
msgstr ""
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# -*- coding:utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import sale
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
from odoo import api, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
_inherit = "sale.order"
|
||||
|
||||
def write(self, values):
|
||||
# We compute the l10n_fi/SaleOrder.reference from itself the same way
|
||||
# we compute the l10n_fi/AccountMove.invoice_payment_ref from its name.
|
||||
reference = values.get('reference', False)
|
||||
if reference:
|
||||
values['reference'] = self.compute_payment_reference_finnish(reference)
|
||||
return super().write(values)
|
||||
|
||||
@api.model
|
||||
def number2numeric(self, number):
|
||||
so_number = re.sub(r'\D', '', number)
|
||||
if so_number == '' or so_number is False:
|
||||
raise UserError(_('Reference must contain numeric characters'))
|
||||
|
||||
# Make sure the base number is 3...19 characters long
|
||||
if len(so_number) < 3:
|
||||
so_number = ('11' + so_number)[-3:]
|
||||
elif len(so_number) > 19:
|
||||
so_number = so_number[:19]
|
||||
|
||||
return so_number
|
||||
|
||||
@api.model
|
||||
def get_finnish_check_digit(self, base_number):
|
||||
# Multiply digits from end to beginning with 7, 3 and 1 and
|
||||
# calculate the sum of the products
|
||||
total = sum((7, 3, 1)[idx % 3] * int(val) for idx, val in
|
||||
enumerate(base_number[::-1]))
|
||||
# Subtract the sum from the next decade. 10 = 0
|
||||
return str((10 - (total % 10)) % 10)
|
||||
|
||||
@api.model
|
||||
def compute_payment_reference_finnish(self, number):
|
||||
# Drop all non-numeric characters
|
||||
so_number = self.number2numeric(number)
|
||||
# Calculate the Finnish check digit
|
||||
check_digit = self.get_finnish_check_digit(so_number)
|
||||
return so_number + check_digit
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 615 B |
43
odoo-bringout-oca-ocb-l10n_fi_sale/pyproject.toml
Normal file
43
odoo-bringout-oca-ocb-l10n_fi_sale/pyproject.toml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
[project]
|
||||
name = "odoo-bringout-oca-ocb-l10n_fi_sale"
|
||||
version = "16.0.0"
|
||||
description = "Finland - Sale - Odoo addon"
|
||||
authors = [
|
||||
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
|
||||
]
|
||||
dependencies = [
|
||||
"odoo-bringout-oca-ocb-l10n_fi>=16.0.0",
|
||||
"odoo-bringout-oca-ocb-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_fi_sale"]
|
||||
|
||||
[tool.rye]
|
||||
managed = true
|
||||
dev-dependencies = [
|
||||
"pytest>=8.4.1",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue