Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
4843 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
1
juin 19
2538
1
déc. 18
2736
1
juil. 25
463
1
févr. 25
1231
0
sept. 23
2173