forked from Yaltik/golem
[MIG][IMP]GOLEM Season migration to v10, and better guidelines
This commit is contained in:
parent
8efabe7ec8
commit
48c081d16f
@ -23,7 +23,7 @@
|
||||
'author': 'Fabien Bourgeois',
|
||||
'license': 'AGPL-3',
|
||||
'application': False,
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
'depends': ['golem_base'],
|
||||
'data': ['security/ir.model.access.csv', 'views/golem_season_view.xml']
|
||||
'data': ['security/ir.model.access.csv', 'views/golem_season_views.xml']
|
||||
}
|
||||
|
@ -4,10 +4,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 8.0\n"
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-07-13 15:46+0000\n"
|
||||
"PO-Revision-Date: 2016-07-13 15:46+0000\n"
|
||||
"POT-Creation-Date: 2017-05-01 14:19+0000\n"
|
||||
"PO-Revision-Date: 2017-05-01 14:19+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -17,48 +17,53 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,member_counter:0
|
||||
#: sql_constraint:golem.season:0
|
||||
msgid "Ce nom pour la saison a déjà été utilisé. Merci d'en choisir un autre."
|
||||
msgstr "Ce nom pour la saison a déjà été utilisé. Merci d'en choisir un autre."
|
||||
|
||||
#. module: golem_season
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_member_counter
|
||||
msgid "Counter for member number generation"
|
||||
msgstr "Compteur pour la génération des numéros d'adhérents"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,create_uid:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Créé par"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,create_date:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_create_date
|
||||
msgid "Created on"
|
||||
msgstr "Créé le"
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:53
|
||||
#: code:addons/golem_season/models/golem_season.py:56
|
||||
#, python-format
|
||||
msgid "Current period cannot be included into another existing period."
|
||||
msgstr "La période actuelle est en conflit avec une période existante."
|
||||
|
||||
#. module: golem_season
|
||||
#: view:golem.season:golem_season.filter
|
||||
#: model:ir.ui.view,arch_db:golem_season.filter
|
||||
msgid "Default season"
|
||||
msgstr "Saison par défaut"
|
||||
|
||||
#. module: golem_season
|
||||
#: view:golem.season:golem_season.form
|
||||
#: model:ir.ui.view,arch_db:golem_season.golem_season_view_form
|
||||
msgid "Default season for views ?"
|
||||
msgstr "Saison affichée par défaut dans toutes les listes ?"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,is_default:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_is_default
|
||||
msgid "Default season for views?"
|
||||
msgstr "Saison affichée par défaut partout?"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,display_name:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nom affiché"
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:51
|
||||
#: code:addons/golem_season/models/golem_season.py:52
|
||||
#, python-format
|
||||
msgid "End of the period is in range of an existing period."
|
||||
msgstr "La fin de la période est en conflit avec une période existante."
|
||||
@ -69,77 +74,76 @@ msgid "GOLEM Season"
|
||||
msgstr "Saison"
|
||||
|
||||
#. module: golem_season
|
||||
#: model:ir.actions.act_window,name:golem_season.action_list
|
||||
#: model:ir.ui.menu,name:golem_season.menu_seasons
|
||||
#: model:ir.actions.act_window,name:golem_season.golem_season_action
|
||||
#: model:ir.ui.menu,name:golem_season.golem_season_menu
|
||||
msgid "GOLEM Seasons"
|
||||
msgstr "Saisons"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,id:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,__last_update:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season___last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Dernière modification le"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,write_uid:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Dernière modification par"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,write_date:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Dernière modification le"
|
||||
|
||||
#. module: golem_season
|
||||
#: view:golem.season:golem_season.form
|
||||
#: model:ir.ui.view,arch_db:golem_season.golem_season_view_form
|
||||
msgid "Make this season as default"
|
||||
msgstr "Activer cette saison par défaut"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,date_end:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_date_end
|
||||
msgid "Period end"
|
||||
msgstr "Fin de la période"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,date_start:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_date_start
|
||||
msgid "Period start"
|
||||
msgstr "Début de la période"
|
||||
|
||||
#. module: golem_season
|
||||
#: view:golem.season:golem_season.form
|
||||
#: model:ir.ui.view,arch_db:golem_season.golem_season_view_form
|
||||
msgid "Season"
|
||||
msgstr "Saison"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,name:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_name
|
||||
msgid "Season name"
|
||||
msgstr "Nom de la saison"
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:41
|
||||
#: code:addons/golem_season/models/golem_season.py:42
|
||||
#, python-format
|
||||
msgid "Start of the period cannot be after end of the period."
|
||||
msgstr "Le début de la période ne peut être postérieur à sa fin."
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:47
|
||||
#: code:addons/golem_season/models/golem_season.py:48
|
||||
#, python-format
|
||||
msgid "Start of the period is in range of an existing period."
|
||||
msgstr "Le début de la période est en conflit avec une période existante."
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:27
|
||||
#: sql_constraint:golem.season:0
|
||||
#: code:addons/golem_season/models/golem_season.py:28
|
||||
#, python-format
|
||||
msgid "This season name has already been used."
|
||||
msgstr "Ce nom pour la saison a déjà été utilisé. Merci d'en choisir un autre."
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:89
|
||||
#: code:addons/golem_season/models/golem_season.py:92
|
||||
#, python-format
|
||||
msgid "You can't delete the default season"
|
||||
msgstr "Vous ne pouvez pas supprimer la saison par défaut"
|
||||
|
@ -4,10 +4,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 8.0\n"
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-07-13 15:46+0000\n"
|
||||
"PO-Revision-Date: 2016-07-13 15:46+0000\n"
|
||||
"POT-Creation-Date: 2017-05-01 14:18+0000\n"
|
||||
"PO-Revision-Date: 2017-05-01 14:18+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -16,48 +16,53 @@ msgstr ""
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,member_counter:0
|
||||
#: sql_constraint:golem.season:0
|
||||
msgid "Ce nom pour la saison a déjà été utilisé. Merci d'en choisir un autre."
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_member_counter
|
||||
msgid "Counter for member number generation"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,create_uid:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,create_date:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:55
|
||||
#: code:addons/golem_season/models/golem_season.py:56
|
||||
#, python-format
|
||||
msgid "Current period cannot be included into another existing period."
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: view:golem.season:golem_season.filter
|
||||
#: model:ir.ui.view,arch_db:golem_season.filter
|
||||
msgid "Default season"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: view:golem.season:golem_season.form
|
||||
#: model:ir.ui.view,arch_db:golem_season.golem_season_view_form
|
||||
msgid "Default season for views ?"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,is_default:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_is_default
|
||||
msgid "Default season for views?"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,display_name:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:51
|
||||
#: code:addons/golem_season/models/golem_season.py:52
|
||||
#, python-format
|
||||
msgid "End of the period is in range of an existing period."
|
||||
msgstr ""
|
||||
@ -68,77 +73,76 @@ msgid "GOLEM Season"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: model:ir.actions.act_window,name:golem_season.action_list
|
||||
#: model:ir.ui.menu,name:golem_season.menu_seasons
|
||||
#: model:ir.actions.act_window,name:golem_season.golem_season_action
|
||||
#: model:ir.ui.menu,name:golem_season.golem_season_menu
|
||||
msgid "GOLEM Seasons"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,id:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,__last_update:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season___last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,write_uid:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,write_date:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: view:golem.season:golem_season.form
|
||||
#: model:ir.ui.view,arch_db:golem_season.golem_season_view_form
|
||||
msgid "Make this season as default"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,date_end:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_date_end
|
||||
msgid "Period end"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,date_start:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_date_start
|
||||
msgid "Period start"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: view:golem.season:golem_season.form
|
||||
#: model:ir.ui.view,arch_db:golem_season.golem_season_view_form
|
||||
msgid "Season"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: field:golem.season,name:0
|
||||
#: model:ir.model.fields,field_description:golem_season.field_golem_season_name
|
||||
msgid "Season name"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:41
|
||||
#: code:addons/golem_season/models/golem_season.py:42
|
||||
#, python-format
|
||||
msgid "Start of the period cannot be after end of the period."
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:47
|
||||
#: code:addons/golem_season/models/golem_season.py:48
|
||||
#, python-format
|
||||
msgid "Start of the period is in range of an existing period."
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:27
|
||||
#: sql_constraint:golem.season:0
|
||||
#: code:addons/golem_season/models/golem_season.py:28
|
||||
#, python-format
|
||||
msgid "This season name has already been used."
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_season
|
||||
#: code:addons/golem_season/models/golem_season.py:89
|
||||
#: code:addons/golem_season/models/golem_season.py:92
|
||||
#, python-format
|
||||
msgid "You can't delete the default season"
|
||||
msgstr ""
|
||||
|
@ -15,8 +15,9 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
""" GOLEM Season management """
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
|
||||
class GolemSeason(models.Model):
|
||||
""" GOLEM Season """
|
||||
@ -26,7 +27,7 @@ class GolemSeason(models.Model):
|
||||
_sql_constraints = [('golem_season_name_uniq', 'UNIQUE (name)',
|
||||
_('This season name has already been used.'))]
|
||||
|
||||
name = fields.Char('Season name')
|
||||
name = fields.Char('Season name', copy=False)
|
||||
member_counter = fields.Integer('Counter for member number generation',
|
||||
readonly=True, default=0)
|
||||
date_start = fields.Date('Period start')
|
||||
@ -42,27 +43,28 @@ class GolemSeason(models.Model):
|
||||
'after end of the period.'))
|
||||
else:
|
||||
seasons = self.env['golem.season'].search([])
|
||||
for s in seasons:
|
||||
if s.date_start < season.date_start < s.date_end:
|
||||
for eachs in seasons:
|
||||
if eachs.date_start < season.date_start < eachs.date_end:
|
||||
msg = _(u'Start of the period is in range of an '
|
||||
'existing period.')
|
||||
raise models.ValidationError(msg)
|
||||
if s.date_start < season.date_end < s.date_end:
|
||||
if eachs.date_start < season.date_end < eachs.date_end:
|
||||
msg = _(u'End of the period is in range of an '
|
||||
'existing period.')
|
||||
raise models.ValidationError(msg)
|
||||
if season.date_start < s.date_start < season.date_end:
|
||||
if season.date_start < eachs.date_start < season.date_end:
|
||||
msg = _(u'Current period cannot be included into '
|
||||
'another existing period.')
|
||||
raise models.ValidationError(msg)
|
||||
|
||||
is_default = fields.Boolean('Default season for views?', readonly=True)
|
||||
|
||||
@api.one
|
||||
@api.multi
|
||||
def do_default_season(self):
|
||||
""" is_default on and ensure that only one is_default is active. Also
|
||||
recomputes is_current for members and activities. For simplicity use a
|
||||
magic trick around registry rather than double inheritance """
|
||||
self.ensure_one()
|
||||
old_default_season = self.search([('is_default', '=', True)])
|
||||
if old_default_season:
|
||||
old_default_season.is_default = False
|
||||
@ -85,8 +87,8 @@ class GolemSeason(models.Model):
|
||||
@api.multi
|
||||
def unlink(self):
|
||||
""" Forbids default season removal """
|
||||
for s in self:
|
||||
if s.is_default:
|
||||
for season in self:
|
||||
if season.is_default:
|
||||
emsg = _('You can\'t delete the default season')
|
||||
raise models.ValidationError(emsg)
|
||||
else:
|
||||
|
@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<data>
|
||||
|
||||
<!-- Forms -->
|
||||
<record id="form" model="ir.ui.view">
|
||||
<record id="golem_season_view_form" model="ir.ui.view">
|
||||
<field name="name">GOLEM Season Form</field>
|
||||
<field name="model">golem.season</field>
|
||||
<field name="arch" type="xml">
|
||||
@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
</record>
|
||||
|
||||
<!-- Trees -->
|
||||
<record id="tree" model="ir.ui.view">
|
||||
<record id="golem_season_view_tree" model="ir.ui.view">
|
||||
<field name="name">GOLEM Seasons</field>
|
||||
<field name="model">golem.season</field>
|
||||
<field name="arch" type="xml">
|
||||
@ -72,12 +72,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
</record>
|
||||
|
||||
<!-- Actions -->
|
||||
<act_window id="action_list" name="GOLEM Seasons"
|
||||
<act_window id="golem_season_action" name="GOLEM Seasons"
|
||||
res_model="golem.season" view_mode="tree,form" />
|
||||
|
||||
<!-- Menus -->
|
||||
<menuitem id="menu_seasons" name="GOLEM Seasons"
|
||||
parent="base.menu_marketing_config_association" sequence="2"
|
||||
action="action_list" groups="golem_base.group_golem_manager" />
|
||||
<menuitem id="golem_season_menu" name="GOLEM Seasons"
|
||||
parent="membership.menu_marketing_config_association" sequence="5"
|
||||
action="golem_season_action" groups="golem_base.group_golem_manager" />
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
Loading…
Reference in New Issue
Block a user