2010-03-18 09:18:38 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
##############################################################################
|
2010-03-29 12:38:53 +00:00
|
|
|
#
|
2010-03-18 09:18:38 +00:00
|
|
|
# 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
|
2010-03-29 12:38:53 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2010-03-18 09:18:38 +00:00
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
|
2010-10-26 13:40:31 +00:00
|
|
|
import time
|
2012-12-06 14:56:32 +00:00
|
|
|
from openerp.osv import osv, fields
|
2010-03-29 12:38:53 +00:00
|
|
|
|
[REM] removed details_summary, sales_user, sales_user_today, payment_user reports, wizards and rml
[REM] dead code: pos_box_entries.py/xml, pos_box_out.py/xml, pos_return_view.py/xml
[ADD] lines, invoice, cashbox of the day, payment, receipt, users product reports converted to QWeb. Added YML tests for the bank statement reports.
[FIX] closed cashbox of the day sql using old fields in its queries, yml test not correctly generating an invoice from a pos order
bzr revid: sle@openerp.com-20140414104954-xj10wi640tyr3ufe
2014-04-14 10:49:54 +00:00
|
|
|
|
2010-03-18 09:18:38 +00:00
|
|
|
class pos_details(osv.osv_memory):
|
|
|
|
_name = 'pos.details'
|
2010-03-19 06:36:44 +00:00
|
|
|
_description = 'Sales Details'
|
2010-03-18 09:18:38 +00:00
|
|
|
|
|
|
|
_columns = {
|
2010-03-29 12:38:53 +00:00
|
|
|
'date_start': fields.date('Date Start', required=True),
|
2011-09-13 06:20:36 +00:00
|
|
|
'date_end': fields.date('Date End', required=True),
|
2012-05-04 12:22:06 +00:00
|
|
|
'user_ids': fields.many2many('res.users', 'pos_details_report_user_rel', 'user_id', 'wizard_id', 'Salespeople'),
|
2010-03-18 09:18:38 +00:00
|
|
|
}
|
2010-03-22 05:46:37 +00:00
|
|
|
_defaults = {
|
2015-05-04 08:30:12 +00:00
|
|
|
'date_start': fields.date.context_today,
|
|
|
|
'date_end': fields.date.context_today,
|
2010-03-29 12:38:53 +00:00
|
|
|
}
|
|
|
|
|
2010-10-26 13:40:31 +00:00
|
|
|
def print_report(self, cr, uid, ids, context=None):
|
2010-03-29 12:38:53 +00:00
|
|
|
"""
|
|
|
|
To get the date and print the report
|
2010-03-18 18:09:22 +00:00
|
|
|
@param self: The object pointer.
|
|
|
|
@param cr: A database cursor
|
|
|
|
@param uid: ID of the user currently logged in
|
2010-03-29 12:38:53 +00:00
|
|
|
@param context: A standard dictionary
|
2010-03-18 18:09:22 +00:00
|
|
|
@return : retrun report
|
|
|
|
"""
|
2010-10-26 13:40:31 +00:00
|
|
|
if context is None:
|
|
|
|
context = {}
|
2010-03-29 12:38:53 +00:00
|
|
|
datas = {'ids': context.get('active_ids', [])}
|
2011-09-13 06:20:36 +00:00
|
|
|
res = self.read(cr, uid, ids, ['date_start', 'date_end', 'user_ids'], context=context)
|
2010-03-29 12:38:53 +00:00
|
|
|
res = res and res[0] or {}
|
2010-03-18 12:00:32 +00:00
|
|
|
datas['form'] = res
|
2010-12-29 13:43:55 +00:00
|
|
|
if res.get('id',False):
|
|
|
|
datas['ids']=[res['id']]
|
[REM] removed details_summary, sales_user, sales_user_today, payment_user reports, wizards and rml
[REM] dead code: pos_box_entries.py/xml, pos_box_out.py/xml, pos_return_view.py/xml
[ADD] lines, invoice, cashbox of the day, payment, receipt, users product reports converted to QWeb. Added YML tests for the bank statement reports.
[FIX] closed cashbox of the day sql using old fields in its queries, yml test not correctly generating an invoice from a pos order
bzr revid: sle@openerp.com-20140414104954-xj10wi640tyr3ufe
2014-04-14 10:49:54 +00:00
|
|
|
return self.pool['report'].get_action(cr, uid, [], 'point_of_sale.report_detailsofsales', data=datas, context=context)
|
2010-03-29 12:38:53 +00:00
|
|
|
|
2010-03-18 09:18:38 +00:00
|
|
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|