From fa91b75d006588b0b7d369efd8ff536bf6282f67 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 19 Mar 2010 18:47:21 +0530 Subject: [PATCH] [IMP]point_of_sale :convert the wizard of pos_sales_user_current_user into osv_memory bzr revid: sbh@tinyerp.com-20100319131721-q68nioexgiwlxrk7 --- addons/point_of_sale/__terp__.py | 1 + addons/point_of_sale/pos_view.xml | 4 +- addons/point_of_sale/wizard/__init__.py | 3 +- .../wizard/pos_sales_user_current_user.py | 57 +++++++++++++++++++ .../wizard/pos_sales_user_current_user.xml | 40 +++++++++++++ .../wizard_pos_sales_user_current_user.py | 40 ------------- 6 files changed, 102 insertions(+), 43 deletions(-) create mode 100644 addons/point_of_sale/wizard/pos_sales_user_current_user.py create mode 100644 addons/point_of_sale/wizard/pos_sales_user_current_user.xml delete mode 100644 addons/point_of_sale/wizard/wizard_pos_sales_user_current_user.py diff --git a/addons/point_of_sale/__terp__.py b/addons/point_of_sale/__terp__.py index baf4fe612e2..1f7da8ac7b3 100644 --- a/addons/point_of_sale/__terp__.py +++ b/addons/point_of_sale/__terp__.py @@ -54,6 +54,7 @@ Main features : 'wizard/pos_box_out.xml', 'wizard/pos_sales_user.xml', #'wizard/all_closed_cashbox_of_the_day.xml', + 'wizard/pos_sales_user_current_user.xml', 'wizard/pos_sale_user_today.xml', 'pos_report.xml', 'pos_wizard.xml', diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml index fdbddfe460a..31b641845d1 100644 --- a/addons/point_of_sale/pos_view.xml +++ b/addons/point_of_sale/pos_view.xml @@ -993,8 +993,8 @@ invoiced - + diff --git a/addons/point_of_sale/wizard/__init__.py b/addons/point_of_sale/wizard/__init__.py index 05bbc0f1f92..e5c11a236dd 100644 --- a/addons/point_of_sale/wizard/__init__.py +++ b/addons/point_of_sale/wizard/__init__.py @@ -29,7 +29,7 @@ import wizard_pos_payment_report import wizard_pos_payment_report_date import wizard_pos_payment_report_user -import wizard_pos_sales_user_current_user + import wizard_pos_details #import wizard_open_statement import wizard_all_closed_cashbox_of_the_day @@ -44,6 +44,7 @@ import pos_box_out import pos_details import pos_sales_user import pos_sales_user_today +import pos_sales_user_current_user # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/wizard/pos_sales_user_current_user.py b/addons/point_of_sale/wizard/pos_sales_user_current_user.py new file mode 100644 index 00000000000..22ac95a5451 --- /dev/null +++ b/addons/point_of_sale/wizard/pos_sales_user_current_user.py @@ -0,0 +1,57 @@ +# -*- 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 . +# +############################################################################## + +import netsvc +from osv import osv,fields +from tools.translate import _ +from mx import DateTime +import time + +class pos_sales_user_today_current_user(osv.osv_memory): + _name = 'pos.sales.user.today.current_user' + _description = 'Sales Details' + + _columns = { + } + + def print_report(self, cr, uid, ids, context={}): + """ + To get the date and print the report + @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 : retrun report + """ + + datas = {'ids' : context.get('active_ids', [])} + res = self.read(cr, uid, ids, [], context) + res = res and res[0] or {} + datas['form'] = res + + return { + 'type':'ir.actions.report.xml', + 'report_name':'pos.sales.user.today.current.user', + 'datas':datas, + } +pos_sales_user_today_current_user() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + 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 new file mode 100644 index 00000000000..5625b70770f --- /dev/null +++ b/addons/point_of_sale/wizard/pos_sales_user_current_user.xml @@ -0,0 +1,40 @@ + + + + + + + Sales for Current User + pos.sales.user.today.current_user + form + +
+ +