Browse Source

[FIX] Mandatory field not displayed

Mandatory configuration approval field must be displayed now.

Same modifications as in f406155d5c
pull/107/head
Elouan Le Bars 5 years ago
parent
commit
6890cbc3b9
  1. 3
      beesdoo_easy_my_coop/__openerp__.py
  2. 9
      beesdoo_easy_my_coop/migrations/9.0.1.1.3/pre-migration.py
  3. 9
      beesdoo_easy_my_coop/models/res_company.py

3
beesdoo_easy_my_coop/__openerp__.py

@ -16,7 +16,7 @@
# Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml
# for the full list
'category': 'Cooperative management',
'version': '9.0.1.1.2',
'version': '9.0.1.1.3',
# any module necessary for this one to work correctly
'depends': ['beesdoo_base', 'beesdoo_shift', 'easy_my_coop', 'easy_my_coop_eater'],
@ -32,4 +32,3 @@
'auto_install': True,
# only loaded in demonstration mode
}

9
beesdoo_easy_my_coop/migrations/9.0.1.1.3/pre-migration.py

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
def migrate(cr, version):
if not version:
return
cr.execute("UPDATE res_company "
"SET info_session_confirmation_required = FALSE "
"WHERE display_info_session_confirmation = FALSE")

9
beesdoo_easy_my_coop/models/res_company.py

@ -25,3 +25,12 @@ class ResCompany(models.Model):
def onchange_info_session_confirmatio_required(self):
if self.info_session_confirmation_required:
self.display_info_session_confirmation = True
_sql_constraints = [(
'info_session_approval_constraint',
"""CHECK ((info_session_confirmation_required=FALSE
AND display_info_session_confirmation=FALSE)
OR display_info_session_confirmation=TRUE)
""",
"Approval can't be mandatory and not displayed."
)]
Loading…
Cancel
Save