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

Error when a fixed FX pricelist is set to Discount Policy - Show public price & discount to the customer #1832

Open
paulwedoo opened this issue Jan 6, 2025 · 0 comments

Comments

@paulwedoo
Copy link

module: product_pricelist_fixed_currency_rate
version: 16.0

Steps to reproduce
Home currency is NZD
FX Currency is USD
Create Pricelist

  • Set FX Currency
  • Add Price Rules
  • Computation Formula
  • Based on Other Pricelist
  • Other Pricelist Default NZD Customer (NZD)
  • Inverse Fixed Currency Rate = 2.0
  • Apply on all products
  • Save
    Configuration Tab
  • Discount Policy Show public price & discount to the customer
    Create a Sales Order
  • Select Customer
  • Select Fixed FX Price Book
  • Add Product creates the error

Current behavior
RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/http.py", line 1783, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/home/odoo/src/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/home/odoo/src/odoo/odoo/http.py", line 1810, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/home/odoo/src/odoo/odoo/http.py", line 2014, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/home/odoo/src/odoo/addons/website/models/ir_http.py", line 235, in _dispatch
response = super()._dispatch(endpoint)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_http.py", line 221, in _dispatch
result = endpoint(**request.params)
File "/home/odoo/src/odoo/odoo/http.py", line 757, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/home/odoo/src/odoo/addons/web/controllers/dataset.py", line 24, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/odoo/src/odoo/addons/web/controllers/dataset.py", line 20, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/odoo/src/odoo/odoo/api.py", line 468, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/home/odoo/src/odoo/odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/home/odoo/src/odoo/addons/web/models/models.py", line 1074, in onchange
todo = [
File "/home/odoo/src/odoo/addons/web/models/models.py", line 1077, in
if field_name not in done and snapshot0.has_changed(field_name)
File "/home/odoo/src/odoo/addons/web/models/models.py", line 1190, in has_changed
return self[field_name] != self.record[field_name]
File "/home/odoo/src/odoo/odoo/models.py", line 6669, in getitem
return self._fields[key].get(self, self.env.registry[self._name])
File "/home/odoo/src/odoo/odoo/fields.py", line 1152, in get
self.recompute(record)
File "/home/odoo/src/odoo/odoo/fields.py", line 1367, in recompute
apply_except_missing(self.compute_value, recs)
File "/home/odoo/src/odoo/odoo/fields.py", line 1340, in apply_except_missing
func(records)
File "/home/odoo/src/odoo/odoo/fields.py", line 1389, in compute_value
records._compute_field_value(self)
File "/home/odoo/src/odoo/odoo/models.py", line 4913, in _compute_field_value
fields.determine(field.compute, self)
File "/home/odoo/src/odoo/odoo/fields.py", line 102, in determine
return needle(*args)
File "/home/odoo/src/enterprise/sale_subscription/models/sale_order_line.py", line 127, in _compute_price_unit
super(SaleOrderLine, line_to_recompute)._compute_price_unit()
File "/home/odoo/src/odoo/addons/sale_management/models/sale_order_line.py", line 37, in _compute_price_unit
super(SaleOrderLine, self - lines_without_price_recomputation)._compute_price_unit()
File "/home/odoo/src/odoo/addons/sale/models/sale_order_line.py", line 473, in _compute_price_unit
price = line._get_display_price()
File "/home/odoo/src/odoo/addons/sale/models/sale_order_line.py", line 503, in _get_display_price
base_price = self._get_pricelist_price_before_discount()
File "/home/odoo/src/odoo/addons/website_sale/models/sale_order_line.py", line 64, in _get_pricelist_price_before_discount
return super()._get_pricelist_price_before_discount()
File "/home/odoo/src/odoo/addons/sale/models/sale_order_line.py", line 557, in _get_pricelist_price_before_discount
return self.pricelist_item_id._compute_price_before_discount(
File "/home/odoo/src/odoo/addons/product/models/product_pricelist_item.py", line 469, in _compute_price_before_discount
return pricelist_rule._compute_base_price(*args, **kwargs)
TypeError: ProductPricelist._compute_base_price() got an unexpected keyword argument 'currency'

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
RPC_ERROR
at makeErrorFromResponse (https://plazmax-technologies-staging-16629914.dev.odoo.com/web/assets/8f4b30c/web.assets_web.min.js:2910:163)
at XMLHttpRequest. (https://plazmax-technologies-staging-16629914.dev.odoo.com/web/assets/8f4b30c/web.assets_web.min.js:2914:13)

Expected behavior
No Error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant