Hello,
I am trying to add a new field to the subscription module, to then display it on the subscription form view. However, I am getting an error while trying to update my module in order to insert the new field.
Here is my model code:
And here is the .xml file:
The error thrown is the following:
2019-01-07 19:36:21,496 9183 ERROR RaizsOdoo werkzeug: Error on request:
Traceback (most recent call last):
File "/home/arthur/.local/lib/python3.5/site-packages/werkzeug/serving.py", line 177, in run_wsgi
execute(self.server.app)
File "/home/arthur/.local/lib/python3.5/site-packages/werkzeug/serving.py", line 165, in execute
application_iter = app(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 260, in app
return self.app(e, s)
File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 166, in application
return application_unproxied(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 154, in application_unproxied
result = handler(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1318, in __call__
return self.dispatch(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1292, in __call__
return self.app(environ, start_wrapped)
File "/home/arthur/.local/lib/python3.5/site-packages/werkzeug/wsgi.py", line 588, in __call__
return self.app(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1473, in dispatch
odoo.registry(db).check_signaling()
File "/usr/lib/python3/dist-packages/odoo/__init__.py", line 76, in registry
return modules.registry.Registry(database_name)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 61, in __new__
return cls.new(db_name)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 85, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 376, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 274, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 181, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 95, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 791, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 852, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 741, in parse
self.parse(rec, mode)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 751, in parse
exc_info[2]
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 86, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 744, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 654, in _tag_record
id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_model.py", line 1488, in _update
record = record.create(values)
File "/usr/lib/python3/dist-packages/odoo/addons/sale_subscription/models/sale_subscription.py", line 208, in create
subscription = super(SaleSubscription, self).create(vals)
File "/usr/lib/python3/dist-packages/odoo/addons/mail/models/mail_thread.py", line 236, in create
thread = super(MailThread, self).create(values)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3372, in create
record = self.browse(self._create(old_vals))
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3465, in _create
cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 155, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 232, in execute
res = self._obj.execute(query, params)
odoo.tools.convert.ParseError: "null value in column "partner_id" violates not-null constraint
DETAIL: Failing row contains (253, actual_next_delivery_date, SUB253, draft, null, 1, null, 2019-01-07, null, null, 2019-01-07, null, null, null, null, null, null, null, null, 96e542d3-9c15-42d4-8895-511d1549cfb8, null, null, null, 1, 2019-01-07 19:36:21.228204, 1, 2019-01-07 19:36:21.228204, null, null, null, null, null, null, null, null, null, 2019-01-07).
" while parsing /home/arthur/theVelopment/raizs/raizs/vtex_subscription/views/subscriptions_fields.xml:4, near
<record id="raizs_subscription_additional" model="sale.subscription">
<field name="name">actual_next_delivery_date</field>
</record>
Any idea on what I am missing here?
Thanks in advance!