-
-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD REA fields to copany and compute company_registry accordingly
- Loading branch information
Showing
9 changed files
with
116 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,17 +28,24 @@ Italian localization - Registro REA | |
**Italiano** | ||
|
||
Questo modulo aggiunge al partner i campi relativi ai dati REA (Repertorio Economico Amministrativo). | ||
|
||
http://www.registroimprese.it/codice-fiscale-p.iva-rea | ||
|
||
I campi vengono aggiunti nella sezione contabile della scheda del partner, dove è possibile inserire i dati del Registro Imprese. | ||
|
||
I dati REA sono anche disponibili nella scheda dell'azienda. Valorizzandoli, il campo 'registro imprese' verrà calcolato di conseguenza. | ||
|
||
**English** | ||
|
||
This module implement fields of REA data in partner. | ||
|
||
http://www.registroimprese.it/codice-fiscale-p.iva-rea | ||
|
||
Fields are added on accounting page of partner form, where you can | ||
add data of business register. | ||
|
||
REA fields are also available in company form and, filling them, Company Registry will be computed accordingly. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
|
@@ -66,10 +73,10 @@ Authors | |
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Alessio Gerace <[email protected]> | ||
* Alessio Gerace | ||
* Nicola Malcontenti <[email protected]> | ||
* Lorenzo Battistini <lorenzo.battistini@agilebg.com> | ||
* Andrea Gallina <[email protected]> | ||
* Lorenzo Battistini <https://github.com/eLBati> | ||
* Andrea Gallina | ||
* Sergio Zanchetta <[email protected]> | ||
|
||
Maintainers | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
# 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 | ||
# Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
|
||
{ | ||
'name': 'Italian localization - Registro REA', | ||
'version': '11.0.1.0.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': 'https://github.com/OCA/l10n-italy/tree/11.0/l10n_it_rea', | ||
|
@@ -18,6 +19,7 @@ | |
], | ||
"data": [ | ||
'views/partner_view.xml', | ||
'views/company_view.xml', | ||
], | ||
'installable': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
|
||
from . import res_partner | ||
from . import res_company |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# 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') | ||
|
||
@api.onchange( | ||
"rea_office", "rea_code", "rea_capital", "rea_member_type", | ||
"rea_liquidation_state" | ||
) | ||
def onchange_rea_data(self): | ||
self.company_registry = '' | ||
rea_member_type = '' | ||
if ( | ||
self.rea_office or self.rea_code or self.rea_capital or | ||
self.rea_member_type or self.rea_liquidation_state | ||
): | ||
if self.rea_member_type: | ||
rea_member_type = dict( | ||
self.env['res.partner']._fields[ | ||
'rea_member_type' | ||
]._description_selection(self.env) | ||
)[self.rea_member_type] | ||
rea_liquidation_state = '' | ||
if self.rea_liquidation_state: | ||
rea_liquidation_state = dict( | ||
self.env['res.partner']._fields[ | ||
'rea_liquidation_state' | ||
]._description_selection(self.env) | ||
)[self.rea_liquidation_state] | ||
# using always €, as this is a registry of Italian companies | ||
company_registry = _("%s %s Share Cap. %s € %s %s") % ( | ||
self.rea_office.code or '', self.rea_code or '', | ||
formatLang(self.env, self.rea_capital), rea_member_type, | ||
rea_liquidation_state | ||
) | ||
self.company_registry = company_registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
* Alessio Gerace <[email protected]> | ||
* Alessio Gerace | ||
* Nicola Malcontenti <[email protected]> | ||
* Lorenzo Battistini <lorenzo.battistini@agilebg.com> | ||
* Andrea Gallina <[email protected]> | ||
* Lorenzo Battistini <https://github.com/eLBati> | ||
* Andrea Gallina | ||
* Sergio Zanchetta <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
**Italiano** | ||
|
||
Questo modulo aggiunge al partner i campi relativi ai dati REA (Repertorio Economico Amministrativo). | ||
|
||
http://www.registroimprese.it/codice-fiscale-p.iva-rea | ||
|
||
I campi vengono aggiunti nella sezione contabile della scheda del partner, dove è possibile inserire i dati del Registro Imprese. | ||
|
||
I dati REA sono anche disponibili nella scheda dell'azienda. Valorizzandoli, il campo 'registro imprese' verrà calcolato di conseguenza. | ||
|
||
**English** | ||
|
||
This module implement fields of REA data in partner. | ||
|
||
http://www.registroimprese.it/codice-fiscale-p.iva-rea | ||
|
||
Fields are added on accounting page of partner form, where you can | ||
add data of business register. | ||
|
||
REA fields are also available in company form and, filling them, Company Registry will be computed accordingly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record model="ir.ui.view" id="view_company_form_rea"> | ||
<field name="name">view_company_form_rea</field> | ||
<field name="model">res.company</field> | ||
<field name="inherit_id" ref="base.view_company_form"/> | ||
<field name="arch" type="xml"> | ||
<notebook position="inside"> | ||
<page string="REA data"> | ||
<group> | ||
<field name="rea_office" /> | ||
<field name="rea_code" /> | ||
<field name="rea_capital" /> | ||
<field name="rea_member_type" /> | ||
<field name="rea_liquidation_state"/> | ||
<field name="company_registry"/> | ||
</group> | ||
</page> | ||
</notebook> | ||
<field name="company_registry" position="replace"/> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters