Skip to content

Commit

Permalink
[MIG] transifex_push: Migration to 17.0
Browse files Browse the repository at this point in the history
closes #141

Signed-off-by: Juan José Scarafía <jjs@adhoc.com.ar>
  • Loading branch information
jjscarafia committed Nov 23, 2023
1 parent 8ab8493 commit 56e1974
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions transifex_push/__init__.py
Expand Up @@ -9,10 +9,9 @@
_logger = logging.getLogger(__name__)


def post_init(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
def post_init(env):
tx_data = ast.literal_eval(os.getenv('tx_data', '[]'))
for api_key, organization_slug, project_slug, modules_names in tx_data:
_logger.info('Pushing transifex translations for project %s-%s', organization_slug, project_slug)
modules = env['ir.module.module'].search([('name', 'in', modules_names),('state','=', 'installed')])
modules = env['ir.module.module'].search([('name', 'in', modules_names), ('state','=', 'installed')])
env['base.language.export']._transifex_push(modules, api_key, organization_slug, project_slug)
4 changes: 2 additions & 2 deletions transifex_push/__manifest__.py
Expand Up @@ -5,7 +5,7 @@
'author': "ADHOC SA",
'website': "http://runbot.odoo.com",
'category': 'Website',
'version': "16.0.1.0.0",
'version': "17.0.1.0.0",
'depends': [
'base',
'web',
Expand All @@ -15,5 +15,5 @@
'wizard/base_export_language_views.xml',
],
'post_init_hook': 'post_init',
'installable': False,
'installable': True,
}
10 changes: 5 additions & 5 deletions transifex_push/wizard/base_export_language_views.xml
Expand Up @@ -5,13 +5,13 @@
<field name="model">base.language.export</field>
<field name="inherit_id" ref="base.wizard_lang_export"/>
<field name="arch" type="xml">
<group states="choose">
<field name="api_key" attrs="{'invisible': [('format', '!=', 'po')]}"/>
<field name="organization_slug" attrs="{'invisible': [('format', '!=', 'po')]}"/>
<field name="project_slug" attrs="{'invisible': [('format', '!=', 'po')]}"/>
<group invisible="state != 'choose'">
<field name="api_key" invisible="format != 'po'"/>
<field name="organization_slug" invisible="format != 'po'"/>
<field name="project_slug" invisible="format != 'po'"/>
</group>
<button name="act_getfile" position="after">
<button name="action_transifex_push" string="Push To Transifex" type="object"/>
<button name="action_transifex_push" invisible="state != 'choose'" string="Push To Transifex" type="object"/>
</button>
</field>
</record>
Expand Down

0 comments on commit 56e1974

Please sign in to comment.