[FIX]GOLEM Member : fix number manual and make it required on form

This commit is contained in:
Fabien BOURGEOIS 2018-07-17 12:34:40 +02:00
parent 2f297f4db0
commit 601971cd92
3 changed files with 5 additions and 4 deletions

View File

@ -20,7 +20,7 @@
'name': 'GOLEM non-profit members', 'name': 'GOLEM non-profit members',
'summary': 'Extends Odoo contacts for MJC', 'summary': 'Extends Odoo contacts for MJC',
'description': 'Extends Odoo contacts for MJC', 'description': 'Extends Odoo contacts for MJC',
'version': '10.0.1.2.0', 'version': '10.0.1.2.1',
'category': 'GOLEM', 'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne', 'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3', 'license': 'AGPL-3',

View File

@ -134,7 +134,7 @@ class GolemMember(models.Model):
def _compute_is_number_manual(self): def _compute_is_number_manual(self):
conf = self.env['ir.config_parameter'] conf = self.env['ir.config_parameter']
is_num_man = (conf.get_param('golem_numberconfig_isautomatic') == '0') is_num_man = (conf.get_param('golem_numberconfig_isautomatic') == '0')
self.write({'is_number_manual': is_num_man}) self.update({'is_number_manual': is_num_man})
@api.multi @api.multi
def generate_number_perseason(self): def generate_number_perseason(self):

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2017 Fabien Bourgeois <fabien@yaltik.com> Copyright 2017-2018 Fabien Bourgeois <fabien@yaltik.com>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by it under the terms of the GNU Affero General Public License as published by
@ -52,7 +52,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="number" readonly="True" <field name="number" readonly="True"
attrs="{'invisible': [('is_number_manual', '=', True)]}" /> attrs="{'invisible': [('is_number_manual', '=', True)]}" />
<field name="number_manual" <field name="number_manual"
attrs="{'invisible': [('is_number_manual', '=', False)]}" /> attrs="{'invisible': [('is_number_manual', '=', False)],
'required': [('is_number_manual', '=', True)]}" />
</group> </group>
<group> <group>
<field name="gender" /> <field name="gender" />