Closed ahmedToufikDahmri closed 5 years ago
i have solved the problem by adding this line :
model_id = fields.Many2one('ir.model', 'Model', help='Select Model')
to : jasper_reports\models\report_xml.py line 100
now i am getting this error while trying to print reports
@hiren-serpentcs Can you check please? Thanks.
Hi @ahmedToufikDahmri, Thank you for reporting the issue. Will you please make sure that you have the latest pull of v12 because the field model_id is already defined in the base and we have removed it in last update.
Odoo Server Error
Traceback (most recent call last): File "/opt/odoo/odoo-12.0/odoo/models.py", line 1108, in _validate_fields check(self) File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_ui_view.py", line 351, in _check_xml self.postprocess_and_fields(view.model, view_doc, view.id) File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_ui_view.py", line 1096, in postprocess_and_fields self.raise_view_error(message, view_id) File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_ui_view.py", line 548, in raise_view_error raise ValueError(message) ValueError: Field
model_id
does not existError context: View
ir.actions.report.jasper.form
[view_id: 1115, xml_id: n/a, model: ir.actions.report, parent_id: n/a]During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/odoo/odoo-12.0/odoo/tools/convert.py", line 757, in parse self._tags[rec.tag](rec, de, mode=mode) File "/opt/odoo/odoo-12.0/odoo/tools/convert.py", line 662, in _tag_record record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File "/opt/odoo/odoo-12.0/odoo/models.py", line 3838, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/opt/odoo/odoo-12.0/addons/website/models/ir_ui_view.py", line 128, in _load_records_create records = super(View, self)._load_records_create(values) File "/opt/odoo/odoo-12.0/odoo/models.py", line 3752, in _load_records_create return self.create(values) File "</home/ebees/.local/lib/python3.6/site-packages/decorator.py:decorator-gen-32>", line 2, in create File "/opt/odoo/odoo-12.0/odoo/api.py", line 452, in _model_create_multi return create(self, arg) File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_ui_view.py", line 428, in create return super(View, self).create(vals_list) File "</home/ebees/.local/lib/python3.6/site-packages/decorator.py:decorator-gen-3>", line 2, in create File "/opt/odoo/odoo-12.0/odoo/api.py", line 452, in _model_create_multi return create(self, arg) File "/opt/odoo/odoo-12.0/odoo/models.py", line 3569, in create fields[0].determine_inverse(batch_recs) File "/opt/odoo/odoo-12.0/odoo/fields.py", line 1110, in determine_inverse getattr(records, self.inverse)() File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch view.write(data) File "/opt/odoo/odoo-12.0/addons/website/models/ir_ui_view.py", line 41, in write return super(View, self).write(vals) File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_ui_view.py", line 444, in write return super(View, self).write(self._compute_defaults(vals)) File "/opt/odoo/odoo-12.0/odoo/models.py", line 3284, in write self._write(store_vals) File "/opt/odoo/odoo-12.0/odoo/models.py", line 3430, in _write self._validate_fields(vals) File "/opt/odoo/odoo-12.0/odoo/models.py", line 1112, in _validatefields raise ValidationError("%s\n\n%s" % (("Error while validating constraint"), tools.ustr(e))) odoo.exceptions.ValidationError: ('Error while validating constraint\n\nField
model_id
does not exist\n\nError context:\nViewir.actions.report.jasper.form
\n[view_id: 1115, xml_id: n/a, model: ir.actions.report, parent_id: n/a]', None)During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/odoo/odoo-12.0/odoo/http.py", line 654, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/odoo-12.0/odoo/http.py", line 312, in _handle_exception raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File "/opt/odoo/odoo-12.0/odoo/tools/pycompat.py", line 87, in reraise raise value File "/opt/odoo/odoo-12.0/odoo/http.py", line 696, in dispatch result = self._call_function(self.params) File "/opt/odoo/odoo-12.0/odoo/http.py", line 344, in _call_function return checked_call(self.db, *args, *kwargs) File "/opt/odoo/odoo-12.0/odoo/service/model.py", line 97, in wrapper return f(dbname, args, kwargs) File "/opt/odoo/odoo-12.0/odoo/http.py", line 337, in checked_call result = self.endpoint(*a, kw) File "/opt/odoo/odoo-12.0/odoo/http.py", line 939, in call return self.method(*args, *kw) File "/opt/odoo/odoo-12.0/odoo/http.py", line 517, in response_wrap response = f(args, kw) File "/opt/odoo/odoo-12.0/addons/web/controllers/main.py", line 966, in call_button action = self._call_kw(model, method, args, {}) File "/opt/odoo/odoo-12.0/addons/web/controllers/main.py", line 954, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/opt/odoo/odoo-12.0/odoo/api.py", line 749, in call_kw return _call_kw_multi(method, model, args, kwargs) File "/opt/odoo/odoo-12.0/odoo/api.py", line 736, in _call_kw_multi result = method(recs, *args, *kwargs) File "</home/ebees/.local/lib/python3.6/site-packages/decorator.py:decorator-gen-61>", line 2, in button_immediate_install File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_module.py", line 73, in check_and_log return method(self, args, **kwargs) File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_module.py", line 444, in button_immediate_install return self._button_immediate_function(type(self).button_install) File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_module.py", line 552, in _button_immediate_function modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/opt/odoo/odoo-12.0/odoo/modules/registry.py", line 86, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/opt/odoo/odoo-12.0/odoo/modules/loading.py", line 421, in load_modules loaded_modules, update_module, models_to_check) File "/opt/odoo/odoo-12.0/odoo/modules/loading.py", line 313, in load_marked_modules perform_checks=perform_checks, models_to_check=models_to_check File "/opt/odoo/odoo-12.0/odoo/modules/loading.py", line 222, in load_module_graph load_data(cr, idref, mode, kind='data', package=package, report=report) File "/opt/odoo/odoo-12.0/odoo/modules/loading.py", line 68, in load_data tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report) File "/opt/odoo/odoo-12.0/odoo/tools/convert.py", line 801, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/opt/odoo/odoo-12.0/odoo/tools/convert.py", line 864, in convert_xml_import obj.parse(doc.getroot(), mode=mode) File "/opt/odoo/odoo-12.0/odoo/tools/convert.py", line 763, in parse exc_info[2] File "/opt/odoo/odoo-12.0/odoo/tools/pycompat.py", line 86, in reraise raise value.with_traceback(tb) File "/opt/odoo/odoo-12.0/odoo/tools/convert.py", line 757, in parse self._tags[rec.tag](rec, de, mode=mode) File "/opt/odoo/odoo-12.0/odoo/tools/convert.py", line 662, in _tag_record record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File "/opt/odoo/odoo-12.0/odoo/models.py", line 3838, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/opt/odoo/odoo-12.0/addons/website/models/ir_ui_view.py", line 128, in _load_records_create records = super(View, self)._load_records_create(values) File "/opt/odoo/odoo-12.0/odoo/models.py", line 3752, in _load_records_create return self.create(values) File "</home/ebees/.local/lib/python3.6/site-packages/decorator.py:decorator-gen-32>", line 2, in create File "/opt/odoo/odoo-12.0/odoo/api.py", line 452, in _model_create_multi return create(self, arg) File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_ui_view.py", line 428, in create return super(View, self).create(vals_list) File "</home/ebees/.local/lib/python3.6/site-packages/decorator.py:decorator-gen-3>", line 2, in create File "/opt/odoo/odoo-12.0/odoo/api.py", line 452, in _model_create_multi return create(self, arg) File "/opt/odoo/odoo-12.0/odoo/models.py", line 3569, in create fields[0].determine_inverse(batch_recs) File "/opt/odoo/odoo-12.0/odoo/fields.py", line 1110, in determine_inverse getattr(records, self.inverse)() File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch view.write(data) File "/opt/odoo/odoo-12.0/addons/website/models/ir_ui_view.py", line 41, in write return super(View, self).write(vals) File "/opt/odoo/odoo-12.0/odoo/addons/base/models/ir_ui_view.py", line 444, in write return super(View, self).write(self._compute_defaults(vals)) File "/opt/odoo/odoo-12.0/odoo/models.py", line 3284, in write self._write(store_vals) File "/opt/odoo/odoo-12.0/odoo/models.py", line 3430, in _write self._validate_fields(vals) File "/opt/odoo/odoo-12.0/odoo/models.py", line 1112, in _validatefields raise ValidationError("%s\n\n%s" % (("Error while validating constraint"), tools.ustr(e))) odoo.tools.convert.ParseError: "Error while validating constraint
Field
model_id
does not existError context: View
ir.actions.report.jasper.form
[view_id: 1115, xml_id: n/a, model: ir.actions.report, parent_id: n/a] None" while parsing /opt/odoo/odoo-12.0/addons/jasper_reports/views/report_xml_view.xml:39, near