diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py
index acef46a99de..304b325128c 100644
--- a/addons/point_of_sale/point_of_sale.py
+++ b/addons/point_of_sale/point_of_sale.py
@@ -325,7 +325,11 @@ class pos_order(osv.osv):
}
return abs
+ def action_invoice_state(self, cr, uid, ids, context=None):
+ return self.write(cr, uid, ids, {'state':'invoiced'}, context=context)
+
def action_invoice(self, cr, uid, ids, context=None):
+ wf_service = netsvc.LocalService("workflow")
inv_ref = self.pool.get('account.invoice')
inv_line_ref = self.pool.get('account.invoice.line')
product_obj = self.pool.get('product.product')
@@ -341,7 +345,7 @@ class pos_order(osv.osv):
acc = order.partner_id.property_account_receivable.id
inv = {
- 'name': 'Invoice from POS: '+order.name,
+ 'name': order.name,
'origin': order.name,
'account_id': acc,
'journal_id': order.sale_journal.id or None,
@@ -379,6 +383,7 @@ class pos_order(osv.osv):
and [(6, 0, inv_line['invoice_line_tax_id'])] or []
inv_line_ref.create(cr, uid, inv_line, context=context)
inv_ref.button_reset_taxes(cr, uid, [inv_id], context=context)
+ wf_service.trg_validate(uid, 'pos.order', order.id, 'invoice', cr)
if not inv_ids: return {}
diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml
index e6b41d335e5..5e5c23bf7e9 100644
--- a/addons/point_of_sale/point_of_sale_view.xml
+++ b/addons/point_of_sale/point_of_sale_view.xml
@@ -16,8 +16,8 @@
-
-
+
+
@@ -587,9 +587,12 @@
form
-
-
-
+
+
+
+
+
+
diff --git a/addons/point_of_sale/point_of_sale_workflow.xml b/addons/point_of_sale/point_of_sale_workflow.xml
index 4058af2696f..4daa2d17099 100644
--- a/addons/point_of_sale/point_of_sale_workflow.xml
+++ b/addons/point_of_sale/point_of_sale_workflow.xml
@@ -34,7 +34,7 @@
invoiced
True
- action_invoice()
+ action_invoice_state()
function
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 6d9483f81ab..38b9d2d0ed1 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -56,7 +56,7 @@
-
+
@@ -100,9 +100,10 @@
-
-
+
+
@@ -637,8 +638,9 @@
-
+