I would like a record opened from a o2m field to be saved when "Save" is
clicked. Consequently, the constraints related to this record would be
checked at this very moment, and not at the end of the process -- as it
used to be.
For the sake of the example, I added a constraint on the purchase order
line to avoid negative prices. Here it is:
def _check_positive_price(self,cr,uid,ids,context=None):
for line in self.browse(cr, uid, ids):
if line.price_unit < 0:
return False
return True
_constraints = [(_check_positive_price,'price is
negative!',['price_unit'])]
Of course in that case, the constraint is extremely simple, it is
violated only for one record, so it is obvious to the user what he did
wrong. But a real life scenario could be much more problematic.
And finally, please understand that all I want is *basic useability* and
*common sense*: I want the SAVE button to actually SAVE something!
** Attachment added: "Constraints verified at the very end"
https://bugs.launchpad.net/openerp-web/+bug/900772/+attachment/2633024/+files/out.ogv
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/900772
Title:
Saving a record in a o2m does not save it
Status in OpenERP Web:
New
Bug description:
Hi guys,
I know Rvalyi and I already reported that, but since you closed those
bugs as fixed, I need to create a new one to stress things out.
The new behaviour is terrible because of different reasons. First,
constraints are checked only when a record is saved. That means you
can modify all the records in a o2m, and get all the errors in your
face at the end -- what if you forgot which record you modified among
thousands of them?
Also, clicking on "save" gives the user the confidence that he saved
his work. That means he could really likely click on a menu item just
afterwards, losing all his modifications.
My workaround for the moment is extremely heavy but at least it works. All
o2m are set readonly, I create a new button to create a new record, opening
the view in the main window, with a default value for the m2o to the current
object. And I add two buttons on target objects to delete them and modify them
in the main window. I re-write existing stuff in fact, but working properly.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openerp-web/+bug/900772/+subscriptions
_______________________________________________
Mailing list: https://launchpad.net/~c2c-oerpscenario
Post to : [email protected]
Unsubscribe : https://launchpad.net/~c2c-oerpscenario
More help : https://help.launchpad.net/ListHelp