mirror of
https://github.com/bringout/oca-ocb-l10n_asia-pacific.git
synced 2026-04-27 20:42:02 +02:00
Initial commit: L10N_Asia Pacific packages
This commit is contained in:
commit
54c86b612c
828 changed files with 58224 additions and 0 deletions
52
odoo-bringout-oca-ocb-l10n_in_sale_stock/README.md
Normal file
52
odoo-bringout-oca-ocb-l10n_in_sale_stock/README.md
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# India Sales and Warehouse Management
|
||||
|
||||
|
||||
Define default sales journal on the warehouse,
|
||||
help you to choose correct sales journal on the sales order when
|
||||
you change the warehouse.
|
||||
useful when you setup the multiple GSTIN units.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-ocb-l10n_in_sale_stock
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
This addon depends on:
|
||||
- l10n_in_sale
|
||||
- l10n_in_stock
|
||||
|
||||
## Manifest Information
|
||||
|
||||
- **Name**: India Sales and Warehouse Management
|
||||
- **Version**: 0.1
|
||||
- **Category**: Accounting/Localizations/Sale
|
||||
- **License**: LGPL-3
|
||||
- **Installable**: False
|
||||
|
||||
## Source
|
||||
|
||||
Based on [OCA/OCB](https://github.com/OCA/OCB) branch 16.0, addon `l10n_in_sale_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
|
||||
- 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_in_sale_stock/doc/ARCHITECTURE.md
Normal file
32
odoo-bringout-oca-ocb-l10n_in_sale_stock/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_in_sale_stock Module - l10n_in_sale_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.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Configuration
|
||||
|
||||
Refer to Odoo settings for l10n_in_sale_stock. Configure related models, access rights, and options as needed.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Controllers
|
||||
|
||||
This module does not define custom HTTP controllers.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# Dependencies
|
||||
|
||||
This addon depends on:
|
||||
|
||||
- [l10n_in_sale](../../odoo-bringout-oca-ocb-l10n_in_sale)
|
||||
- [l10n_in_stock](../../odoo-bringout-oca-ocb-l10n_in_stock)
|
||||
4
odoo-bringout-oca-ocb-l10n_in_sale_stock/doc/FAQ.md
Normal file
4
odoo-bringout-oca-ocb-l10n_in_sale_stock/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_in_sale_stock or install in UI.
|
||||
7
odoo-bringout-oca-ocb-l10n_in_sale_stock/doc/INSTALL.md
Normal file
7
odoo-bringout-oca-ocb-l10n_in_sale_stock/doc/INSTALL.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Install
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-ocb-l10n_in_sale_stock"
|
||||
# or
|
||||
uv pip install odoo-bringout-oca-ocb-l10n_in_sale_stock"
|
||||
```
|
||||
14
odoo-bringout-oca-ocb-l10n_in_sale_stock/doc/MODELS.md
Normal file
14
odoo-bringout-oca-ocb-l10n_in_sale_stock/doc/MODELS.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Models
|
||||
|
||||
Detected core models and extensions in l10n_in_sale_stock.
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
class account_move
|
||||
class sale_order
|
||||
class stock_warehouse
|
||||
```
|
||||
|
||||
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_in_sale_stock/doc/OVERVIEW.md
Normal file
6
odoo-bringout-oca-ocb-l10n_in_sale_stock/doc/OVERVIEW.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Overview
|
||||
|
||||
Packaged Odoo addon: l10n_in_sale_stock. Provides features documented in upstream Odoo 16 under this addon.
|
||||
|
||||
- Source: OCA/OCB 16.0, addon l10n_in_sale_stock
|
||||
- License: LGPL-3
|
||||
3
odoo-bringout-oca-ocb-l10n_in_sale_stock/doc/REPORTS.md
Normal file
3
odoo-bringout-oca-ocb-l10n_in_sale_stock/doc/REPORTS.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Reports
|
||||
|
||||
This module does not define custom reports.
|
||||
8
odoo-bringout-oca-ocb-l10n_in_sale_stock/doc/SECURITY.md
Normal file
8
odoo-bringout-oca-ocb-l10n_in_sale_stock/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_in_sale_stock/doc/USAGE.md
Normal file
7
odoo-bringout-oca-ocb-l10n_in_sale_stock/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_in_sale_stock
|
||||
```
|
||||
3
odoo-bringout-oca-ocb-l10n_in_sale_stock/doc/WIZARDS.md
Normal file
3
odoo-bringout-oca-ocb-l10n_in_sale_stock/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,30 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
{
|
||||
'name': "India Sales and Warehouse Management",
|
||||
'icon': '/l10n_in/static/description/icon.png',
|
||||
|
||||
'summary': """
|
||||
Define default sales journal on the warehouse""",
|
||||
|
||||
'description': """
|
||||
Define default sales journal on the warehouse,
|
||||
help you to choose correct sales journal on the sales order when
|
||||
you change the warehouse.
|
||||
useful when you setup the multiple GSTIN units.
|
||||
""",
|
||||
|
||||
'author': "Odoo",
|
||||
'website': "https://www.odoo.com",
|
||||
'category': 'Accounting/Localizations/Sale',
|
||||
'version': '0.1',
|
||||
|
||||
'depends': ['l10n_in_sale', 'l10n_in_stock'],
|
||||
|
||||
'data': [
|
||||
'views/stock_warehouse_views.xml',
|
||||
],
|
||||
'auto_install': True,
|
||||
'license': 'LGPL-3',
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import sale_order
|
||||
from . import stock_warehouse
|
||||
from . import account_move
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = "account.move"
|
||||
|
||||
def _l10n_in_get_warehouse_address(self):
|
||||
res = super()._l10n_in_get_warehouse_address()
|
||||
if self.invoice_line_ids.sale_line_ids:
|
||||
company_shipping_id = self.mapped("invoice_line_ids.sale_line_ids.order_id.warehouse_id.partner_id")
|
||||
if len(company_shipping_id) == 1:
|
||||
return company_shipping_id
|
||||
return res
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
_inherit = "sale.order"
|
||||
|
||||
@api.depends('company_id', 'warehouse_id')
|
||||
def _compute_l10n_in_journal_id(self):
|
||||
super()._compute_l10n_in_journal_id()
|
||||
for order in self:
|
||||
if order.country_code == 'IN':
|
||||
if order.warehouse_id.l10n_in_sale_journal_id:
|
||||
order.l10n_in_journal_id = order.warehouse_id.l10n_in_sale_journal_id.id
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class Stock(models.Model):
|
||||
_inherit = 'stock.warehouse'
|
||||
|
||||
l10n_in_sale_journal_id = fields.Many2one('account.journal', string="Sale Journal")
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_stock_warehouse_inherit_l10n_in_stock" model="ir.ui.view">
|
||||
<field name="name">stock.warehouse.form.inherit.l10n.in.stock</field>
|
||||
<field name="model">stock.warehouse</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='partner_id']" position="after">
|
||||
<field name="l10n_in_sale_journal_id" domain="[('company_id', '=', company_id), ('type','=','sale')]" options="{'no_create': True}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
44
odoo-bringout-oca-ocb-l10n_in_sale_stock/pyproject.toml
Normal file
44
odoo-bringout-oca-ocb-l10n_in_sale_stock/pyproject.toml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
[project]
|
||||
name = "odoo-bringout-oca-ocb-l10n_in_sale_stock"
|
||||
version = "16.0.0"
|
||||
description = "India Sales and Warehouse Management -
|
||||
Define default sales journal on the warehouse"
|
||||
authors = [
|
||||
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
|
||||
]
|
||||
dependencies = [
|
||||
"odoo-bringout-oca-ocb-l10n_in_sale>=16.0.0",
|
||||
"odoo-bringout-oca-ocb-l10n_in_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_in_sale_stock"]
|
||||
|
||||
[tool.rye]
|
||||
managed = true
|
||||
dev-dependencies = [
|
||||
"pytest>=8.4.1",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue