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

Hello all,

I opened wizard(calendar view) on button.And by selecting blank space on calendar view i created new records. But i'm not able to edit previous record. By clicking saved records no action happened. In normal view(without wizard) i'm able to edit record but it's not work on wizard. So, Anybody can provide solution for this problem, that i can edit record on wizard by passing context or any other way. 

My Python Code is below:

    def farewell_room_calendar_book(self):

        ir_model_data = self.env['ir.model.data']

        try:

            view_id = ir_model_data.get_object_reference('P2N_Sales', 'view_farewell_room_calendar_calendar')[1]

        except ValueError:

            view_id = False

        record_id = self.env['farewell.calendar.booking'].search([])

        if record_id:

            record = record_id.ids

        else:

            record = False

        ctx = dict()

        ctx.update({

            'default_pack_number': self.id,

            'default_so_number': self.so_number.id,

        })

        res = {

            # 'name': record_id1,

            'view_type': 'form',

            'view_mode': 'tree',

            'views': [(view_id, 'calendar')],

            'res_model': 'farewell.calendar.booking',

            'view_id': view_id,

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

            'res_id': record,

            'domain': ['|',('state', '=', 'sale'),('pack_number', '=', self.id)],

            'target': 'new',

            # 'flags': {'form': {'action_buttons': True, 'options': {'mode': 'edit'}}},

            'context': ctx,

        }

        return res




Thanks in advance

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
5
ม.ค. 20
4267
0
ส.ค. 22
2296
1
ก.ค. 22
19998
0
เม.ย. 22
2969
3
ก.ย. 21
3155