Repository
OCA/sale-workflow · module folder · Try on Runboat
Module version
1.0.0
Category
Hidden
Folder size
0.13 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/sale-workflow
Last tracking update
2026-08-07 08:42:48
Authors
Camptocamp, Odoo Community Association (OCA)
Maintainers
Camptocamp, Odoo Community Association (OCA)
Committers
Weblate, OCA-git-bot, oca-ci, Rafael Lima
Odoo dependencies
Python dependencies
requests
System dependencies
None
Required by
pricelist_cache_rest
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

Code Analysis

Views touched (4)
XML IDNameModelTypeStatus
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)

New fields (3)
  • is_pricelist_cache_available Boolean
    compute='_compute_is_pricelist_cache_available'
  • is_pricelist_cache_computed Boolean
  • parent_pricelist_ids Many2many → product.pricelist
    column1='pricelist_id' column2='parent_pricelist_id' compute='_compute_parent_pricelist_ids' relation='product_pricelist_cache__parent_pricelist_ids_rel' store=True args: 'product.pricelist'
Public methods (2)
  • button_open_pricelist_cache_tree(self)
  • create(self, vals_list)
    @api.model_create_multi

New fields (3)
  • price Float
  • pricelist_id Many2one → product.pricelist
    index=True ondelete='cascade' required=True string='Pricelist' args: 'product.pricelist'
  • product_id Many2one → product.product
    index=True string='Product Variant' args: 'product.product'
Public methods (5)
  • 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.

New fields (4)
  • display_cache_line_ids Many2many → product.pricelist.cache
    string='Cached prices' args: 'product.pricelist.cache'
  • partner_id Many2one → res.partner
    args: 'res.partner'
  • pricelist_id Many2one → product.pricelist
    args: 'product.pricelist'
  • product_id Many2one → product.product
    args: 'product.product'
Public methods (1)
  • open_in_tree_view(self)

New fields (10)
  • applied_on Selection
    index=True
  • base_pricelist_id Many2one
    index=True
  • categ_id Many2one
    index=True
  • company_id Many2one
    index=True
  • date_end Datetime
    index=True
  • date_start Datetime
    index=True
  • min_quantity Float
    index=True
  • pricelist_cache_update_skipped Boolean
  • product_id Many2one
    index=True
  • product_tmpl_id Many2one
    index=True
Public methods (2)
  • 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.

New fields (0)

No new fields.

Public methods (1)
  • create(self, vals)
    @api.model_create_multi
    Create a cache record for each newly created product, for each global pricelist.

New fields (2)
  • is_pricelist_cache_available Boolean
    related='property_product_pricelist.is_pricelist_cache_available'
  • pricelist_cache_product_filter_id Many2one → ir.filters
    comodel_name='ir.filters' default=<expr> domain=[('model_id', '=', 'product.product')]
Public methods (1)
  • button_open_pricelist_cache_tree(self)

Loading…

Loading…

Loading…