[IMP]point_of_sale :convert the wizard of pos_sales_user_current_user into osv_memory
bzr revid: sbh@tinyerp.com-20100319131721-q68nioexgiwlxrk7
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -993,8 +993,8 @@ invoiced
|
||||
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_pos_payment_report_user"
|
||||
id="menu_pos_payment_report_user" parent="menu_trans_pos_tree_today" type="wizard" sequence="6" groups="base.group_extended"/>
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_pos_sales_user_today_current_user"
|
||||
id="menu_pos_sales_user_today_current_user" parent="menu_cashboxes_by_day" type="wizard" sequence="7"/>
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_sales_user_today_current_user"
|
||||
id="menu_pos_sales_user_today_current_user" parent="menu_cashboxes_by_day" sequence="7"/>
|
||||
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_details"
|
||||
id="menu_pos_details" parent="menu_cashboxes_by_day" />
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
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:
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Sales for Current User -->
|
||||
|
||||
<record id="view_pos_sales_user_today_current_user" model="ir.ui.view">
|
||||
<field name="name">Sales for Current User</field>
|
||||
<field name="model">pos.sales.user.today.current_user</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Sales for Current User">
|
||||
<group col="2" colspan="4">
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Close" />
|
||||
<button name="print_report" string="Print Report"
|
||||
colspan="1" type="object" icon="gtk-print" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_report_pos_sales_user_today_current_user" model="ir.actions.act_window">
|
||||
<field name="name">Sales for Current User</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">pos.sales.user.today.current_user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<!-- <act_window name="POS Details"
|
||||
res_model="pos.details"
|
||||
src_model="pos.order"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_report_pos_details"/> -->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,40 +0,0 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import pooler
|
||||
import netsvc
|
||||
import wizard
|
||||
import time
|
||||
|
||||
|
||||
class wizard_pos_sales_user_today_current_user(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type':'print', 'report':'pos.sales.user.today.current.user', 'state':'end'}
|
||||
},
|
||||
}
|
||||
|
||||
wizard_pos_sales_user_today_current_user('pos.sales.user.today.current.user')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
Reference in New Issue
Block a user