Skip to content

Commit

Permalink
FIX REA fields order
Browse files Browse the repository at this point in the history
ADD REA fields to copany and compute company_registry accordingly
  • Loading branch information
eLBati committed Oct 16, 2018
1 parent dc62acc commit 6d05261
Show file tree
Hide file tree
Showing 12 changed files with 602 additions and 49 deletions.
76 changes: 52 additions & 24 deletions l10n_it_rea/README.rst
Original file line number Diff line number Diff line change
@@ -1,54 +1,82 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License

============
REA Register
============

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-OCA%2Fl10n--italy-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-italy/tree/10.0/l10n_it_rea
:alt: OCA/l10n-italy
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-italy-10-0/l10n-italy-10-0-l10n_it_rea
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/122/10.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

The module implement fields of REA data in partner
http://www.registroimprese.it/il-registro-imprese-e-altre-banche-dati#page=registro-imprese
http://www.registroimprese.it/
The module adds fields in page Accounting of partner form, where you can
add data of registry of businesses

Usage
=====
REA fields are also available in company form and, filling them, Company Registry will be computed accordingly

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/122/10.0
**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/l10n-italy/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_rea%0Aversion:%2010.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
~~~~~~~

* Agile Business Group
* Odoo Italia Network

Contributors
------------
~~~~~~~~~~~~

* Alessio Gerace <[email protected]>
* Alessio Gerace
* Nicola Malcontenti <[email protected]>
* Lorenzo Battistini <[email protected]>
* Andrea Gallina <[email protected]>
* Lorenzo Battistini <https://github.com/eLBati>
* Andrea Gallina

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

Maintainer
----------
This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/10.0/l10n_it_rea>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 1 addition & 3 deletions l10n_it_rea/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright 2014 Associazione Odoo Italia (<http://www.odoo-italia.org>)
# Copyright 2015 Alessio Gerace <[email protected]>
# Copyright 2016 Andrea Gallina (Apulia Software)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
9 changes: 6 additions & 3 deletions l10n_it_rea/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
# Copyright 2014 Associazione Odoo Italia (<http://www.odoo-italia.org>)
# Copyright 2015 Alessio Gerace <[email protected]>
# Copyright 2016 Andrea Gallina (Apulia Software)
# Copyright 2018 Lorenzo Battistini
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
'name': 'REA Register',
'version': '10.0.1.0.0',
'version': '10.0.1.1.0',
'category': 'Localisation/Italy',
'summary': 'Manage fields for Economic Administrative catalogue',
'summary': 'Manage fields for Economic Administrative catalogue',
'author': 'Agile Business Group, Odoo Italia Network,'
'Odoo Community Association (OCA)',
'website': 'http://www.agilebg.com',
'website': 'https://github.com/OCA/l10n-italy/',
'license': 'AGPL-3',
"depends": [
'account'
],
"data": [
'views/partner_view.xml',
'views/company_view.xml',
],
'installable': True,
}
35 changes: 24 additions & 11 deletions l10n_it_rea/i18n/it.po
Original file line number Diff line number Diff line change
@@ -1,42 +1,52 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_it_rea
# * l10n_it_rea
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: l10n-italy (10.0)\n"
"Project-Id-Version: Odoo Server 10.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-12 02:39+0000\n"
"PO-Revision-Date: 2016-10-19 16:37+0000\n"
"Last-Translator: OCA Transbot <[email protected]>\n"
"Language-Team: Italian (http://www.transifex.com/oca/OCA-l10n-italy-10-0/"
"language/it/)\n"
"Language: it\n"
"POT-Creation-Date: 2018-10-16 13:02+0000\n"
"PO-Revision-Date: 2018-10-16 13:02+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: nplurals=2; plural=(n != 1);\n"
"Plural-Forms: \n"

#. module: l10n_it_rea
#: code:addons/l10n_it_rea/models/res_company.py:49
#, python-format
msgid "%s %s Share Cap. %s%s %s %s"
msgstr "%s %s Cap. Soc. %s%s %s %s"

#. module: l10n_it_rea
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_company_rea_capital
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_partner_rea_capital
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_users_rea_capital
msgid "Capital"
msgstr "Capitale Sociale"

#. module: l10n_it_rea
#: model:ir.model,name:l10n_it_rea.model_res_company
msgid "Companies"
msgstr "Aziende"

#. module: l10n_it_rea
#: selection:res.partner,rea_liquidation_state:0
msgid "In liquidation"
msgstr "In liquidazione"

#. module: l10n_it_rea
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_company_rea_liquidation_state
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_partner_rea_liquidation_state
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_users_rea_liquidation_state
msgid "Liquidation State"
msgstr "Stato di liquidazione"

#. module: l10n_it_rea
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_company_rea_member_type
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_partner_rea_member_type
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_users_rea_member_type
msgid "Member Type"
Expand All @@ -53,6 +63,7 @@ msgid "Not in liquidation"
msgstr "Non in liquidazione"

#. module: l10n_it_rea
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_company_rea_office
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_partner_rea_office
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_users_rea_office
msgid "Office Province"
Expand All @@ -64,6 +75,7 @@ msgid "Partner"
msgstr "Partner"

#. module: l10n_it_rea
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_company_rea_code
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_partner_rea_code
#: model:ir.model.fields,field_description:l10n_it_rea.field_res_users_rea_code
msgid "REA Code"
Expand All @@ -83,3 +95,4 @@ msgstr "Il codice REA è unico per ogni Azieda !"
#: selection:res.partner,rea_member_type:0
msgid "Unique Member"
msgstr "Socio unico"

5 changes: 2 additions & 3 deletions l10n_it_rea/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2014 Associazione Odoo Italia (<http://www.odoo-italia.org>)
# Copyright 2015 Alessio Gerace <[email protected]>
# Copyright 2016 Andrea Gallina (Apulia Software)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import res_partner
from . import res_company
55 changes: 55 additions & 0 deletions l10n_it_rea/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models, api, _
from odoo.tools.misc import formatLang


class Company(models.Model):
_inherit = 'res.company'

rea_office = fields.Many2one(
'res.country.state', string='Office Province',
related='partner_id.rea_office')
rea_code = fields.Char('REA Code', size=20, related='partner_id.rea_code')
rea_capital = fields.Float('Capital', related='partner_id.rea_capital')
rea_member_type = fields.Selection(
[('SU', 'Unique Member'),
('SM', 'Multiple Members')], 'Member Type',
related='partner_id.rea_member_type')
rea_liquidation_state = fields.Selection(
[('LS', 'In liquidation'),
('LN', 'Not in liquidation')], 'Liquidation State',
related='partner_id.rea_liquidation_state')
company_registry = fields.Char(
"Company Registry", compute="_compute_company_registry", store=True)

@api.depends(
"partner_id.rea_office", "partner_id.rea_code",
"partner_id.rea_capital", "partner_id.rea_member_type",
"partner_id.rea_liquidation_state"
)
@api.multi
def _compute_company_registry(self):
for company in self:
rea_member_type = ''
if company.rea_member_type:
rea_member_type = dict(
self.env['res.partner']._fields[
'rea_member_type'
]._description_selection(self.env)
)[company.rea_member_type]
rea_liquidation_state = ''
if company.rea_liquidation_state:
rea_liquidation_state = dict(
self.env['res.partner']._fields[
'rea_liquidation_state'
]._description_selection(self.env)
)[company.rea_liquidation_state]
company_registry = _("%s %s Share Cap. %s%s %s %s") % (
company.rea_office.code or '', company.rea_code or '',
company.currency_id.symbol,
formatLang(self.env, company.rea_capital), rea_member_type,
rea_liquidation_state
)
company.company_registry = company_registry
4 changes: 1 addition & 3 deletions l10n_it_rea/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2014 Associazione Odoo Italia (<http://www.odoo-italia.org>)
# Copyright 2015 Alessio Gerace <[email protected]>
# Copyright 2016 Andrea Gallina (Apulia Software)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models

Expand Down
4 changes: 4 additions & 0 deletions l10n_it_rea/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* Alessio Gerace
* Nicola Malcontenti <[email protected]>
* Lorenzo Battistini <https://github.com/eLBati>
* Andrea Gallina
6 changes: 6 additions & 0 deletions l10n_it_rea/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The module implement fields of REA data in partner
http://www.registroimprese.it/
The module adds fields in page Accounting of partner form, where you can
add data of registry of businesses

REA fields are also available in company form and, filling them, Company Registry will be computed accordingly
Loading

0 comments on commit 6d05261

Please sign in to comment.