> Why do you need all these changes? Are you sure the o2m does not get a
> reference to its parent object (or at least id)? If he does, it should be
> possible to enable/disable the button based on that should it not? (based on
> parent record + o2m record having ids and being currently saved)
Hello,
In : Warehouse -> Delivery orders (create new record) -> Stock Moves(o2m)
here all buttons should be readonly because record is new and it should be
enable when opened in edit mode.
If form is opened for new record and inside that if there is o2m and if we
create new record for o2m so parent record will be saved but o2m record is
still not saved so it doesn't have id, so i am disable/enable button based on
id of record if record is already saved it contains id so i'll not set readonly
parameter and if it is new record i'll disable button by setting readonly=True
and also i have to check for o2m, because i don't want to make all buttons
readonly in form view, i want to make buttons readonly when new record is
opened in o2m, so that's why i have to check whether screen's parameter
"self.o2m = kw.get('_o2m', 0)" contains value 1. so based on this two scenario
i have written the condition
if not self.id and self.o2m == 1:
self.btn_readonly = 1
--
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-bug-6179-msh/+merge/68641
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-client-web/6.0-bug-6179-msh.
_______________________________________________
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