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

i am trying to use one single button for two function, first i want to generate a sequence number and in a second place i want to print a pdf, in odoo here is my code

def print_pdf(self):
        if self.name:
            if self.my_number == _('New') or self.my_number == 'New':
                self.write({'my_number': self.env['ir.sequence'].next_by_code('shipset.bar')})
            return True
        return self.env.ref('module_extend.action_report_styn').report_action(self)



but i can't print my pdf, what i am missing else ? 

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

   Hi,

     remove return True     


def print_pdf(self):

            if self.name:

                if self.my_number == _('New') or self.my_number == 'New':

                    self.write({'my_number': self.env['ir.sequence'].next_by_code('shipset.bar')})

            return self.env.ref('module_extend.action_report_styn').report_action(self

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ย. 23
964
4
พ.ค. 24
12762
1
เม.ย. 24
3382
0
พ.ย. 23
2066
Blank White Page After log in to Odoo13 แก้ไขแล้ว
1
ก.ย. 23
2188