Skip to content

Commit

Permalink
[ADD] fiscal_company_l10n_fr_siret: new module to propagate siren fields
Browse files Browse the repository at this point in the history
  • Loading branch information
legalsylvain committed Dec 16, 2024
1 parent 253af6a commit e8e05e3
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 0 deletions.
Empty file.
1 change: 1 addition & 0 deletions fiscal_company_l10n_fr_siret/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions fiscal_company_l10n_fr_siret/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (C) 2024-Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "CAE - L10n French SIRET",
"version": "16.0.1.1.0",
"category": "CAE",
"summary": "Glue Module between CAE and L10 French SIRET modules",
"author": "GRAP",
"website": "https://github.com/grap/odoo-addons-cae",
"license": "AGPL-3",
"depends": ["fiscal_company_base", "l10n_fr_siret"],
"installable": True,
"auto_install": True,
}
Empty file.
1 change: 1 addition & 0 deletions fiscal_company_l10n_fr_siret/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_company
14 changes: 14 additions & 0 deletions fiscal_company_l10n_fr_siret/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2024-Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import models


class ResCompany(models.Model):
_inherit = "res.company"

def _get_fiscal_propagated_fields(self):
res = super()._get_fiscal_propagated_fields()
res += ["siren"]
return res
9 changes: 9 additions & 0 deletions fiscal_company_l10n_fr_siret/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This module extend Odoo functionnalities, regarding companies features to
manage CAE (Coopearatives of Activities and Employment) that is a special
status for french companies.

This module is a glue module for the Odoo L10n french SIRET module.

**Features**

* propagate SIREN value from CAE companies on fiscal child companies.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions fiscal_company_l10n_fr_siret/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_module
23 changes: 23 additions & 0 deletions fiscal_company_l10n_fr_siret/tests/test_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
# @author Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo.addons.fiscal_company_base.tests.test_abstract import TestAbstract


class TestFiscalCompanyPropagatedFields(TestAbstract):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.correct_siren = "123456782"

def test_propagated_fields_group(self):
self.group_company.siren = self.correct_siren
self.assertEqual(self.mother_company.siren, False)
self.assertEqual(self.child_company.siren, False)

def test_propagated_fields_fiscal_mother(self):
self.mother_company.siren = self.correct_siren
self.assertEqual(self.group_company.siren, False)
self.assertEqual(self.mother_company.siren, self.correct_siren)
self.assertEqual(self.child_company.siren, self.correct_siren)

0 comments on commit e8e05e3

Please sign in to comment.