contract icon indicating copy to clipboard operation
contract copied to clipboard

[14.0] traceback creating new contract

Open scigghia opened this issue 3 years ago • 1 comments

Module

contract

Describe the bug

when create new contract from contract object with "recurrence at line level" and auto renew, if you change "date start" a traceback occurs

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/opt/odoo/odoo/http.py", line 685, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo/http.py", line 361, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo/http.py", line 349, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo/http.py", line 914, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo/http.py", line 533, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/addons/web/controllers/main.py", line 1394, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/addons/web/controllers/main.py", line 1386, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo/api.py", line 399, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/odoo/api.py", line 386, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/odoo/models.py", line 6225, in onchange
    snapshot0 = Snapshot(record, nametree, fetch=(not first_call))
  File "/opt/odoo/odoo/models.py", line 6069, in __init__
    self.fetch(name)
  File "/opt/odoo/odoo/models.py", line 6079, in fetch
    self[name] = record[name]
  File "/opt/odoo/odoo/models.py", line 5686, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/opt/odoo/odoo/fields.py", line 1021, in __get__
    self.compute_value(recs)
  File "/opt/odoo/odoo/fields.py", line 1177, in compute_value
    records._compute_field_value(self)
  File "/opt/odoo/odoo/models.py", line 4069, in _compute_field_value
    getattr(self, field.compute)()
  File "/mnt/data/odoo-addons-dir/contract/models/contract_line.py", line 134, in _compute_next_period_date_start
    super(ContractLine, rest)._compute_next_period_date_start()
  File "/mnt/data/odoo-addons-dir/contract/models/contract_recurrency_mixin.py", line 115, in _compute_next_period_date_start
    if rec.date_end and next_period_date_start > rec.date_end:
Exception

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

Traceback (most recent call last):
  File "/opt/odoo/odoo/http.py", line 641, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo/http.py", line 317, in _handle_exception
    raise exception.with_traceback(None) from new_cause
TypeError: '>' not supported between instances of 'bool' and 'datetime.date'

To Reproduce

Affected versions: tested on 14.0 with runbot

Steps to reproduce the behavior:

  1. create new contract
  2. set recurrence at line level
  3. set auto renew
  4. change date start

Expected behavior Should change date start without errors

scigghia avatar Apr 24 '22 13:04 scigghia

Peek 24-04-2022 15-26

scigghia avatar Apr 24 '22 13:04 scigghia

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar Oct 23 '22 12:10 github-actions[bot]

Fixed at 42b1bffef4294ba202d274f6898a1f19c1d32edf

pedrobaeza avatar Nov 03 '22 18:11 pedrobaeza

great!

scigghia avatar Nov 04 '22 08:11 scigghia