Skip to content

Commit

Permalink
[FIX] national number settings
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-champonnois committed Jul 12, 2024
1 parent 7eec21c commit f81ff91
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 18 deletions.
5 changes: 4 additions & 1 deletion l10n_be_cooperator_national_number/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"category": "Cooperative management",
"website": "https://github.com/OCA/cooperative",
"license": "AGPL-3",
"data": ["views/subscription_request_view.xml", "views/res_company_view.xml"],
"data": [
"views/subscription_request_view.xml",
"views/res_config_settings.xml",
],
"demo": [],
}
1 change: 1 addition & 0 deletions l10n_be_cooperator_national_number/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

from . import subscription_request
from . import res_company
from . import res_config_settings
from . import res_partner
12 changes: 12 additions & 0 deletions l10n_be_cooperator_national_number/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

display_national_number = fields.Boolean(
related="company_id.display_national_number", readonly=False
)
require_national_number = fields.Boolean(
related="company_id.require_national_number", readonly=False
)
17 changes: 0 additions & 17 deletions l10n_be_cooperator_national_number/views/res_company_view.xml

This file was deleted.

53 changes: 53 additions & 0 deletions l10n_be_cooperator_national_number/views/res_config_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="res_config_settings_cooperator_view_form" model="ir.ui.view">
<field name="name">Cooperators national number</field>
<field name="model">res.config.settings</field>
<field
name="inherit_id"
ref="cooperator.res_config_settings_cooperator_view_form"
/>
<field name="arch" type="xml">
<xpath
expr="//field[@name='subscription_maximum_amount']/../../.."
position="after"
>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<span class="o_form_label">
National Number
</span>
<div class="text-muted">
Add a national number field on share subscription
</div>
<div class="mt16">
<div class="content-group" id="send_default">
<div>
<field name="display_national_number" />
<label
for="display_national_number"
string="Display"
class="col-2 o_light_label"
/>
</div>
<div
attrs="{'invisible': [('display_national_number', '=', False)]}"
>
<field name="require_national_number" />
<label
for="require_national_number"
string="Require"
class="col-2 o_light_label"
/>
</div>
</div>
</div>
</div>
</div>

</xpath>
</field>
</record>
</odoo>

0 comments on commit f81ff91

Please sign in to comment.