Otherwise, when rendering the 'Product' template it crashes when calling
the 'get_price' method.
Indeed, we need to add products as a Product model instead of as a plain
JS object.
The RPC system was not completely satisfactory, we decided to prepare
the future and do it properly. This commit introduces the new rpc
system, which replace the previous new one. We now simply have a
method, this._rpc, which takes a dictionary of parameters. The idea is
that depending on the parameters, it is able to add correct default
value when necessary.
For situations where we don't have the this._rpc method, we can use the
rpc.query method, which takes the same arguments, but directly calls
ajax.rpc instead of triggering up some events.
Originally written by Nicolas Seinlet <nse@odoo.com>. Provides
pos.config with a product.product cache.
This adds a ported and refactored pos_cache from odoo-extra:
- Adapt to changes in web and point_of_sale since 8.0
- Refactor the load_server_data function, so it isn't copy pasted but
cleanly patched into the load_server_data super.
- Make the cron inactive by default.
- Also remove retrying the write 5 times, when it fails we'll just have
to wait until the cron triggers again (an hour from then).
- Store the product.product fields and domain on pos_cache. When cache
is requested from the pos with a different field or domain it'll
automatically recompute. Necessary for when someone would install a
module that modifies these things in the pos after a cache has been
generated.
- Have multiple caches per pos_config per user
- Make the module adhere to the Odoo Coding Guidelines.