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

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
5
يناير 20
4113
0
أغسطس 22
2254
1
يوليو 22
19915
0
أبريل 22
2898
3
سبتمبر 21
3068