Community mailing list archives

community@mail.odoo.com

Re: one2many tree view

by
Shivam Goyal
- 10/16/2015 08:01:16

Considering that the state field is in the parent model ....in 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
www.jginfosystems.com
shivam.goyal@jginfosystems.com
±91 9560566121

On Oct 16, 2015 5:13 PM, "Buket akın" <buketakinn@gmail.com> wrote:
hi,
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"/>

     </tree>

</field>



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

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe