Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
5
sty 20
4264
0
sie 22
2295
1
lip 22
19997
0
kwi 22
2967
3
wrz 21
3153