psycopg2.errors.NotNullViolation: null value in column "code" of relation "hr_work_entry_type" violates not-null constraint
Resumen
Al intentar instalar el módulo se presenta un error que indica que el campo code no puede ser nulo en el objeto hr_work_entry_type
Me podrían indicar si en code, iría el mismo imss_code de los siguiente data hr_work_entry_type.xml y del siguiente data l10n_mx_hr_ausent_data.xml cual sería el code.
Logs relevantes y/o capturas de pantalla
RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/tools/convert.py", line 683, in _tag_root
f(rec)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/tools/convert.py", line 586, in _tag_record
record = model._load_records([data], self.mode == 'update')
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/models.py", line 4453, in _load_records
records = self._load_records_create([data['values'] for data in to_create])
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/models.py", line 4358, in _load_records_create
return self.create(values)
File "<decorator-gen-69>", line 2, in create
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/api.py", line 418, in _model_create_multi
return create(self, arg)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/addons/base/models/ir_fields.py", line 613, in create
recs = super().create(vals_list)
File "<decorator-gen-15>", line 2, in create
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/api.py", line 418, in _model_create_multi
return create(self, arg)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/models.py", line 4095, in create
records = self._create(data_list)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/models.py", line 4193, in _create
cr.execute(query, params)
File "<decorator-gen-5>", line 2, in execute
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/sql_db.py", line 90, in check
return f(self, *args, **kwargs)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/sql_db.py", line 311, in execute
res = self._obj.execute(query, params)
psycopg2.errors.NotNullViolation: null value in column "code" of relation "hr_work_entry_type" violates not-null constraint
DETALLE: Failing row contains (2, Riesgo de trabajo, null, 0, 25, t, 1, 2024-05-27 18:42:07.720978, 1, 2024-05-27 18:42:07.720978, t, 01, null, 100).
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/addons/base/models/ir_http.py", line 242, in _dispatch
result = request.dispatch()
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/http.py", line 702, in dispatch
result = self._call_function(**self.params)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/http.py", line 368, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/http.py", line 357, in checked_call
result = self.endpoint(*a, **kw)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/http.py", line 925, in __call__
return self.method(*args, **kw)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/http.py", line 546, in response_wrap
response = f(*args, **kw)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/addons/web/controllers/main.py", line 1328, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/addons/web/controllers/main.py", line 1316, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/api.py", line 471, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/api.py", line 456, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-76>", line 2, in button_immediate_install
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/addons/base/models/ir_module.py", line 470, in button_immediate_install
return self._button_immediate_function(self.env.registry[self._name].button_install)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/addons/base/models/ir_module.py", line 587, in _button_immediate_function
registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/modules/registry.py", line 87, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/modules/loading.py", line 474, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/modules/loading.py", line 363, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/modules/loading.py", line 222, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/tools/convert.py", line 748, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/tools/convert.py", line 814, in convert_xml_import
obj.parse(doc.getroot())
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/tools/convert.py", line 734, in parse
self._tag_root(de)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/tools/convert.py", line 696, in _tag_root
raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/http.py", line 658, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/server/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /home/openpyme/Documentos/LOCALES/bench_odoo_15/parts/l10n_mx_payroll/l10n_mx_hr_payroll/data/hr_work_entry_type.xml:3, somewhere inside
<record id="hr_holidays_status_riesgo_trabajo" model="hr.work.entry.type">
<field name="name">Riesgo de trabajo</field>
<!-- <field name="limit" eval="True"/>-->
<field name="is_sick_leave" eval="True"/>
<field name="imss_code">01</field>
<field name="approved_payment_percent">100</field>
</record>