Buenas,
¿Alguna idea de como podría solucionarlo? he desinstalado el módulo facturae y sus dependencias (con estas el módulo de facturación incluido ya que comparte algunas), por otra parte he clonado el repositorio según el enlace que me has facilitado, tambien el contenido de account_journal.py lo he copiado según la versión 16. Pero me sigue dando error:
RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo-server/odoo/http.py", line 1584, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo-server/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/odoo-server/odoo/http.py", line 1611, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo-server/odoo/http.py", line 1815, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo-server/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/odoo-server/addons/web/controllers/dataset.py", line 46, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo-server/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo-server/odoo/api.py", line 461, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo-server/odoo/api.py", line 448, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "", line 2, in button_immediate_install
File "/opt/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 76, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 491, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 615, in _button_immediate_function
registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "", line 2, in new
File "/opt/odoo/odoo-server/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/opt/odoo/odoo-server/odoo/modules/registry.py", line 90, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/opt/odoo/odoo-server/odoo/modules/loading.py", line 488, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/opt/odoo/odoo-server/odoo/modules/loading.py", line 372, in load_marked_modules
loaded, processed = load_module_graph(
File "/opt/odoo/odoo-server/odoo/modules/loading.py", line 207, in load_module_graph
registry.setup_models(cr)
File "/opt/odoo/odoo-server/odoo/modules/registry.py", line 297, in setup_models
model._setup_fields()
File "/opt/odoo/odoo-server/odoo/models.py", line 2803, in _setup_fields
field.setup(self)
File "/opt/odoo/odoo-server/odoo/fields.py", line 538, in setup
self.setup_nonrelated(model)
File "/opt/odoo/odoo-server/odoo/fields.py", line 4688, in setup_nonrelated
raise TypeError(msg % (self, field))
TypeError: Many2many fields account.journal.inbound_payment_method_ids and account.journal.outbound_payment_method_ids use the same table and columns
El archivo ha quedado así:
GNU nano 6.2 /home/prana/bank-payment/account_payment_mode/models/account_journal.py
# Copyright 2016-2020 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, models
from odoo.exceptions import ValidationError
class AccountJournal(models.Model):
_inherit = "account.journal"
def _default_outbound_payment_methods(self):
all_out = self.env["account.payment.method"].search(
[("payment_type", "=", "outbound")]
)
return all_out
def _default_inbound_payment_methods(self):
method_info = self.env[
"account.payment.method"
]._get_payment_method_information()
unique_codes = tuple(
code for code, info in method_info.items() if info.get("mode") == "unique"
)
all_in = self.env["account.payment.method"].search(
[
("payment_type", "=", "inbound"),
("code", "not in", unique_codes), # filter out unique codes
]
)
return all_in
@api.constrains("company_id")
def company_id_account_payment_mode_constrains(self):
for journal in self:
mode = self.env["account.payment.mode"].search(
[
("fixed_journal_id", "=", journal.id),
("company_id", "!=", journal.company_id.id),
],
limit=1,
)
if mode:
raise ValidationError(
Buenos días,
Muchas gracias por la respuesta, en GitHub me cerraron el hilo, no pude resolver el problema con la respuesta.
La instalación de odoo, es directamente la 16.0 y todos los módulos son de la versión 16.0. No he tenido ningún problema en la instalación del resto de módulos, solamente con este último (la única alternativa gratuita que he encontrado para facturación electrónica), facturae versión 16.0 del respositorio GitHub de OCA/l10n-spain, concretamente en la instalación de la dependencia Account Payment Mode, me da el siguiente error a la hora de activarlo, no se si es que esa versión del módulo no es compatible con otros ya instalados.
RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo-server/odoo/http.py", line 1584, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo-server/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/odoo-server/odoo/http.py", line 1611, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo-server/odoo/http.py", line 1815, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo-server/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/odoo-server/addons/web/controllers/dataset.py", line 46, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo-server/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo-server/odoo/api.py", line 461, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo-server/odoo/api.py", line 448, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "", line 2, in button_immediate_install
File "/opt/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 76, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 491, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 615, in _button_immediate_function
registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "", line 2, in new
File "/opt/odoo/odoo-server/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/opt/odoo/odoo-server/odoo/modules/registry.py", line 90, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/opt/odoo/odoo-server/odoo/modules/loading.py", line 488, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/opt/odoo/odoo-server/odoo/modules/loading.py", line 372, in load_marked_modules
loaded, processed = load_module_graph(
File "/opt/odoo/odoo-server/odoo/modules/loading.py", line 207, in load_module_graph
registry.setup_models(cr)
File "/opt/odoo/odoo-server/odoo/modules/registry.py", line 297, in setup_models
model._setup_fields()
File "/opt/odoo/odoo-server/odoo/models.py", line 2803, in _setup_fields
field.setup(self)
File "/opt/odoo/odoo-server/odoo/fields.py", line 538, in setup
self.setup_nonrelated(model)
File "/opt/odoo/odoo-server/odoo/fields.py", line 4688, in setup_nonrelated
raise TypeError(msg % (self, field))
TypeError: Many2many fields account.journal.inbound_payment_method_ids and account.journal.outbound_payment_method_ids use the same table and columns
Saludos.