Pricelist Cache
pricelist_cache · OCA/sale-workflow
-
Security19/252 minor findings
-
Activity12/25Last human commit 19 months ago
-
Required by15/251 module depends on it
-
Maturity25/25In 4 Odoo series since 14.0
Heuristic over the facts below, not an audit · How it's computed
Description
Provides a cron task who caches prices for all products and all pricelists. The goal is to be able to generate a whole catalog of prices and products for a given customer in a decent time.
Everyday, the cron task will trash the previous day's cache, and rebuild it from scratch. It means that at any moment, the prices stored in the cache are those of the current day, and will not be recomputed before the next day.
However, new prices will be cached in the following cases:
- new product is created
- new pricelist is created
- new pricelist item is created
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 4
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
product_pricelist_cache_view_tree |
product.pricelist.cache.tree | product.pricelist.cache | list | New |
product_pricelist_cache_wizard_view_form |
product.pricelist.cache.wizard.form | product.pricelist.cache.wizard | form | New |
product_pricelist_view |
product.pricelist.form.inherit | product.pricelist | form | Inherits product.product_pricelist_view |
view_partner_property_form |
res.partner.form.inherit | res.partner | form | Inherits product.view_partner_property_form |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 6
-
is_pricelist_cache_availableBooleancompute='_compute_is_pricelist_cache_available' -
is_pricelist_cache_computedBoolean -
parent_pricelist_idsMany2many → product.pricelistcolumn1='pricelist_id'column2='parent_pricelist_id'compute='_compute_parent_pricelist_ids'relation='product_pricelist_cache__parent_pricelist_ids_rel'store=True args: 'product.pricelist'
-
button_open_pricelist_cache_tree(self) -
create(self, vals_list)@api.model_create_multi
-
priceFloat -
pricelist_idMany2one → product.pricelistindex=Trueondelete='cascade'required=Truestring='Pricelist' args: 'product.pricelist' -
product_idMany2one → product.productindex=Truestring='Product Variant' args: 'product.product'
-
create_full_cache(self)Creates cache for all prices applied to all pricelists. -
cron_reset_pricelist_cache(self)Recreates the whole price list cache. -
flush_pricelist_cache(self) -
get_cached_prices_for_pricelist(self, pricelist, products)Retrieves product prices for a given pricelist. -
update_product_pricelist_cache(self, product_ids=None, pricelist_ids=None)Updates price list cache given a product.product recordset and a pricelist, if specified.
-
display_cache_line_idsMany2many → product.pricelist.cachestring='Cached prices' args: 'product.pricelist.cache' -
partner_idMany2one → res.partnerargs: 'res.partner' -
pricelist_idMany2one → product.pricelistargs: 'product.pricelist' -
product_idMany2one → product.productargs: 'product.product'
-
open_in_tree_view(self)
-
applied_onSelectionindex=True -
base_pricelist_idMany2oneindex=True -
categ_idMany2oneindex=True -
company_idMany2oneindex=True -
date_endDatetimeindex=True -
date_startDatetimeindex=True -
min_quantityFloatindex=True -
pricelist_cache_update_skippedBoolean -
product_idMany2oneindex=True -
product_tmpl_idMany2oneindex=True
-
create(self, vals_list)@api.model_create_multi -
update_product_pricelist_cache(self)Executed when a product item is modified. Filters items not based on variants or based on dates, then updates the cache.
No new fields.
Public methods (1)-
create(self, vals)@api.model_create_multiCreate a cache record for each newly created product, for each global pricelist.
-
is_pricelist_cache_availableBooleanrelated='property_product_pricelist.is_pricelist_cache_available' -
pricelist_cache_product_filter_idMany2one → ir.filterscomodel_name='ir.filters'default=<expr>domain=[('model_id', '=', 'product.product')]
-
button_open_pricelist_cache_tree(self)
Loading…
Loading…
Loading…
Loading…