Il giorno mercoledì 17 gennaio 2018 07:57:29 UTC+1, Cato Nano ha scritto:
> Il giorno mercoledì 17 gennaio 2018 07:55:23 UTC+1, Cato Nano ha scritto:
> > Il giorno martedì 16 gennaio 2018 11:40:47 UTC+1, Sergi Almacellas Abellana 
> > ha 
> > > 
> > > You have to create a function fields which is updated via
> > > on_change_with. For example the product_uom_category [1]on the sale
> > > lines uses the value from the product relation.
> > > 
> > > [1] http://hg.tryton.org/modules/sale/file/3414b8d97403/sale.py#l1057
> > > 
> > > 
> > > -- 
> > 
> > 
> > Thank you Sergi
> > 
> > This is the situation:
> > 
> > bollettaDataCommissione = 
> > fields.Function(fields.Many2One('tributi.bolletta',     'Data di 
> > Commissione'), 'on_change_with_bollettaDataCommissione')
> > 
> > @fields.depends('bolletta')
> > def on_change_with_bollettaDataCommissione(self, name=None):
> >     if self.bolletta:
> >         return self.bolletta.dataCommissione
> > 
> > 
> > and I get
> > 
> > can't compare datetime.date to int
> 
> This is on BollettaLine, of course

Aaah it' s like this

bollettaDataCommissione = fields.Function(fields.Date('tributi.bolletta', 'Data 
di Commissione'), 'on_change_with_bollettaDataCommissione')

@fields.depends('bolletta')
def on_change_with_bollettaDataCommissione(self, name=None):
    if self.bolletta:
         return self.bolletta.dataCommissione

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/a1fa92ad-62ff-4902-b3e8-9a22db2d6e92%40googlegroups.com.

Reply via email to