[IMP]point_of_sale :convert the wizard of pos_sales_user_today into osv_memory

bzr revid: sbh@tinyerp.com-20100319125551-cp3nkwcu5e40w15a
This commit is contained in:
sbh (Open ERP) 2010-03-19 18:25:51 +05:30
parent 92b994847d
commit d513008d50
8 changed files with 71 additions and 76 deletions

View File

@ -53,7 +53,8 @@ Main features :
'wizard/pos_box_entries.xml',
'wizard/pos_box_out.xml',
'wizard/pos_sales_user.xml',
'wizard/all_closed_cashbox_of_the_day.xml',
#'wizard/all_closed_cashbox_of_the_day.xml',
'wizard/pos_sale_user_today.xml',
'pos_report.xml',
'pos_wizard.xml',
'pos_view.xml',

View File

@ -985,8 +985,8 @@ invoiced
id="menu_pos_sales_user" parent="menu_trans_pos_tree" sequence="3" groups="base.group_extended" />
<menuitem icon="STOCK_PRINT" action="wizard_pos_sales_user_today"
id="menu_pos_sales_user_today" parent="menu_trans_pos_tree_today" type="wizard" sequence="2" groups="base.group_extended"/>
<menuitem icon="STOCK_PRINT" action="action_pos_sales_user_today"
id="menu_pos_sales_user_today" parent="menu_trans_pos_tree_today" sequence="2" groups="base.group_extended"/>
<menuitem icon="STOCK_PRINT" action="wizard_pos_payment_report_date"
id="menu_pos_payment_report_date" parent="menu_trans_pos_tree" type="wizard" sequence="5" groups="base.group_extended"/>
@ -997,7 +997,7 @@ invoiced
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_details"
id="menu_pos_details" parent="menu_cashboxes_by_day" type="action" />
id="menu_pos_details" parent="menu_cashboxes_by_day" />
</data>

View File

@ -40,8 +40,8 @@
<wizard id="wizard_pos_sales_user" menu="False"
model="pos.order" name="pos.sales.user" string="Sales Report"/>-->
<wizard id="wizard_pos_sales_user_today" menu="False"
model="pos.order" name="pos.sales.user.today" string="Sales by Users"/>
<!-- <wizard id="wizard_pos_sales_user_today" menu="False"
model="pos.order" name="pos.sales.user.today" string="Sales by Users"/>-->
<wizard id="wizard_pos_payment_report_date" menu="False"
model="pos.order" name="pos.payment.report.date" string="Sales lines Report"/>

View File

@ -36,7 +36,7 @@ class pos_sales_user_today(report_sxw.rml_parse):
def _get_data(self,form):
data={}
ids = form['user_id'][0][-1]
ids = form['user_id']
idss = map(str, ids)
self.cr.execute("select po.name as pos,po.date_order,ru.name as user,po.state,rc.name " \

View File

@ -26,7 +26,7 @@ import wizard_scan_product
import wizard_receipt
import wizard_return
import wizard_pos_payment_report
import wizard_pos_sales_user_today
import wizard_pos_payment_report_date
import wizard_pos_payment_report_user
import wizard_pos_sales_user_current_user
@ -42,6 +42,8 @@ import pos_close_statement
import pos_box_entries
import pos_box_out
import pos_details
import pos_sales_user
import pos_sales_user_today
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -15,7 +15,7 @@
<button icon='gtk-cancel' special="cancel"
string="Close" />
<button name="print_report" string="Print Report"
colspan="1" type="object" icon="gtk-ok" />
colspan="1" type="object" icon="gtk-print" />
</group>
</form>
</field>
@ -23,7 +23,7 @@
<record id="action_report_pos_details" model="ir.actions.act_window">
<field name="name">Print Report</field>
<field name="name">Sale Details</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">pos.details</field>
<field name="view_type">form</field>

View File

@ -0,0 +1,58 @@
# -*- 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(osv.osv_memory):
_name = 'pos.sales.user.today'
_description = 'Sales User Today'
_columns = {
'user_id': fields.many2many('res.users', 'sale_user_rel_today', 'user_id', 'uid', 'Salesman'),
}
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, ['user_id'], context)
res = res and res[0] or {}
datas['form'] = res
return {
'type':'ir.actions.report.xml',
'report_name':'pos.sales.user.today',
'datas':datas,
}
pos_sales_user_today()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,66 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 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/>.
#
##############################################################################
from osv import fields
from osv import osv
import time
import ir
from mx import DateTime
import datetime
import pooler
from tools import config
import wizard
import netsvc
sale_pos_res_form= """<?xml version="1.0"?>
<form string="Sale by User">
<field name="user_id" />
</form>
"""
sale_pos_res_field= {
'user_id': {'string': 'Salesman', 'type': 'many2many', 'relation': 'res.users', 'required': True},
}
class wizard_pos_sales_user_today(wizard.interface):
states = {
'init' : {
'actions' : [],
'result' : {'type' : 'form',
'arch' : sale_pos_res_form,
'fields' : sale_pos_res_field,
'state' : [('end', 'Cancel','gtk-cancel'),('print_report', 'Print Report','gtk-print') ]}
},
'print_report' : {
'actions' : [],
'result' : {'type' : 'print',
'report':'pos.sales.user.today',
'state' : 'end'}
},
}
wizard_pos_sales_user_today('pos.sales.user.today')