Skip to Content
Menu
This question has been flagged
1 Reply
3579 Views

i have this problem, how to solve this 


Odoo Server Error
Traceback (most recent call last):
  File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/opt/odoo/odoo/http.py", line 684, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo/http.py", line 360, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo/http.py", line 348, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo/http.py", line 913, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo/http.py", line 532, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/addons/web/controllers/main.py", line 1393, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/addons/web/controllers/main.py", line 1381, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo/api.py", line 399, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/odoo/api.py", line 386, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "", line 2, in button_immediate_install
  File "/opt/odoo/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
    return method(self, *args, **kwargs)
  File "/opt/odoo/odoo/addons/base/models/ir_module.py", line 475, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/opt/odoo/odoo/addons/base/models/ir_module.py", line 593, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/opt/odoo/odoo/modules/registry.py", line 89, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/odoo/modules/loading.py", line 461, in load_modules
    loaded_modules, update_module, models_to_check)
  File "/opt/odoo/odoo/modules/loading.py", line 349, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/opt/odoo/odoo/modules/loading.py", line 199, in load_module_graph
    registry.init_models(cr, model_names, {'module': package.name}, new_install)
  File "/opt/odoo/odoo/modules/registry.py", line 416, in init_models
    func()
  File "/opt/odoo/odoo/addons/base/models/ir_model.py", line 45, in mark_modified
    records.modified(fnames)
  File "/opt/odoo/odoo/models.py", line 5769, in modified
    node = self.pool.field_triggers.get(self._fields[fname])
  File "/opt/odoo/odoo/tools/func.py", line 26, in __get__
    value = self.fget(obj)
  File "/opt/odoo/odoo/modules/registry.py", line 314, in field_triggers
    dependencies[field] = set(field.resolve_depends(self))
  File "/opt/odoo/odoo/fields.py", line 638, in resolve_depends
    raise ValueError(msg % (self, fname, model_name))
Exception

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

Traceback (most recent call last):
  File "/opt/odoo/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Field account.payment.invoice cannot find dependency 'invoice_ids' on model 'account.payment'.


Avatar
Discard
Best Answer

Hello Said Gourida,

Here we are assuming that you are facing this issue in your custom module therefore the solution to this is:
• If custom field: ‘invoice_ids’ is One2many,check entering the inverse Many2one field in relation with the parent model.
Ex, For One2Many Field:

class AccountPaymentInvoice(models.Model):
_name = 'account.payment.invoice'

invoice_ids = fields.One2many('account.invoice','payment_invoice_id')

class AccountInvoice(models.Model):
_name = ‘account.invoice’

payment_invoice_id = fields.Many2one(‘account.payment.invoice’)

- Where ‘payment_invoice_id’ used in One2many field is the inverse field in relation with the parent model ‘account.invoice’ and check if dependent module is being added in manifest or not.


• For Many2Many Field:
class AccountPaymentInvoice(models.Model):
_name = 'account.payment.invoice'

invoice_ids = fields.Many2many('account.invoice','account_payment_invoice_rel', ‘account_payment_id’,’account_invoice_id’)

- Where ‘account_payment_invoice_rel’ is Relation Between Objects- a table created for the field (optional)
- ‘account_payment_id’ & ‘account_invoice_id’ are columns created for the table.(optional)
- ‘account.invoice’ is the comodel which is mandatory.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard