Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
2898 Zobrazení

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 !!!!

Avatar
Zrušit
Autor Nejlepší odpověď

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 

Avatar
Zrušit
Nejlepší odpověď

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.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
led 17
2845
0
zář 23
41
4
bře 23
16719
2
čvc 22
3601
0
kvě 22
1906