On Viernes 02 Marzo 2012 10:34:42 Cédric Krier escribió:
> On 02/03/12 10:19 -0300, Felipe Alvarez Harnecker wrote:
> > On Viernes 02 Marzo 2012 09:45:07 Cédric Krier escribió:
> > > On 02/03/12 09:36 -0300, Felipe Alvarez Harnecker wrote:
> > > > Hi,
> > > >
> > > > i wonder if context is inherited between views, i mean
> > > >
> > > > i defined one ir.action.act_window with context
> > > > {'out_invoice_no_vat': True} that works well, but a child form ( a
> > > > many2one widget ) opens if it doesn't know about the parent context.
> > >
> > > Of course it doesn't.
> > >
> > > > so i wonder how could be this implemented because i need the child
> > > > form to be modified depending of type of invoice.
> > > >
> > > > i've tried to alter parent form with <field ....
> > > > context="{'out_invoice_no_vat': True}"> but context attribute is no
> > > > accepted as valid.
> > >
> > > You can not. A target record opens from a Many2One is not linked to the
> > > origin record. By the way I can not imaging what could be different as
> > > if I open the same record from somewhere else.
> >
> > sorry, it's a One2Many field, anyway i need to implement an invoice type
> > that has no taxes ( here we call it "factura excenta" ). So the idea is
> > to hide all fields related to taxes in the interface.
> >
> > Is that possible in tryton??
>
> Add a states['invisible'] to the taxes field of the line to make it
> invisible in our case and add a check on the invoice to ensure taxes are
> always empty in this case.
Tried this
taxes = fields.Many2Many('account.invoice.line-account.tax',
'line', 'tax', 'Taxes', domain=[('parent', '=', False)],
states={
'invisible':
Equal(Eval('_parent_invoice.type'),'out_invoice_no_vat'),
},
depends=['type','_parent_invoice'])
and all imaginable permutation that you can think and doesn't work
thnx.
--
Felipe Alvarez Harnecker
[email protected] - 9.874.60.17
--
[email protected] mailing list