Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
4331 Lượt xem

In my case, the wizard is not closing automatically in odoo8. Using wizard for printing purpose, after printing the wizard is not close automatically.

### 'nodestroy': True, is not working in odoo8.

@api.multi

def account_write_check_number(self):

     records = self.env['account.voucher'].browse(voucher_ids)

         if self.current_check_no:

              records.write({'number': self.check_number})

    report_obj = self.env['report'].with_context(active_ids=voucher_ids)

    report_name = 'account_check_writing.report_check'

    return report_obj.get_action(records, report_name)

the above method is wrote in button for printing purpose, printing is fine, but i cant close the wizard automatically..


Ảnh đại diện
Huỷ bỏ

What are you doing? could you post your code?

Câu trả lời hay nhất

Please use this

return {'type': 'ir.actions.act_window_close'}
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Bailey,

For closing window try this:

return {'type': 'ir.actions.act_window_close'}


Hope this helps.




Ảnh đại diện
Huỷ bỏ
Tác giả

Hi sorry, I wrongly put the method,