Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

14.0 edi fixes #221

Merged
merged 2 commits into from
Sep 1, 2024
Merged

Conversation

antoniospneto
Copy link

Ao tentar atualizar uma cópia da base de produção estava dando erro:

2024-08-31 23:05:41,331 1 INFO devel odoo.addons.base.models.ir_model: Deleting [email protected] (l10n_br_fiscal.selection__l10n_br_fiscal_document_electronic__state_fiscal__mr) 
2024-08-31 23:05:41,337 1 WARNING devel odoo.modules.loading: Transient module states were reset 
2024-08-31 23:05:41,337 1 ERROR devel odoo.modules.registry: Failed to load registry 
Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 89, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 505, in load_modules
    env['ir.model.data']._process_end(processed_modules)
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_model.py", line 2328, in _process_end
    self._process_end_unlink_record(record)
  File "/opt/odoo/auto/addons/website/models/ir_model_data.py", line 36, in _process_end_unlink_record
    return super()._process_end_unlink_record(record)
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_model.py", line 2251, in _process_end_unlink_record
    record.unlink()
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_model.py", line 1390, in unlink
    self._process_ondelete()
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_model.py", line 1428, in _process_ondelete
    Model = self.env[selection.field_id.model]
  File "/opt/odoo/custom/src/odoo/odoo/api.py", line 489, in getitem
    return self.registry[model_name]._browse(self, (), ())
  File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 177, in getitem
    return self.models[model_name]
KeyError: 'l10n_br_fiscal.document.electronic'

Por algum motivo o odoo não tava conseguiindo lidar bem com essa cara:

raname field

Para resolver isso, adicionei no script de migração uma instrução para forçar apagar esse ir.model.fields diretamente no banco de dados.

Já aproveitei e apaguei o campo status_description que tava aparecendo na visão fora do lugar.

Testei com uma cópia da produção e tá tudo funcionando bem, emissão, carta de correção, cancelamento e inutilização. Os dados antigos estão sendo exibidos corretamente.

@github-grap-bot
Copy link

Hi @renatonlima, @mileo, @rvalyi,
some modules you are maintaining are being modified, check this out!

Copy link

codecov bot commented Sep 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (14.0-fiscal-edi-add@df945ba). Learn more about missing BASE report.

Additional details and impacted files
@@                  Coverage Diff                   @@
##             14.0-fiscal-edi-add     #221   +/-   ##
======================================================
  Coverage                       ?   89.50%           
======================================================
  Files                          ?      736           
  Lines                          ?    28912           
  Branches                       ?     3199           
======================================================
  Hits                           ?    25879           
  Misses                         ?     2142           
  Partials                       ?      891           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rvalyi rvalyi merged commit 668a655 into akretion:14.0-fiscal-edi-add Sep 1, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants