Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3028 Lượt xem

Hi guys , 

If I have field FA in class CA in  module MA , and field FB in class CB in module MB, 

i want that the value of FA (entry)  display in field FB


Any suggestions PPPLLLZZZ !!!!

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hi, thak you for your answer , it tried related field before and its didn't worked , and it now that I noticed that i didn't had FB field in xml, it was in comment ( just in python) hhhhhhhh, and now its work . 


Thank you again 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

use Environment for that like this,

module MA->class CA

class ClassA(models.Model):

    _name = 'modulea.classa'

    fielda = fields.Char('Name', required=True,)


module MB->class CB

class ClassB(models.Model):

    _name = 'moduleb.classb'

    fieldb = fields.Char('Name', required=True,)

   

    def get_recordes(self):

        for record in self.env['modulea.classa']:

            print record.fielda


I hope this works.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 1 17
2956
0
thg 9 23
41
4
thg 3 23
16865
2
thg 7 22
3757
0
thg 5 22
2053