Community mailing list archives

Re: one2many tree view

- 10/16/2015 09:16:45
Thanks .
I tried  options="{'no_create': ('state','!=','m')}"  but still is not working

2015-10-16 15:02 GMT+03:00 Shivam Goyal <>:

Considering that the state field is in the parent model that case u can just put the a constraint in the the object to which the one2many field points to.....

For example in case of sale order and sale order line put a constraint in sale order line which does not allow to create a record if the sale order state is not what you want

However if you want to do it from the view itself the. Make the one2many field readonly conditionally

Shivam Goyal
J & G Infosystems
±91 9560566121

On Oct 16, 2015 5:13 PM, "Buket akın" <> wrote:
I have a question. I want to allow to create a record in one2many based in state ..How can i do it ?
my code :

<field name="konfeksiyon_maliyet_ids" attrs="{'readonly': [('state', '!=', 'm')]}>

       <tree editable="bottom" options="{'create':[('state','!=','m')]}">

               <field name="adi" />

               <field name="br_ihtiyac" on_change="on_change_konfeksiyon(br_ihtiyac,br_mal_tl)"/>

              <field name="br_mal_tl" on_change="on_change_konfeksiyon(br_ihtiyac,br_mal_tl)"/>

             <field name="tutar_tl" sum="Toplam TL" />

          <field name="tutar_doviz" sum="Toplam Doviz"/>



options="{'create':[('state','!=','m')]}" is not working

Post to:

Post to: