Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4788 Widoki

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"

Awatar
Odrzuć
Najlepsza odpowiedź

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
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
cze 19
2500
1
gru 18
2655
1
lip 25
373
Search a message Rozwiązane
1
lut 25
1201
0
wrz 23
2143