Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • bce0406b59c24de0d2cda61d29125049e2d5ee15
  • 14.0 par défaut protégée
  • 14-RV-202503401
3 résultats

__manifest__.py

Blame
  • Bifurcation depuis Le Filament / Confédération Générale des SCOP / cgscop_cotisation
    Le projet source a une visibilité limitée.
    post-migration.py 916 o
    # © 2022 Le Filament (<http://www.le-filament.com>)
    # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
    
    from openupgradelib import openupgrade  # pylint: disable=W7936
    
    
    def get_years():
        year_list = []
        for i in range(2019, 2030):
            year_list.append((i, str(i)))
        return year_list
    
    
    def get_months():
        month_list = []
        for i in range(1, 13):
            month_list.append((i, str(i)))
        return month_list
    
    
    def ur_month_timesheet_map_values(env):
        openupgrade.map_values(
            env.cr,
            openupgrade.get_legacy_name("month"),
            "month",
            get_months(),
            table="ur_month_timesheet",
        )
        openupgrade.map_values(
            env.cr,
            openupgrade.get_legacy_name("year"),
            "year",
            get_years(),
            table="ur_month_timesheet",
        )
    
    
    @openupgrade.migrate()
    def migrate(env, version):
        ur_month_timesheet_map_values(env)