Chirag Patel (OpenERP) has proposed merging
lp:~openerp-dev/openobject-server/6.0-opw-355340-cpa into
lp:openobject-server/6.0.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-355340-cpa/+merge/90831
Hello,
In osv memory wizard value not rollback when _constraints returns False.
In web-client
Demo: Warehouse > Warehouse Management > Delivery Orders
1) Edit any Delivery orders.
2) Click on process button.
3) Edit "quantity" of any record from Product Moves.(put any _constraints for
quantity field).
4) Enter this type of value of quantity through that _constraints returns False
and display message.
5) Click on quantity field in editable list and press Esc.
Observed: Quantity change with new value.
Expected: Quantity should not change with new value because value not fit in
_constraints.
In server first we set the value and then check the validation.
If value not validate then we rollback value.
For memory wizard value not rollback.
Following video link for reproduce issue.
http://blip.tv/file/get/Openerpsupport-memory_wizard_not_rollback1803.ogv
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-355340-cpa/+merge/90831
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/6.0-opw-355340-cpa.
=== modified file 'bin/osv/orm.py'
--- bin/osv/orm.py 2012-01-27 09:32:59 +0000
+++ bin/osv/orm.py 2012-01-31 07:37:24 +0000
@@ -945,6 +945,8 @@
)
self._invalids.update(fields)
if error_msgs:
+ if self.datas:
+ self.datas.update(self.for_rollback)
cr.rollback()
raise except_orm('ValidateError', '\n'.join(error_msgs))
else:
@@ -1980,6 +1982,7 @@
vals2[field] = vals[field]
else:
upd_todo.append(field)
+ self.for_rollback = copy.deepcopy(self.datas)
for object_id in ids:
self._check_access(user, object_id, mode='write')
self.datas[object_id].update(vals2)
@@ -2785,6 +2788,7 @@
# if not access is not specify, it is the same value as _auto
self._log_access = getattr(self, "_auto", True)
+ self.datas = {}
self._columns = self._columns.copy()
for store_field in self._columns:
f = self._columns[store_field]
_______________________________________________
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