Skip to Content
Menu
This question has been flagged
1073 Views

Error:

Odoo Server Error


Traceback (most recent call last):

  File "/odoo/odoo-server/odoo/http.py", line 624, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/odoo/odoo-server/odoo/http.py", line 310, in _handle_exception

    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

  File "/odoo/odoo-server/odoo/tools/pycompat.py", line 14, in reraise

    raise value

  File "/odoo/odoo-server/odoo/http.py", line 669, in dispatch

    result = self._call_function(**self.params)

  File "/odoo/odoo-server/odoo/http.py", line 350, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper

    return f(dbname, *args, **kwargs)

  File "/odoo/odoo-server/odoo/http.py", line 339, in checked_call

    result = self.endpoint(*a, **kw)

  File "/odoo/odoo-server/odoo/http.py", line 915, in __call__

    return self.method(*args, **kw)

  File "/odoo/odoo-server/odoo/http.py", line 515, in response_wrap

    response = f(*args, **kw)

  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1331, in call_button

    action = self._call_kw(model, method, args, kwargs)

  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1319, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

  File "/odoo/odoo-server/odoo/api.py", line 387, in call_kw

    result = _call_kw_multi(method, model, args, kwargs)

  File "/odoo/odoo-server/odoo/api.py", line 374, in _call_kw_multi

    result = method(recs, *args, **kwargs)

  File "<decorator-gen-59>", line 2, in button_immediate_install

  File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 72, in check_and_log

    return method(self, *args, **kwargs)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 463, in button_immediate_install

    return self._button_immediate_function(type(self).button_install)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function

    modules.registry.Registry.new(self._cr.dbname, update_module=True)

  File "/odoo/odoo-server/odoo/modules/registry.py", line 86, in new

    odoo.modules.load_modules(registry._db, force_demo, status, update_module)

  File "/odoo/odoo-server/odoo/modules/loading.py", line 421, in load_modules

    processed_modules += load_marked_modules(cr, graph,

  File "/odoo/odoo-server/odoo/modules/loading.py", line 313, in load_marked_modules

    loaded, processed = load_module_graph(

  File "/odoo/odoo-server/odoo/modules/loading.py", line 201, in load_module_graph

    registry.setup_models(cr)

  File "/odoo/odoo-server/odoo/modules/registry.py", line 262, in setup_models

    model._setup_fields()

  File "/odoo/odoo-server/odoo/models.py", line 2740, in _setup_fields

    field.setup_full(self)

  File "/odoo/odoo-server/odoo/fields.py", line 431, in setup_full

    self._setup_regular_full(model)

  File "/odoo/odoo-server/odoo/fields.py", line 3286, in _setup_regular_full

    raise TypeError(msg % (self, field))

TypeError: Many2many fields staff.details.category_ids and hr.employee.category_ids use the same table and columns

-----------------------------------------------------------------

my model is ::

from odoo import models, fields, api



class Employee(models.Model):

    _name = 'staff.details'

    _inherit = ['hr.employee', 'hr.employee.category']

    _description = "adding to Rahbani staff some details "


    per_name = fields.Char(string='Personal No', required=True, help='this is personal number in labour system')

    labour_ex_date = fields.Char(string='Expiry Date', groups="hr.group_hr_manager")

-----------------------------------------------------------------

xml file::

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <!--form view-->
    <record model="ir.ui.view" id="r_employee_form_view">
        <field name="name">hr.employee.inherit</field>
        <field name="model">hr.employee</field>
        <field name="inherit_id" ref="hr.view_employee_form"/>
        <field name="arch" type="xml">
            <notebook position="inside">
                <page name="rahbani_staff_page" string="Rahbani Staff">
                    <group>
                        <field name="per_name"/>
                        <field name="labour_ex_date"/>
                    </group>
                </page>
            </notebook>
        </field>

    </record>
    <record model="ir.actions.act_window" id="r_employee_list_action">
        <field name="name">Employees</field>
        <field name="res_model">staff.details</field>
        <field name="view_mode">tree,form</field>
    </record>

</odoo>


Avatar
Discard
Author

no help for this error

TypeError: Many2many fields staff.details.category_ids and hr.employee.category_ids use the same table and columns