Commit Graph
5 Commits
Author SHA1 Message Date
Victor Tabuenca Calvo c3ce1d4f13 [FIX] pos_cache: Adapt JS code to ac89783d2f.
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.
2017-11-22 15:25:01 -08:00
Géry Debongnie 2106e3dd2e [REF] web, *: simplify our RPC system (in JS)
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.
2017-04-11 19:44:38 +02:00
Géry Debongnie 86a87aa8b0 [REF] *: use _rpc method for all rpcs
The _rpc method is now the preferred method to do a rpc, so we need to
update all calls.
2017-04-11 19:44:38 +02:00
Géry Debongnie e574027056 [REF] web,*: remove 'web.model' and 'web.dataModel
Use this.rpc instead of Model object, with web.ajax if necessary.

nb: EventDispatcherMixin include now the custom_events managment instead
of widget
2017-04-11 19:44:38 +02:00
Joren Van Onder 97b0723722 [ADD] pos_cache: add pos_cache ported to v9 from odoo-extra
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.
2015-09-25 12:47:29 +02:00