Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3318 มุมมอง

0

my model: school.partner.school

Here is the declaration of my field:

foyer_id = fields.Many2one(string="Foyer", comodel_name="horanet.relation.foyer")

Here is my function to show you what I want to extract when exporting data:

@api.onchange('school_statut')
def _get_import_id_foyer(self):
    if self.school_statut:
        record_ids = self.env["ir.model.data"].search([('res_id', '=', self.partner_id.foyer_relation_ids.foyer_id.id), ('module', '=', 'horanet_tpa_smartbambi')])
        for rec in record_ids:
            print "Import ID Foyer de " + str(self._origin.partner_id.name) + " est : " + rec.name

My problem :

I wish that during my export, the focus_id field exports the external identifier which is located on the name field of the table ir.model.data,

except that currently Odoo is exporting something like this: horanet_relation_foyer_5432.

Why ?

Example, for the partner_id (of the same model) which is declared like this:

partner_id = fields.Many2one(string="Child", comodel_name="res.partner")

I have no problem. It gets me the external ID and not res_partner_3501.

Why ?

Can you help me ?

Thank you


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 20
3631
2
มี.ค. 24
11887
5
ก.ย. 20
6236
Filter field domain one2many to many2one แก้ไขแล้ว
1
ธ.ค. 19
9659
4
ม.ค. 19
9258