تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
831 أدوات العرض

Hello,


I have models like these:


class Table1(models.Model):

    _name = 'table1'

    name = fields.Char(string='Name')


class Table2(models.Model):

    _name = 'table2'

    name = fields.Char(string='Name')


class Table1Table2(models.Model):

    _name = 'table1.table2'

    table1_id = fields.Many2one(string='Table1', comodel_name='table1')

    table2_id = fields.Many2one(string='Table2', comodel_name='table2')

    match = fields.Boolean(string='Match')


Actually the table1.table2 records are shown as a list (tree) of every couple of table1, table2 records.

The only possibility for the user is to check or uncheck the match field.


My client would like to have a table of check boxes for every records of table1 horizontally, and every records of table2 vertically.

Like this example (4 record of table1 and 3 records of table2):


table1.1

table1.2table1.3

table1.4

table2.1





table2.2





table2.3






Thank you in advance,


Boris


الصورة الرمزية
إهمال

HI
is the relationship between table1 & Table2 -is it correct ?

الكاتب أفضل إجابة

Hi Selvamg,

Yes.

In the real case, table1 is the resources needed for some courses, and table2 is the class rooms. This table 'table1.table2' permits to set the rooms matching every needed resource.

الصورة الرمزية
إهمال