From 46561864720fb2ca9076234a20620929b286b877 Mon Sep 17 00:00:00 2001 From: Kinjal Mehta Date: Tue, 3 May 2016 11:11:36 +0530 Subject: [PATCH] [IMP] point_of_sale: Stat button to invoice on pos_order view Purpose: In POS order form view the 'Re-Print' button is placed improperly. There should be a way where invoice can be linked to POS without this button.. Removed the reprint button from the form view of POS order. And add the invoice state button so invoice can be linked to POS. --- addons/point_of_sale/models/pos_order.py | 12 ++++++++++++ addons/point_of_sale/views/pos_order_view.xml | 16 +++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 4817b9d6ac4..b6839cb1532 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -411,6 +411,18 @@ class PosOrder(models.Model): def action_invoice_state(self): self.write({'state': 'invoiced'}) + @api.multi + def action_view_invoice(self): + return { + 'name': _('Customer Invoice'), + 'view_mode': 'form', + 'view_id': self.env.ref('account.invoice_form').id, + 'res_model': 'account.invoice', + 'context': "{'type':'out_invoice'}", + 'type': 'ir.actions.act_window', + 'res_id': self.invoice_id.id, + } + @api.multi def action_invoice(self): Invoice = self.env['account.invoice'] diff --git a/addons/point_of_sale/views/pos_order_view.xml b/addons/point_of_sale/views/pos_order_view.xml index 79af97379bc..4475a0a590e 100644 --- a/addons/point_of_sale/views/pos_order_view.xml +++ b/addons/point_of_sale/views/pos_order_view.xml @@ -13,6 +13,15 @@ +
+ +
@@ -78,15 +87,9 @@ - - -