[Add] Point_of_sale: Add the report of pos_details

bzr revid: sbh@tinyerp.com-20100318091838-vpfesi6lv4br700o
This commit is contained in:
sbh (Open ERP) 2010-03-18 14:48:38 +05:30
parent 56383ef053
commit fad70b1cb2
5 changed files with 96 additions and 0 deletions

View File

@ -51,6 +51,7 @@ Main features :
'wizard/pos_close_statement.xml',
'wizard/pos_box_entries.xml',
'wizard/pos_box_out.xml',
'wizard/pos_details.xml',
'pos_view.xml',
'pos_sequence.xml',
'posrule_data.xml',

View File

@ -995,6 +995,7 @@ invoiced
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="wizard_pos_details"
id="menu_pos_details" parent="menu_cashboxes_by_day" type="wizard" />

View File

@ -42,5 +42,6 @@ import pos_open_statement
import pos_close_statement
import pos_box_entries
import pos_box_out
import pos_details
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,59 @@
# -*- 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_details(osv.osv_memory):
_name = 'pos.details'
_description = 'Order Details'
_columns = {
'date_start': fields.datetime('Date Start',),
'date_end': fields.datetime('Date End'),
}
def print_report(self, cr, uid, ids, context=None):
"""
@summary: 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
"""
# reportname='report.pos.details'
# srv = netsvc.LocalService(reportname)
## pdf, _ = srv.create(cr, uid, ids, {}, context=context)
return {
'type' : 'ir.actions.report.xml',
'report_name':'pos.details',
}
pos_details()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- pos.details -->
<record id="view_pos_details" model="ir.ui.view">
<field name="name">POS Details</field>
<field name="model">pos.details</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Pos Details :">
<group col="2" colspan="4">
<field name="date_start"/>
<field name="date_end"/>
<button icon='gtk-cancel' special="cancel"
string="Close" />
<button name="print_report" string="Print Report"
colspan="1" type="object" icon="gtk-ok" />
</group>
</form>
</field>
</record>
<act_window name="POS Details "
res_model="pos.details"
src_model="pos.order"
view_mode="form"
target="new"
context="{'record_id' : active_id}"
key2="client_action_multi"
id="action_view_pos_details"/>
</data>
</openerp>