- [[ formatLang((get_data_current_user_tot(user))) or removeParentNode('blockTable')]] [[company.currency_id.symbol]]
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/test/point_of_sale_report.yml b/addons/point_of_sale/test/point_of_sale_report.yml
index 14a4b334800..f31f9ec0f49 100644
--- a/addons/point_of_sale/test/point_of_sale_report.yml
+++ b/addons/point_of_sale/test/point_of_sale_report.yml
@@ -65,15 +65,6 @@
(data, format) = netsvc.LocalService('report.pos.sales.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_user_report'+format), 'wb+').write(data)
--
- In order to test the PDF reports defined on a Point of Sale, we will print a POS Sales User Today Report
--
- !python {model: pos.order}: |
- import netsvc, tools, os, time
- data_dict = {'model':'ir.ui.menu', 'form':{'user_id':[ref('base.user_root')] }}
- (data, format) = netsvc.LocalService('report.pos.sales.user.today').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_user_today_report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment Report
-
@@ -91,11 +82,3 @@
(data, format) = netsvc.LocalService('report.pos.payment.report.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_user_report'+format), 'wb+').write(data)
--
- In order to test the PDF reports defined on a Point of Sale, we will print a POS Today's Sales of Current User Report
--
- !python {model: pos.order}: |
- import netsvc, tools, os, time
- (data, format) = netsvc.LocalService('report.pos.sales.user.today.current.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_today_current_user_report'+format), 'wb+').write(data)
diff --git a/addons/point_of_sale/wizard/__init__.py b/addons/point_of_sale/wizard/__init__.py
index 1c95aa17ab0..0985ae906be 100644
--- a/addons/point_of_sale/wizard/__init__.py
+++ b/addons/point_of_sale/wizard/__init__.py
@@ -21,7 +21,6 @@
import pos_confirm
import pos_discount
-import pos_get_sale
import pos_open_statement
import pos_close_statement
import pos_box_entries
@@ -29,8 +28,6 @@ import pos_box_out
import pos_details
import pos_sales_user
import pos_sales_user_today
-import pos_sales_user_current_user
-import all_closed_cashbox_of_the_day
import pos_receipt
import pos_payment_report_user
import pos_payment_report_date
diff --git a/addons/point_of_sale/wizard/pos_confirm.py b/addons/point_of_sale/wizard/pos_confirm.py
index c55209650ca..c80f3ed1dd6 100644
--- a/addons/point_of_sale/wizard/pos_confirm.py
+++ b/addons/point_of_sale/wizard/pos_confirm.py
@@ -25,36 +25,21 @@ from osv import osv
class pos_confirm(osv.osv_memory):
_name = 'pos.confirm'
- _description = 'Point of Sale Confirm'
+ _description = 'Post POS Journal Entries'
def action_confirm(self, cr, uid, ids, context=None):
- """
- Confirm the order and close the sales.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return :Blank dictionary
- """
- if context is None:
- context = {}
- record_id = context and context.get('active_id', False)
- if record_id:
- if isinstance(record_id, (int, long)):
- record_id = [record_id]
- if record_id:
- order_obj = self.pool.get('pos.order')
-
- for order_id in order_obj.browse(cr, uid, record_id, context=context):
- if order_id.state == 'paid':
- order_obj.write(cr, uid, [order_id.id], {'journal_entry': True}, context=context)
- order_obj.create_account_move(cr, uid, [order_id.id], context=context)
-
- wf_service = netsvc.LocalService("workflow")
- for i in record_id:
- wf_service.trg_validate(uid, 'pos.order', i, 'done', cr)
+ wf_service = netsvc.LocalService("workflow")
+ order_obj = self.pool.get('pos.order')
+ ids = order_obj.search(cr, uid, [('state','=','paid')], context=context)
+ for order in order_obj.browse(cr, uid, ids, context=context):
+ todo = True
+ for line in order.statement_ids:
+ if line.statement_id.state <> 'confirm':
+ todo = False
+ break
+ if todo:
+ wf_service.trg_validate(uid, 'pos.order', order.id, 'done', cr)
return {}
-
pos_confirm()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_confirm.xml b/addons/point_of_sale/wizard/pos_confirm.xml
index 1ea769cae49..85b43bd115d 100644
--- a/addons/point_of_sale/wizard/pos_confirm.xml
+++ b/addons/point_of_sale/wizard/pos_confirm.xml
@@ -1,32 +1,37 @@
-
+
-
-
- Sale Confirm
+
+ Post Journal Entriespos.confirmform
-
- Sale Confirm
+ Post Journal Entriesir.actions.act_windowpos.confirmformformnew
-
-
-
\ No newline at end of file
+
+
+
diff --git a/addons/point_of_sale/wizard/pos_get_sale.py b/addons/point_of_sale/wizard/pos_get_sale.py
deleted file mode 100644
index 48bd89bce7f..00000000000
--- a/addons/point_of_sale/wizard/pos_get_sale.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import osv, fields
-from tools.translate import _
-
-
-class pos_get_sale(osv.osv_memory):
- _name = 'pos.get.sale'
- _description = 'Get From Sale'
-
- _columns = {
- 'picking_id': fields.many2one('stock.picking', 'Sale Order', domain=[('state', 'in', ('assigned', 'confirmed')), ('type', '=', 'out')], context="{'contact_display': 'partner'}", required=True),
- }
-
- def sale_complete(self, cr, uid, ids, context=None):
- """
- Select the picking order and add the in Point of sale order
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return : nothing
- """
- proxy_pos = self.pool.get('pos.order')
- proxy_pick = self.pool.get('stock.picking')
- proxy_order_line = self.pool.get('pos.order.line')
- if context is None:
- context = {}
- this = self.browse(cr, uid, ids[0], context=context)
- record_id = context and context.get('active_id', False)
-
- if record_id:
- order = proxy_pos.browse(cr, uid, record_id, context=context)
- if order.state in ('paid', 'invoiced'):
- raise osv.except_osv(_('UserError '), _("You can't modify this order. It has already been paid"))
-
- for pick in proxy_pick.browse(cr, uid, [this.picking_id.id], context=context):
- proxy_pos.write(cr, uid, record_id, {
- 'picking_id': this.picking_id.id,
- 'partner_id': pick.address_id and pick.address_id.partner_id.id
- }, context=context)
-
- order = proxy_pick.write(cr, uid, [this.picking_id.id], {
- 'invoice_state': 'none',
- 'pos_order': record_id
- }, context=context)
-
- for line in pick.move_lines:
- proxy_order_line.create(cr, uid, {
- 'name': line.sale_line_id.name,
- 'order_id': record_id,
- 'qty': line.product_qty,
- 'product_id': line.product_id.id,
- 'price_unit': line.sale_line_id.price_unit,
- 'discount': line.sale_line_id.discount,
- }, context=context)
- return {}
-
-pos_get_sale()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/pos_get_sale.xml b/addons/point_of_sale/wizard/pos_get_sale.xml
deleted file mode 100644
index 9a28da548d2..00000000000
--- a/addons/point_of_sale/wizard/pos_get_sale.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
- Open Sale Order
- pos.get.sale
- form
-
-
-
-
-
- Select an Open Sale Order
- ir.actions.act_window
- pos.get.sale
- form
- form
- new
-
-
-
-
\ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_sale_user_today.xml b/addons/point_of_sale/wizard/pos_sale_user_today.xml
deleted file mode 100644
index 78f01a4650f..00000000000
--- a/addons/point_of_sale/wizard/pos_sale_user_today.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
- Sales User Today
- pos.sales.user.today
- form
-
-
-
-
-
- Sale by Users
- ir.actions.act_window
- pos.sales.user.today
- form
- form
- new
-
-
-
-
\ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_sales_user_current_user.xml b/addons/point_of_sale/wizard/pos_sales_user_current_user.xml
deleted file mode 100644
index e51ecfee760..00000000000
--- a/addons/point_of_sale/wizard/pos_sales_user_current_user.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
- Sales for Current User
- pos.sales.user.today.current_user
- form
-
-
-
-
-
-
-
- Sales for Current User
- ir.actions.act_window
- pos.sales.user.today.current_user
- form
- form
- new
-
-
-
-
-
\ No newline at end of file