Browse Source

Limit lines to < 80 chars

pull/263/merge
raph 9 years ago
committed by Sylvain LE GAL
parent
commit
deec3ba3c1
  1. 17
      pos_default_empty_image/__openerp__.py
  2. 1
      pos_default_empty_image/product.py

17
pos_default_empty_image/__openerp__.py

@ -10,11 +10,14 @@
POS Default empty Image POS Default empty Image
======================= =======================
In the point of sale, trying to load known inexistant images is a waste of time.
In the point of sale, trying to load known inexistant images is
a waste of time.
When you have 8000 products in your Point of Sale and most of them don't have images,
you are happy to save thousands of useless requests : the POS load way faster.
When you have 8000 products in your Point of Sale and most of them
don't have images, you are happy to save thousands of useless requests :
the POS load way faster.
Technical information Technical information
===================== =====================
@ -22,15 +25,17 @@ Technical information
Each time the pos instantiate a product, it will add an Each time the pos instantiate a product, it will add an
<img src="/web/.... + imageId"> to DOM. <img src="/web/.... + imageId"> to DOM.
The browser will trigger as many requests than there is different url. The browser will trigger as many requests than there is different url.
If you have many products, the browser will soon reach his limit of network connections to Odoo server and
If you have many products, the browser will soon reach his limit of
network connections to Odoo server and
will wait for free slots instead of loading other valuable contents. will wait for free slots instead of loading other valuable contents.
The POS is then very slow to work with. The POS is then very slow to work with.
This module adds a field _has_image_ in product.template and will change This module adds a field _has_image_ in product.template and will change
the product image url to his default placeholder directly in the POS. the product image url to his default placeholder directly in the POS.
Because there is only one url for this placeholder, you will have only one request for all the products with
no images.
Because there is only one url for this placeholder, you will have
only one request for all the products with no images.
Indeed, if the product has an image, it will load normally. Indeed, if the product has an image, it will load normally.

1
pos_default_empty_image/product.py

@ -4,6 +4,7 @@
from openerp import models, fields, api from openerp import models, fields, api
class ProductTemplate(models.Model): class ProductTemplate(models.Model):
_inherit = ['product.template'] _inherit = ['product.template']
_name = 'product.template' _name = 'product.template'

Loading…
Cancel
Save