~camptocamp/openerp-connector/7.0-e-commerce-addons-onchange-lines-commands

« back to all changes in this revision

Viewing changes to connector_ecommerce/event.py

  • Committer: Guewen Baconnier
  • Date: 2013-04-15 09:13:25 UTC
  • mfrom: (315.1.2 e-commerce-addons)
  • Revision ID: guewen.baconnier@camptocamp.com-20130415091325-52tg3zy4729850ne
[ADD] on_product_price_changed Event, fired when the price of a product could have changed

As the price is a fields.function based on the contextual pricelist, we can never be sure
that a price has changed, it depends on the context.

So we search all the base fields used to compute the price, and if one of these has changed,
the event is fired.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
 
56
56
Listeners should take the following arguments:
57
57
 
58
 
 * session: `Session` object
59
 
 * session: `connector.session.ConnectorSession` object
60
 
 * model_name: name of the model
61
 
 * record_id: id of the record
 
58
 * session: `connector.session.ConnectorSession` object
 
59
 * model_name: name of the model
 
60
 * record_id: id of the record
 
61
"""
 
62
 
 
63
on_product_price_changed = Event()
 
64
"""
 
65
``on_product_price_changed`` is fired when the price of a product is
 
66
changed. Specifically, it is fired when one of the products' fields used
 
67
in the sale pricelists are modified.
 
68
 
 
69
There is no guarantee that's the price actually changed,
 
70
because it depends on the pricelists.
 
71
 
 
72
 * session: `connector.session.ConnectorSession` object
 
73
 * model_name: name of the model
 
74
 * record_id: id of the record
 
75
 
62
76
"""