Initial commit: L10N_Asia Pacific packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:52 +02:00
commit 54c86b612c
828 changed files with 58224 additions and 0 deletions

View file

@ -0,0 +1,47 @@
# Indian - Sale Report(GST)
GST Sale Report
## Installation
```bash
pip install odoo-bringout-oca-ocb-l10n_in_sale
```
## Dependencies
This addon depends on:
- l10n_in
- sale
## Manifest Information
- **Name**: Indian - Sale Report(GST)
- **Version**: 1.0
- **Category**: Accounting/Localizations/Sale
- **License**: LGPL-3
- **Installable**: True
## Source
Based on [OCA/OCB](https://github.com/OCA/OCB) branch 16.0, addon `l10n_in_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
- 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

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_in_sale Module - l10n_in_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.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for l10n_in_sale. 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_in](../../odoo-bringout-oca-ocb-l10n_in)
- [sale](../../odoo-bringout-oca-ocb-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_in_sale or install in UI.

View file

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

View file

@ -0,0 +1,12 @@
# Models
Detected core models and extensions in l10n_in_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.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: l10n_in_sale. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon l10n_in_sale
- 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_in_sale
```

View file

@ -0,0 +1,8 @@
# Wizards
Transient models exposed as UI wizards in l10n_in_sale.
```mermaid
classDiagram
class SaleAdvancePaymentInv
```

View file

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
from . import wizard

View file

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Indian - Sale Report(GST)',
'icon': '/l10n_in/static/description/icon.png',
'version': '1.0',
'description': """GST Sale Report""",
'category': 'Accounting/Localizations/Sale',
'depends': [
'l10n_in',
'sale',
],
'data': [
'views/report_sale_order.xml',
'views/sale_views.xml',
],
'demo': [
'data/product_demo.xml',
],
'installable': True,
'auto_install': True,
'license': 'LGPL-3',
}

View file

@ -0,0 +1,9 @@
<odoo>
<data noupdate="1">
<record id="sale.advance_product_0" model="product.product">
<field name="l10n_in_hsn_code">8303.00.00</field>
<field name="l10n_in_hsn_description">Armoured or reinforced safes, strong boxes and doors and safe deposit lockers for strong rooms, cash or deed boxes and the like, of base metal
</field>
</record>
</data>
</odoo>

View file

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import sale_order

View file

@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class SaleOrder(models.Model):
_inherit = "sale.order"
l10n_in_reseller_partner_id = fields.Many2one('res.partner',
string='Reseller', domain="[('vat', '!=', False), '|', ('company_id', '=', False), ('company_id', '=', company_id)]", readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]})
l10n_in_journal_id = fields.Many2one('account.journal', string="Journal", compute="_compute_l10n_in_journal_id", store=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]})
l10n_in_gst_treatment = fields.Selection([
('regular', 'Registered Business - Regular'),
('composition', 'Registered Business - Composition'),
('unregistered', 'Unregistered Business'),
('consumer', 'Consumer'),
('overseas', 'Overseas'),
('special_economic_zone', 'Special Economic Zone'),
('deemed_export', 'Deemed Export'),
('uin_holders', 'UIN Holders'),
], string="GST Treatment", readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, compute="_compute_l10n_in_gst_treatment", store=True)
@api.depends('partner_id')
def _compute_l10n_in_gst_treatment(self):
for order in self:
# set default value as False so CacheMiss error never occurs for this field.
order.l10n_in_gst_treatment = False
if order.country_code == 'IN':
l10n_in_gst_treatment = order.partner_id.l10n_in_gst_treatment
if not l10n_in_gst_treatment and order.partner_id.country_id and order.partner_id.country_id.code != 'IN':
l10n_in_gst_treatment = 'overseas'
if not l10n_in_gst_treatment:
l10n_in_gst_treatment = order.partner_id.vat and 'regular' or 'consumer'
order.l10n_in_gst_treatment = l10n_in_gst_treatment
@api.depends('company_id')
def _compute_l10n_in_journal_id(self):
for order in self:
if order._origin and order._origin.company_id == order.company_id and order.l10n_in_journal_id.company_id == order.company_id:
continue
# set default value as False so CacheMiss error never occurs for this field.
order.l10n_in_journal_id = False
if order.country_code == 'IN':
domain = [('company_id', '=', order.company_id.id), ('type', '=', 'sale')]
journal = self.env['account.journal'].search(domain, limit=1)
if journal:
order.l10n_in_journal_id = journal.id
def _prepare_invoice(self):
invoice_vals = super(SaleOrder, self)._prepare_invoice()
if self.country_code == 'IN':
invoice_vals['l10n_in_reseller_partner_id'] = self.l10n_in_reseller_partner_id.id
if self.l10n_in_journal_id:
invoice_vals['journal_id'] = self.l10n_in_journal_id.id
invoice_vals['l10n_in_gst_treatment'] = self.l10n_in_gst_treatment
return invoice_vals

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="gst_report_saleorder_document_inherit" inherit_id="sale.report_saleorder_document">
<xpath expr="//span[@t-field='line.name']" position="after">
<t t-if="line.product_id.l10n_in_hsn_code and line.company_id.account_fiscal_country_id.code == 'IN'">
<h6><strong class="ml16">HSN/SAC Code:</strong> <span t-field="line.product_id.l10n_in_hsn_code"/></h6>
</t>
</xpath>
</template>
</odoo>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_order_form_inherit_l10n_in_sale" model="ir.ui.view">
<field name="name">sale.order.form.inherit.l10n.in.sale</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="country_code" invisible="1"/>
<field name="l10n_in_reseller_partner_id" groups="l10n_in.group_l10n_in_reseller"
attrs="{'invisible': [('country_code','!=', 'IN')]}"/>
<field name="l10n_in_gst_treatment"
attrs="{'invisible':[('country_code','!=','IN')],'required':[('country_code','=','IN')]}"/>
</xpath>
<xpath expr="//group[@name='sale_info']//field[@name='invoice_status']" position="after">
<field name="l10n_in_journal_id" domain="[('company_id', '=', company_id), ('type','=','sale')]" options="{'no_create': True}" attrs="{'invisible': [('country_code','!=', 'IN')]}"/>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import sale_make_invoice_advance

View file

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class SaleAdvancePaymentInv(models.TransientModel):
_inherit = "sale.advance.payment.inv"
def _prepare_invoice_values(self, order, so_line):
res = super()._prepare_invoice_values(order, so_line)
if order.l10n_in_journal_id:
res['journal_id'] = order.l10n_in_journal_id.id
if order.country_code == 'IN':
res['l10n_in_gst_treatment'] = order.l10n_in_gst_treatment
if order.l10n_in_reseller_partner_id:
res['l10n_in_reseller_partner_id'] = order.l10n_in_reseller_partner_id
return res

View file

@ -0,0 +1,43 @@
[project]
name = "odoo-bringout-oca-ocb-l10n_in_sale"
version = "16.0.0"
description = "Indian - Sale Report(GST) - Odoo addon"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-l10n_in>=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_in_sale"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]