Skip to content

Commit

Permalink
Merge PR #54 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
github-grap-bot committed Aug 4, 2024
2 parents 3bdf156 + a388dbc commit 1fcd008
Show file tree
Hide file tree
Showing 29 changed files with 1,252 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ repos:
rev: v0.1.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes]
- id: ruff-format
- repo: https://github.com/OCA/pylint-odoo
rev: v8.0.19
Expand Down
111 changes: 111 additions & 0 deletions fiscal_company_base/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
==========
CAE - Base
==========

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6e3a501ed3b5d79a9292fe440d5247e9d2be0fa43389eeb4cae6314324eec2a6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-grap%2Fodoo--addons--cae-lightgray.png?logo=github
:target: https://github.com/grap/odoo-addons-cae/tree/12.0/fiscal_company_base
:alt: grap/odoo-addons-cae

|badge1| |badge2| |badge3|

This module extend Odoo functionnalities, regarding companies features to
manage CAE (Coopearatives of Activities and Employment) that is a special
status for french companies.

(see above, links that describes what is CAE).

Basically, in a CAE, there is a 'parent' company that hosts many 'child'
companies. People in a child company should have access only to their activity.
(account moves, customers, suppliers, products, etc...)

In a fiscal and legal point of view, there is only one company (the parent one)
so there is only on chart of accounts. Accounting moves of the child
companies are written in the child company, but associated to the account of
the parent company.

**Companies feature**

* Add a new field on company `fiscal_type`:
* `normal` : classical company
* `fiscal_mother`: CAE company, that can host many child companies
* `fiscal_child`: child company, hosted by the CAE


**Users Feature**

* If a user has access rights to a 'fiscal_mother' so he has access
rights to all 'fiscal_child' companies;

**Groups Feature**

* this module add a new group 'Disabled Features for Fiscal Company'
that should be affected to all the features bad designed by odoo,
specially when odoo introduced views based on datas computed on SQL hard
coded requests that can not work with the Odoo CAE design.
See 'account_fiscal_company' module for exemples.

**More information about CAE [FR]**

* https://fr.wikipedia.org/wiki/Coopérative_d'activités_et_d'emploi
* http://www.cooperer.coop/
* http://www.copea.fr/

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/grap/odoo-addons-cae/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/grap/odoo-addons-cae/issues/new?body=module:%20fiscal_company_base%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* GRAP

Contributors
~~~~~~~~~~~~

* Julien WESTE
* Sylvain LE GAL <https://twitter.com/legalsylvain>

Other credits
~~~~~~~~~~~~~

The development of this module has been financially supported by:

* GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop)

Porting from odoo V8 to odoo V10 has been funded by :
* BABEL.COOP, leverage cooperation through the digital age (<http://babel.coop>)

Maintainers
~~~~~~~~~~~

This module is part of the `grap/odoo-addons-cae <https://github.com/grap/odoo-addons-cae/tree/12.0/fiscal_company_base>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions fiscal_company_base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
31 changes: 31 additions & 0 deletions fiscal_company_base/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (C) 2013-Today: GRAP (http://www.grap.coop)
# @author: Julien WESTE
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "CAE - Base",
"version": "16.0.1.0.0",
"category": "CAE",
"summary": "Manage CAE (Cooperatives of Activities and Employment)",
"author": "GRAP",
"website": "https://github.com/grap/odoo-addons-cae",
"license": "AGPL-3",
"depends": [
"base",
# Dependency added to have the possibility to create demo user,
# without "notification_type" error
"mail",
],
"data": [
# "security/ir_rule.xml",
"views/view_res_company.xml",
],
"demo": [
"demo/res_partner_company.xml",
"demo/res_partner_users.xml",
"demo/res_partner.xml",
"demo/res_groups.xml",
],
"installable": True,
}
16 changes: 16 additions & 0 deletions fiscal_company_base/demo/res_groups.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2015 - 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).
-->
<odoo>

<record id="base.group_multi_company" model="res.groups">
<field name="users" eval="[
(4, ref('user_accountant')),
(4, ref('base.user_admin')),
]"/>
</record>

</odoo>
15 changes: 15 additions & 0 deletions fiscal_company_base/demo/res_partner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2018-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).
-->

<odoo>

<record id="partner_mother" model="res.partner">
<field name="name">CAE - Mother Partner</field>
<field name="company_id" ref="company_fiscal_mother"/>
</record>

</odoo>
71 changes: 71 additions & 0 deletions fiscal_company_base/demo/res_partner_company.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- oca-hooks:disable=xml-duplicate-record-id -->
<!--
Copyright (C) 2015-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).
-->

<odoo>

<!-- Create Main Group company and partner associated -->
<record model="res.partner" id="partner_group">
<field name="name">Group Company</field>
<field name="company_id" eval="False"/>
<field name="is_company" eval="True"/>
</record>

<record model="res.company" id="company_group">
<field name="name">Group Company</field>
<field name="partner_id" ref="partner_group"/>
<field name="fiscal_type">group</field>
</record>

<!-- Set Group as the parent of the default demo company -->
<record model="res.company" id="base.main_company">
<field name="parent_id" ref="company_group" />
</record>

<!-- Create fiscal mother company and partner associated -->
<record model="res.partner" id="partner_fiscal_mother">
<field name="name">Your Mother Company</field>
<field name="company_id" eval="False"/>
<field name="is_company" eval="True"/>
</record>

<record model="res.company" id="company_fiscal_mother">
<field name="name">Your Mother Company</field>
<field name="partner_id" ref="partner_fiscal_mother"/>
<field name="fiscal_type">fiscal_mother</field>
<field name="parent_id" ref="company_group" />
</record>

<!-- Create fiscal child company 1 and partner associated -->
<record model="res.partner" id="partner_fiscal_child_1">
<field name="name">Your Child Company 1 (Service)</field>
<field name="company_id" eval="False"/>
<field name="is_company" eval="True"/>
</record>

<record model="res.company" id="company_fiscal_child_1">
<field name="name">Your Child Company 1 (Service)</field>
<field name="partner_id" ref="partner_fiscal_child_1"/>
<field name="parent_id" ref="company_fiscal_mother" />
<field name="fiscal_type">fiscal_child</field>
</record>

<!-- Create fiscal child company 2 and partner associated -->
<record model="res.partner" id="partner_fiscal_child_2">
<field name="name">Your Child Company 2 (Production)</field>
<field name="company_id" eval="False"/>
<field name="is_company" eval="True"/>
</record>

<record model="res.company" id="company_fiscal_child_2">
<field name="name">Your Child Company 2 (Production)</field>
<field name="partner_id" ref="partner_fiscal_child_2"/>
<field name="parent_id" ref="company_fiscal_mother" />
<field name="fiscal_type">fiscal_child</field>
</record>

</odoo>
53 changes: 53 additions & 0 deletions fiscal_company_base/demo/res_partner_users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2015-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).
-->

<odoo>

<record model="res.users" id="base.user_admin">
<field name="company_ids" eval="[
(4, ref('base.main_company')),
(4, ref('company_fiscal_mother')),
(4, ref('company_fiscal_child_1')),
(4, ref('company_fiscal_child_2')),
]"/>
</record>

<!-- Create user associated to all companies and partner associated -->
<record model="res.partner" id="partner_accountant">
<field name="name">Accountant User</field>
<field name="email">[email protected]</field>
</record>

<record model="res.users" id="user_accountant">
<field name="partner_id" ref="partner_accountant"/>
<field name="login">accountant</field>
<field name="password">demo</field>
<field name="company_id" ref="company_fiscal_mother"/>
<field name="company_ids" eval="[
(4, ref('company_fiscal_mother')),
(4, ref('company_fiscal_child_1')),
(4, ref('company_fiscal_child_2')),
]"/>
</record>

<!-- Create user associated to company 2 and partner associated -->
<record model="res.partner" id="partner_worker">
<field name="name">Worker User</field>
<field name="email">[email protected]</field>
</record>

<record model="res.users" id="user_worker">
<field name="partner_id" ref="partner_worker"/>
<field name="login">worker</field>
<field name="password">demo</field>
<field name="company_id" ref="company_fiscal_child_1"/>
<field name="company_ids" eval="[
(4, ref('company_fiscal_child_1')),
]"/>
</record>

</odoo>
Loading

0 comments on commit 1fcd008

Please sign in to comment.