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

Hello,

Im trying to set the specific field name for the label (title) name of the popup form view via the wizard button.

I'd tried with this code:

def open_popup_form_view(self):

        return {

            'name': ('This is the popup's window of: ', ('context': {'default_name': self.name.id})),

            'view_mode': 'form',

            'res_model': 'mod.b',

            'view_id': self.env.ref('testmodule.pop_up_form_view').id,

            'context': {'default_name': self.name.id,

                        'default_referrence': ' '

                       },

            'target': 'new',

            'type': 'ir.actions.act_window',

            }


If I just code the label/title via the 'name': ('This is the popup's window of: ') --> It works normally.
But tried with these code like above --> seem like a syntax error.


Please help,

Thank you!


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Khanhqn, 

Try this for a solution: 

"name": "This is a popup window %s" %self.name, 

This worked for me as a server action: 

action = {
  "name": "This is a popup window %s" %record.name,
  "view_mode": "form",
  "res_model": "sale.order",
  "target": "new",
  "type": "ir.actions.act_window"
}

I have used record because I am using a server action, but in your case, replace the record with self. 

I hope this works for you, 

Thanks, 

อวตาร
ละทิ้ง
ผู้เขียน

Hi Jack, thank you for your support. But it not works in my case!

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
เม.ย. 22
9073
0
มิ.ย. 21
3752
Add Label up of form แก้ไขแล้ว
1
ธ.ค. 19
9382
Reveal Product Name Help Label แก้ไขแล้ว
1
ก.ค. 19
3430
1
ก.ค. 25
2725