跳至內容
選單
此問題已被標幟
1 回覆
4839 瀏覽次數

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"

頭像
捨棄
最佳答案

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
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
6月 19
2531
1
12月 18
2734
1
7月 25
445
1
2月 25
1227
0
9月 23
2172