Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0][BUG][contract] Error when adding a product in a invoice line when creating a contract template #68

Closed
rafaelbn opened this issue May 6, 2017 · 1 comment
Labels
Milestone

Comments

@rafaelbn
Copy link
Member

rafaelbn commented May 6, 2017

2017-05-07_1-11-11


Traceback (most recent call last):
  File "/.repo_requirements/odoo/odoo/http.py", line 638, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/.repo_requirements/odoo/odoo/http.py", line 675, in dispatch
    result = self._call_function(**self.params)
  File "/.repo_requirements/odoo/odoo/http.py", line 331, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/.repo_requirements/odoo/odoo/service/model.py", line 119, in wrapper
    return f(dbname, *args, **kwargs)
  File "/.repo_requirements/odoo/odoo/http.py", line 324, in checked_call
    result = self.endpoint(*a, **kw)
  File "/.repo_requirements/odoo/odoo/http.py", line 933, in __call__
    return self.method(*args, **kw)
  File "/.repo_requirements/odoo/odoo/http.py", line 504, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/odoo-10.0/addons/web/controllers/main.py", line 885, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/odoo-10.0/addons/web/controllers/main.py", line 877, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/.repo_requirements/odoo/odoo/api.py", line 681, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/.repo_requirements/odoo/odoo/api.py", line 672, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/.repo_requirements/odoo/odoo/models.py", line 5494, in onchange
    record._onchange_eval(name, field_onchange[name], result)
  File "/.repo_requirements/odoo/odoo/models.py", line 5392, in _onchange_eval
    method_res = method(self)
  File "/home/odoo/build/OCA/contract/contract/models/account_analytic_invoice_line.py", line 85, in _onchange_product_id
    vals['price_unit'] = product.price
  File "/.repo_requirements/odoo/odoo/fields.py", line 870, in __get__
    self.determine_value(record)
  File "/.repo_requirements/odoo/odoo/fields.py", line 981, in determine_value
    self.compute_value(recs)
  File "/.repo_requirements/odoo/odoo/fields.py", line 936, in compute_value
    self._compute_value(records)
  File "/.repo_requirements/odoo/odoo/fields.py", line 927, in _compute_value
    getattr(records, self.compute)()
  File "/home/odoo/odoo-10.0/addons/product/models/product.py", line 190, in _compute_product_price
    prices = pricelist.get_products_price(self, quantities, partners)
  File "/home/odoo/odoo-10.0/addons/product/models/product_pricelist.py", line 254, in get_products_price
    return dict((product_id, res_tuple[0]) for product_id, res_tuple in self._compute_price_rule(zip(products, quantities, partners), date=date, uom_id=uom_id).iteritems())
  File "/home/odoo/odoo-10.0/addons/product/models/product_pricelist.py", line 154, in _compute_price_rule
    (prod_tmpl_ids, prod_ids, categ_ids, self.id, date, date))
  File "/.repo_requirements/odoo/odoo/sql_db.py", line 141, in wrapper
    return f(self, *args, **kwargs)
  File "/.repo_requirements/odoo/odoo/sql_db.py", line 218, in execute
    res = self._obj.execute(query, params)
ProgrammingError: operator does not exist: date <= boolean
LINE 1: ...1) AND (item.date_start IS NULL OR item.date_start<=false) A...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

cc @lasley @Tecnativa

@lasley
Copy link
Contributor

lasley commented May 8, 2017

Thanks for the report @rafaelbn

A missing piece of the replication instructions is that you have to select a pricelist as well. If you do not select a pricelist, the product adds fine.

I find it kind of weird how far up in the traceback contract is. I'll need to play around with this one a bit, but for the time being you can circumvent the error by not selecting a pricelist until after the invoice lines are selected (or not at all).

lasley added a commit to LasLabs/contract that referenced this issue May 9, 2017
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
feketemihai pushed a commit to feketemihai/contract that referenced this issue Nov 13, 2017
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
pedrobaeza pushed a commit to feketemihai/contract that referenced this issue Nov 18, 2017
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
pedrobaeza pushed a commit to feketemihai/contract that referenced this issue Nov 19, 2017
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
pedrobaeza pushed a commit to feketemihai/contract that referenced this issue Nov 19, 2017
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
sbejaoui pushed a commit to sbejaoui/contract that referenced this issue Oct 25, 2018
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
pedrobaeza pushed a commit to sbejaoui/contract that referenced this issue Oct 27, 2018
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
sbejaoui pushed a commit to sbejaoui/contract that referenced this issue Jan 24, 2019
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
devCbssolutionsRo pushed a commit to devCbssolutionsRo/contract that referenced this issue Dec 19, 2019
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
AaronHForgeFlow pushed a commit to ForgeFlow/contract that referenced this issue Apr 24, 2020
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
pedrobaeza pushed a commit to Tecnativa/contract that referenced this issue Jul 14, 2020
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
ozono pushed a commit to ozono/contract that referenced this issue Nov 7, 2020
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
ozono pushed a commit to ozono/contract that referenced this issue Nov 14, 2020
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
dnplkndll pushed a commit to Kencove/contract that referenced this issue Dec 6, 2020
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
ozono pushed a commit to ozono/contract that referenced this issue Apr 2, 2021
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
jcdrubay pushed a commit to jcdrubay/contract that referenced this issue Oct 28, 2021
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
olgamarcocb pushed a commit to tegin/contract that referenced this issue Nov 16, 2021
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
wpichler pushed a commit to wpichler/contract that referenced this issue Oct 24, 2022
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
pedrobaeza pushed a commit to wpichler/contract that referenced this issue Mar 15, 2023
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
peluko00 pushed a commit to APSL/contract that referenced this issue Feb 15, 2024
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
jaydeep32 pushed a commit to archeti-org/contract that referenced this issue Feb 15, 2024
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
CRogos pushed a commit to c4a8-odoo/module-oca-contract that referenced this issue Mar 23, 2024
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
CRogos pushed a commit to c4a8-odoo/module-oca-contract that referenced this issue Mar 23, 2024
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
CRogos pushed a commit to c4a8-odoo/module-oca-contract that referenced this issue Mar 23, 2024
* Add a default date in the instance that an analytic account doesn’t exist (templates) - fixes OCA#68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants