Xavier ALT (OpenERP) has proposed merging
lp:~openerp-dev/openobject-server/6.1-opw-577292-xal into
lp:openobject-server/6.1.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #856291 in OpenERP Addons: "problem after installing modul 'sale_layout'"
https://bugs.launchpad.net/openobject-addons/+bug/856291
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/6.1-opw-577292-xal/+merge/121195
Hi,
This fix a problem with store triggers not being call on unlink().
Steps:
- install a fresh v6.1 DB with demo data
- install sale application
- then make sure your use is member of "Technical Features" and "Extended View"
groups (for menu visibility purpose)
- go to Sales / Sales / Sales Orders
- observe amount of SO001 for Agrolait, untaxed amount: 6414.70
- go to Sales / Invoicing / Lines to Invoice
- uncheck "Uninvoiced" filter
- 1st line should be "[MB1] Mainboard ASUSTek A7N8X" for SO001 / Agrolait
=> DELETE IT
- go to Sales / Sales / Sales Orders
Current: Amount untaxed didn't changed
Expect: Amount untaxed should have been updated according to deletion of
sale.order.line
Reasons:
- currently unlink() method call _store_get_values() with fields=None, but
currently fields "to_compute" will skip that case when stored function has some
fields defined.
NOTE: I took the conservative approach, meaning I use the same behaviour as
v6.0 _store_get_values() with fields=None equivalent to specifing all fields (I
could have forced specifing all fields on unlink() _store_get_values call)
RELATED MP (which this MP are superseeding):
-
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-577292-ksa/+merge/117243
-
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-575200-rha/+merge/109343
--
https://code.launchpad.net/~openerp-dev/openobject-server/6.1-opw-577292-xal/+merge/121195
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/6.1-opw-577292-xal.
=== modified file 'openerp/osv/orm.py'
--- openerp/osv/orm.py 2012-07-13 12:57:28 +0000
+++ openerp/osv/orm.py 2012-08-24 14:20:28 +0000
@@ -4285,9 +4285,9 @@
model_name_, func_field_to_compute_, id_mapping_fnct_, trigger_fields_, priority_ = range(5)
# only keep functions that should be triggered for the ``fields``
- # being written to.
+ # being written to (or all if fields is empty)
to_compute = [f for f in stored_functions \
- if ((not f[trigger_fields_]) or set(fields).intersection(f[trigger_fields_]))]
+ if ((not f[trigger_fields_]) or (not fields) or set(fields).intersection(f[trigger_fields_]))]
mapping = {}
for function in to_compute:
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp