OCA / l10n-switzerland

Odoo Swiss localization
GNU Affero General Public License v3.0
53 stars 163 forks source link

[12.0][MIG] Migrate l10n_ch_fds_postfinance #545

Closed philhug closed 4 years ago

philhug commented 4 years ago

where can I see the runbot logs? I get a 404 when trying to access them

yvaucher commented 4 years ago

@philhug runbot gives a failing state even if it runs but has warnings

It is worth it to avoid unnecessary warnings as those could generate lots of lines in your logs thus bloating your kibana or other tool. Looking at travis logs I think you need to fix those warnings to get a green runbot:

2020-04-23 11:32:43,603 5838 WARNING openerp_test odoo.models: The model fds.authentication.keys has no _description
2020-04-23 11:32:43,604 5838 WARNING openerp_test odoo.models: The model fds.postfinance.account has no _description
2020-04-23 11:32:43,604 5838 WARNING openerp_test odoo.models: The model fds.postfinance.file has no _description
2020-04-23 11:32:43,604 5838 WARNING openerp_test odoo.models: The model fds.postfinance.directory has no _description
2020-04-23 11:32:43,605 5838 WARNING openerp_test odoo.models: The model fds.files.import.tobankstatments.wizard has no _description
2020-04-23 11:32:43,605 5838 WARNING openerp_test odoo.models: The model fds.key.clone.wizard has no _description
2020-04-23 11:32:43,606 5838 WARNING openerp_test odoo.models: The model fds.key.generator.wizard has no _description
2020-04-23 11:32:43,845 5838 INFO openerp_test odoo.modules.registry: module l10n_ch_fds_postfinance: creating or updating database tables
2020-04-23 11:32:44,001 5838 WARNING openerp_test odoo.addons.base.models.ir_model: Two fields (public_key_import_file, public_key_import_txt) of fds.key.import.wizard() have the same label: Public key.
2020-04-23 11:32:44,001 5838 WARNING openerp_test odoo.addons.base.models.ir_model: Two fields (private_key_import_file, private_key_import_txt) of fds.key.import.wizard() have the same label: Private key.
2020-04-23 11:32:44,087 5838 INFO openerp_test odoo.modules.loading: loading l10n_ch_fds_postfinance/data/import_files_cron.xml
2020-04-23 11:32:44,106 5838 INFO openerp_test odoo.modules.loading: loading l10n_ch_fds_postfinance/views/fds_authentication_keys_view.xml
2020-04-23 11:32:44,128 5838 INFO openerp_test odoo.modules.loading: loading l10n_ch_fds_postfinance/views/fds_files_import_tobankstatments_wizard_view.xml
2020-04-23 11:32:44,164 5838 INFO openerp_test odoo.modules.loading: loading l10n_ch_fds_postfinance/views/fds_key_clone_wizard_view.xml
2020-04-23 11:32:44,182 5838 INFO openerp_test odoo.modules.loading: loading l10n_ch_fds_postfinance/views/fds_key_generator_wizard_view.xml
2020-04-23 11:32:44,201 5838 INFO openerp_test odoo.modules.loading: loading l10n_ch_fds_postfinance/views/fds_key_import_wizard_view.xml
2020-04-23 11:32:44,222 5838 INFO openerp_test odoo.modules.loading: loading l10n_ch_fds_postfinance/views/fds_postfinance_account_view.xml
2020-04-23 11:32:44,276 5838 INFO openerp_test odoo.modules.loading: loading l10n_ch_fds_postfinance/views/fds_postfinance_file_view.xml
2020-04-23 11:32:44,342 5838 WARNING openerp_test odoo.models: ir.actions.server.create() with unknown fields: key2, value
2020-04-23 11:32:44,357 5838 WARNING openerp_test odoo.models: ir.actions.server.create() with unknown fields: key2, value
2020-04-23 11:32:44,373 5838 WARNING openerp_test odoo.models: ir.actions.server.create() with unknown fields: key2, value
vvrossem commented 4 years ago

Hi @philhug :) Thank your for this PR! I'm trying to install the module for testing purposes on a database created with Language:French (CH) and Country:Switzerland.

Unfortunately, the following error is raised when loading the fr_CH.po (and is not if database is created with French or English as language):

(...)
2020-10-21 15:24:13,426 128743 INFO twelve-l10n_ch_fds_postfinance odoo.addons.base.models.ir_translation: module l10n_ch_fds_postfinance: loading translation file (fr_CH) for language fr_CH 
2020-10-21 15:24:13,426 128743 INFO twelve-l10n_ch_fds_postfinance odoo.tools.translate: loading /home/vincent/twelve-odoo/oca/l10n-switzerland/l10n_ch_fds_postfinance/i18n/fr_CH.po 
2020-10-21 15:24:13,445 128743 ERROR twelve-l10n_ch_fds_postfinance odoo.sql_db: bad query:  INSERT INTO ir_translation(name, lang, res_id, src, type, value, module, state, comments)
                           SELECT name, lang, res_id, src, type, value, module, state, comments
                           FROM tmp_ir_translation_import
                           WHERE type = 'model'
                           AND noupdate IS NOT TRUE
                           ON CONFLICT (type, lang, name, res_id) WHERE type = 'model'
                            DO UPDATE SET (name, lang, res_id, src, type, value, module, state, comments) = (EXCLUDED.name, EXCLUDED.lang, EXCLUDED.res_id, EXCLUDED.src, EXCLUDED.type, EXCLUDED.value, EXCLUDED.module, EXCLUDED.state, EXCLUDED.comments)
                            WHERE EXCLUDED.value IS NOT NULL AND EXCLUDED.value != '';

ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
HINT:  Ensure that no rows proposed for insertion within the same command have duplicate constrained values.

From what I'm reading here, it could be that a word is translated twice in .po file. I've looked the into the fr_CH.po and I haven't found any. For a reason I cannot explain yet, the following msgid should not be translated to prevent raising the error:

yvaucher commented 4 years ago

Closed in favor of #570