OCA / l10n-brazil

Localização brasileira oficial do Odoo.
https://odoo-community.org/psc-teams/brazil-66
GNU Affero General Public License v3.0
241 stars 244 forks source link

Ao criar um PDV o novo PDV gera erro ao criar a NFC-e #3401

Closed kcarriello closed 1 month ago

kcarriello commented 1 month ago

Module

The name of the module that has a bug.

Describe the bug

Ao criar um PDV o novo PDV gera erro ao criar a NFC-e, o PDV antigo funciona normalmente

To Reproduce

Affected versions: 14

Steps to reproduce the behavior:

  1. cria um novo PDV
  2. atualizar tapela de impostos do POS
  3. entra no novo PDV e fazer uma venda emitindo NFC-e

Expected behavior NFC-e gerada e autorizada

Additional context este é o erro:

Odoo Server Error Traceback (most recent call last): File "/opt/odoo/atiboo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch result = request.dispatch() File "/opt/odoo/atiboo/odoo/http.py", line 696, in dispatch result = self._call_function(self.params) File "/opt/odoo/atiboo/odoo/http.py", line 370, in _call_function return checked_call(self.db, *args, *kwargs) File "/opt/odoo/atiboo/odoo/service/model.py", line 94, in wrapper return f(dbname, args, kwargs) File "/opt/odoo/atiboo/odoo/http.py", line 358, in checked_call result = self.endpoint(*a, kw) File "/opt/odoo/atiboo/odoo/http.py", line 919, in call return self.method(*args, *kw) File "/opt/odoo/atiboo/odoo/http.py", line 544, in response_wrap response = f(args, kw) File "/opt/odoo/atiboo/addons/web/controllers/main.py", line 1370, in call_kw return self._call_kw(model, method, args, kwargs) File "/opt/odoo/atiboo/addons/web/controllers/main.py", line 1362, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/opt/odoo/atiboo/odoo/api.py", line 402, in call_kw result = _call_kw_model(method, model, args, kwargs) File "/opt/odoo/atiboo/odoo/api.py", line 373, in _call_kw_model result = method(recs, *args, **kwargs) File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_pos_nfce/models/pos_order.py", line 124, in create_from_ui response = super().create_from_ui(orders, draft) File "/opt/odoo/atiboo/addons/point_of_sale/models/pos_order.py", line 569, in create_from_ui order_ids.append(self._process_order(order, draft, existing_order)) File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_pos_nfce/models/pos_order.py", line 64, in _process_order res = super()._process_order(pos_order_vals, draft, existing_order) File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_pos/models/pos_order.py", line 268, in _process_order order_id = super( File "/opt/odoo/atiboo/addons/aspl_gift_card/models/pos_order.py", line 21, in _process_order order_id = super(PosOrder, self)._process_order(order, draft, existing_order) File "/opt/odoo/atiboo/addons/point_of_sale/models/pos_order.py", line 149, in _process_order pos_order._generate_pos_order_invoice() File "/opt/odoo/atiboo/addons/point_of_sale/models/pos_order.py", line 527, in _generate_pos_order_invoice new_move.sudo().with_company(order.company_id)._post() File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_account_payment_brcobranca/models/account_move.py", line 84, in _post result = super()._post(soft) File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_account/models/account_move.py", line 514, in _post self.mapped("fiscal_document_id").filtered( File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_fiscal/models/document_workflow.py", line 311, in action_document_confirm to_confirm._document_confirm() File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_fiscal/models/document_workflow.py", line 304, in _document_confirm self._change_state(SITUACAO_EDOC_A_ENVIAR) File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_fiscal/models/document_workflow.py", line 227, in _change_state if record._before_change_state(old_state, new_state): File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_fiscal/models/document_workflow.py", line 123, in _before_change_state return self._exec_before_SITUACAO_EDOC_A_ENVIAR(old_state, new_state) File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_fiscal/models/document_workflow.py", line 88, in _exec_before_SITUACAO_EDOC_A_ENVIAR self._document_export() File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_nfe/models/document.py", line 901, in _document_export edoc = record.serialize()[0] File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_fiscal/models/document_eletronic.py", line 184, in serialize self._serialize(edocs) File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_nfe/models/document.py", line 855, in _serialize inf_nfe = record.export_ds()[0] File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 264, in export_ds return self.export_xml(print_xml=False) File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 248, in export_xml binding_instance = self._build_generateds() File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 233, in _build_generateds self._export_fields(xsd_fields, class_obj, export_dict=kwargs) File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 102, in _export_fields field_data = self._export_field( File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_nfe/models/document.py", line 650, in _export_field return super()._export_field(xsd_field, class_obj, member_spec, export_value) File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 138, in _export_field return self._export_one2many(xsd_field, class_obj) File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_nfe/models/document.py", line 679, in _export_one2many res = super()._export_one2many(field_name, class_obj) File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 172, in _export_one2many field_data = relational_field._build_generateds( File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 233, in _build_generateds self._export_fields(xsd_fields, class_obj, export_dict=kwargs) File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 102, in _export_fields field_data = self._export_field( File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 136, in _export_field return self._export_many2one(xsd_field, xsd_required, class_obj) File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 160, in _export_many2one return self._build_generateds( File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 233, in _build_generateds self._export_fields(xsd_fields, class_obj, export_dict=kwargs) File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 102, in _export_fields field_data = self._export_field( File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 136, in _export_field return self._export_many2one(xsd_field, xsd_required, class_obj) File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 160, in _export_many2one return self._build_generateds( File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 233, in _build_generateds self._export_fields(xsd_fields, class_obj, export_dict=kwargs) File "/opt/odoo/atiboo/addons/l10n-brazil/spec_driven_model/models/spec_export.py", line 78, in _export_fields export_method(xsd_fields, class_obj, export_dict) File "/opt/odoo/atiboo/addons/l10n-brazil/l10n_br_nfe/models/document_line.py", line 491, in _export_fields_nfe_40_icms self.nfe40_choiceicms.replace("nfe40", "") Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/odoo/atiboo/odoo/http.py", line 652, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/atiboo/odoo/http.py", line 317, in _handle_exception raise exception.with_traceback(None) from new_cause AttributeError: 'bool' object has no attribute 'replace'

mileo commented 1 month ago

Pela retaguarda vc consegue gerar uma nf-e / nfc-e? seu módulo edi esta instalado e atualizado?

kcarriello commented 1 month ago

obrigado pela ajuda, meu problema estava na operação fiscal de venda que estava como provisória.