Issue for bi_customer_overdue_statement (#4,544)
Status: OPEN
Date: 08/11/2021
ID: 4,544
S/O number: SO2021/1667245
Reviewer: Tirth Mehta
Module Name: bi_customer_overdue_statement
Version: 14.0
Tags:

Assigned to
Contact
Sachinay Bhujbal
sachinay.bhujbal@browseinfo.in

Description
We hope to have identified the source of the trace back error. See below:

https://odootest.futuredesigns.co.uk

User: developer

Password: F!xTh!5Err0r

On account move there are large numbers of sales transactions where the due date is not set.

See customers: Elite Electrical for an example

Therefore when the report runs we get the error as no due date (ml.date_maturity) is available for comparison. (diff = today - ml.date_maturity)

When any partner that has an account move where the maturity_date is not set is accessed we receive the server error. Thereefore we cannot leave the module installed even though it will produce statements for customers for whom all account moves have a due date set.





Error:

Odoo Server Error



Traceback (most recent call last):

File "/opt/odoo14/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch

result = request.dispatch()

File "/opt/odoo14/odoo/odoo/http.py", line 684, in dispatch

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

File "/opt/odoo14/odoo/odoo/http.py", line 360, in _call_function

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

File "/opt/odoo14/odoo/odoo/service/model.py", line 94, in wrapper

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

File "/opt/odoo14/odoo/odoo/http.py", line 348, in checked_call

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

File "/opt/odoo14/odoo/odoo/http.py", line 913, in __call__

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

File "/opt/odoo14/odoo/odoo/http.py", line 532, in response_wrap

response = f(*args, **kw)

File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 1389, in call_kw

return self._call_kw(model, method, args, kwargs)

File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 1381, in _call_kw

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

File "/opt/odoo14/odoo/odoo/api.py", line 396, in call_kw

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

File "/opt/odoo14/odoo/odoo/api.py", line 383, in _call_kw_multi

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

File "/opt/odoo14/odoo/odoo/models.py", line 3022, in read

return self._read_format(fnames=fields, load=load)

File "/opt/odoo14/odoo/odoo/models.py", line 3042, in _read_format

vals[name] = convert(record[name], record, use_name_get)

File "/opt/odoo14/odoo/odoo/models.py", line 5668, in __getitem__

return self._fields[key].__get__(self, type(self))

File "/opt/odoo14/odoo/odoo/fields.py", line 1019, in __get__

self.compute_value(recs)

File "/opt/odoo14/odoo/odoo/fields.py", line 1175, in compute_value

records._compute_field_value(self)

File "/opt/odoo14/odoo/addons/mail/models/mail_thread.py", line 410, in _compute_field_value

return super()._compute_field_value(field)

File "/opt/odoo14/odoo/odoo/models.py", line 4063, in _compute_field_value

getattr(self, field.compute)()

File "/home/dattah/source/bizanova_addons/bi_customer_overdue_statement/models/res_partner.py", line 152, in compute_days

diff = today - ml.date_maturity

Exception



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



Traceback (most recent call last):

File "/opt/odoo14/odoo/odoo/http.py", line 640, in _handle_exception

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

File "/opt/odoo14/odoo/odoo/http.py", line 316, in _handle_exception

raise exception.with_traceback(None) from new_cause

TypeError: unsupported operand type(s) for -: 'datetime.date' and 'bool'

Message and communication history