Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4856 Visualizzazioni

I have a method and i need to check if field in other module is having some values, if it's have values then i should use values from that model field if not i will use my logic

so

    def method(self,vals):

        path to some.model and check if "some_field" is having values, 

        if empty use my logic

        else use same values that are in "some_field"

Avatar
Abbandona
Risposta migliore

Hello

Fields are not module related but model related.  so to search a record with matching a field from a model (name in partner)

partner = self.env['res.partner'].search([('name','=','yourname')])
 then use partner

partner.name = 'newname'
value = partner.property
Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
giu 19
2542
1
dic 18
2743
1
lug 25
467
1
feb 25
1235
0
set 23
2177