Fall 5430 Bugfix mit context

develop
Ahmed Aly 2018-04-12 09:39:45 +02:00
parent bedc4e6bd8
commit 51f0f46ea7
2 changed files with 4 additions and 4 deletions

View File

@ -134,8 +134,6 @@ class AccountInvoice(models.Model):
intrastrat_not_set = True
if intrastrat_not_set:
action = self.env.ref('dp_custom.action_wizard_confirm_print_invoice').read()[0]
action['context'] = '{"default_info": "'+info+'"}'
action['context'] = str({"default_info": info, "invoice_ids": self.env.context.get("active_ids")})
return action
return self.env.ref('dp_reports_account.account_invoices_with_intrastat').report_action(self)

View File

@ -13,6 +13,8 @@ class ConfirmPrintInvoice(models.TransientModel):
def print_invoice(self):
self.ensure_one()
invoice = self.env['account.invoice'].browse(self.env.context.get('active_ids', []))
invoice = self.env['account.invoice'].browse(self.env.context.get('invoice_ids', []))
if not invoice:
return {'type': 'ir.actions.act_window_close'}
return self.env.ref('dp_reports_account.account_invoices_with_intrastat').report_action(invoice)