Community archivos de la lista de correo

Re: one2many tree view

- 16/10/2015 09:37:40
my code :

class maliyetlendirme(osv.osv):

_name = 'maliyetlendirme'
_columns = {
                'state': fields.selection([('t', 'Taslak'),('m', 'Asistan'),('mt', 'Müşteri Temsilcisi'),('ac', 'Account'),
                                   ('f', 'Final')],
                          'Durum', readonly=True,


class maliyetlendirme_konfeksiyon_maliyet(osv.osv):
_name = 'maliyetlendirme.konfeksiyon.maliyet'

'adi':fields.char('Maliyet adi'),
'br_ihtiyac':fields.integer('Br İhtiyac'),
'br_mal_tl':fields.float('Br Mal TL'),
'tutar_tl':fields.float('Tutar Tl'),
'tutar_doviz':fields.float('Tutar doviz'),

2015-10-16 16:34 GMT+03:00 Buket akın <>:
how can i put constraint? Can you help me?

2015-10-16 16:23 GMT+03:00 Spellbound Soft Solutions <>:
Then as per @shivam say you need to put constraint. Let me know if you need help to put that thing.

On Fri, Oct 16, 2015 at 6:48 PM, Buket akın <> wrote:
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:

Post to:

Post to: