[IMP] point_of_sale: fix the problem of wizard and add the pos_payment
authorsbh (Open ERP) <sbh@tinyerp.com>
Fri, 19 Mar 2010 15:00:20 +0000 (20:30 +0530)
committersbh (Open ERP) <sbh@tinyerp.com>
Fri, 19 Mar 2010 15:00:20 +0000 (20:30 +0530)
bzr revid: sbh@tinyerp.com-20100319150020-9z7bnkmb93uw3508

12 files changed:
addons/point_of_sale/__terp__.py
addons/point_of_sale/pos_view.xml
addons/point_of_sale/statement_view.xml
addons/point_of_sale/wizard/__init__.py
addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.xml [new file with mode: 0644]
addons/point_of_sale/wizard/pos_payment_report.py [new file with mode: 0644]
addons/point_of_sale/wizard/pos_payment_report.xml [new file with mode: 0644]
addons/point_of_sale/wizard/pos_payment_report_date_view.xml
addons/point_of_sale/wizard/pos_payment_report_user.xml [new file with mode: 0644]
addons/point_of_sale/wizard/pos_payment_report_user_view.xml
addons/point_of_sale/wizard/pos_receipt_view.xml [new file with mode: 0644]
addons/point_of_sale/wizard/wizard_pos_payment_report.py [deleted file]

index d307024..e2fcdff 100644 (file)
@@ -58,7 +58,9 @@ Main features :
         'wizard/all_closed_cashbox_of_the_day.xml',  
         'wizard/pos_sales_user_current_user.xml',
         'wizard/pos_sale_user_today.xml',      
-        'wizard/pos_receipt_view.xml',    
+        'wizard/pos_receipt_view.xml',  
+        'wizard/pos_payment_report_user.xml',  
+        'wizard/pos_payment_report.xml',
         'pos_report.xml',
         'pos_wizard.xml',
         'pos_view.xml',
index 2d4be75..9c15b5a 100644 (file)
@@ -993,11 +993,11 @@ invoiced
                <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"/>
+               <menuitem icon="STOCK_PRINT" action="action_report_pos_payment_repport_date"
+                               id="menu_pos_payment_report_date" parent="menu_trans_pos_tree"  sequence="5" groups="base.group_extended"/>
 
-               <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="action_report_pos_payment_report_user"
+                               id="menu_pos_payment_report_user" parent="menu_trans_pos_tree_today" sequence="6" groups="base.group_extended"/>
                <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"/>
 
index e6ff76e..19e7bdc 100644 (file)
        <menuitem icon="STOCK_PRINT"
                                 action="action_report_all_closed_cashbox_of_the_day"
                                 id="menu_all_closed_cashbox_of_the_day"
-                                parent="menu_statement_tree_all"
-                                type="wizard"/>
+                                parent="menu_statement_tree_all"/>
 
                <menuitem
             name="Close Register" parent="point_of_sale.menu_point_config"
index fc3f4a4..d4f8264 100644 (file)
@@ -25,12 +25,11 @@ import wizard_default_journal
 import wizard_scan_product
 
 import wizard_return
-import wizard_pos_payment_report
 
-import pos_payment_report_user
-import pos_payment_report_date
-import wizard_pos_sales_user_current_user
-import wizard_pos_details
+
+
+
+
 #import wizard_open_statement
 
 import pos_add_product
@@ -47,6 +46,9 @@ import pos_sales_user_today
 import pos_sales_user_current_user
 import all_closed_cashbox_of_the_day
 import pos_receipt
+import pos_payment_report_user
+import pos_payment_report_date
+import pos_payment_report
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
diff --git a/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.xml b/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.xml
new file mode 100644 (file)
index 0000000..e78ef5c
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>        
+        <!--   pos.details -->
+        
+               <record id="view_all_closed_cashbox_of_the_day" model="ir.ui.view">
+            <field name="name">all closed cashbox of the day</field>
+            <field name="model">all.closed.cashbox.of.the.day</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="All Cashboxes Of the day :">
+                               <button icon='gtk-cancel' special="cancel"
+                                       string="Close" />
+                               <button name="print_report" string="Print Report"
+                                       colspan="1" type="object" icon="gtk-print" />                             
+                </form>
+            </field>
+        </record>
+
+       
+               <record id="action_report_all_closed_cashbox_of_the_day" model="ir.actions.act_window">
+            <field name="name">All Cashboxes Of the day</field>
+            <field name="res_model">all.closed.cashbox.of.the.day</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+               <field name="target">new</field>
+        </record>      
+               
+       </data>
+</openerp>             
diff --git a/addons/point_of_sale/wizard/pos_payment_report.py b/addons/point_of_sale/wizard/pos_payment_report.py
new file mode 100644 (file)
index 0000000..12cc044
--- /dev/null
@@ -0,0 +1,74 @@
+# -*- 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# -*- 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_payment_report(osv.osv_memory):
+    _name = 'pos.payment.report'
+    _description = 'Payment Report'
+
+    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', [])}
+        return { 
+            'type':'ir.actions.report.xml',
+            'report_name':'pos.payment.report',
+            'datas':datas,               
+       }
+pos_payment_report()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_payment_report.xml b/addons/point_of_sale/wizard/pos_payment_report.xml
new file mode 100644 (file)
index 0000000..593068a
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>        
+        <!--   pos.details -->
+        
+               <record id="view_pos_payment_report" model="ir.ui.view">
+            <field name="name">Payment Report</field>
+            <field name="model">pos.payment.report</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-print" />
+                       </group>
+                </form>
+            </field>
+        </record>
+
+        <record id="action_pos_payment_report" model="ir.actions.act_window">
+            <field name="name">Payment Report</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">pos.details</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="target">new</field>
+        </record>
+
+        
+       </data>
+</openerp>             
\ No newline at end of file
index 3d4655f..7a5bf58 100644 (file)
@@ -1,29 +1,30 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
-                <data>
-                        <record id="pos_payment_report_date_form" model="ir.ui.view">
-                                <field name="name">pos.payment.report.date.form</field>
-                                <field name="model">pos.payment.report.date</field>
-                                <field name="type">form</field>
-                                <field name="arch" type="xml">
-                                <form string="Sale by Date and User">
-                                            <field name="date_start"/>
-                                            <field name="date_end"/>
-                                            <field name="user_id"/>
-                                                <button icon='gtk-cancel' special="cancel"
-                                                string="Close" />
-                                                <button name="print_report" string="Print Report"
-                                                colspan="1" type="object" icon="gtk-ok" />
-                                </form>
-                                </field>
-                        </record>
-                        
-                        <act_window name="Sales lines Report"
-                        res_model="pos.payment.report.date"
-                        src_model="pos.order"
-                        view_mode="form"
-                        target="new"        
-                        key2="client_action_multi"    
-                        id="action_report_pos_payment_repport_date"/> 
-                </data>
+       <data>
+               <record id="pos_payment_report_date_form" model="ir.ui.view">
+                       <field name="name">pos.payment.report.date.form</field>
+                       <field name="model">pos.payment.report.date</field>
+                       <field name="type">form</field>
+                       <field name="arch" type="xml">
+                       <form string="Sale by Date and User">
+                                   <field name="date_start"/>
+                                   <field name="date_end"/>
+                                   <field name="user_id"/>
+                                       <button icon='gtk-cancel' special="cancel"
+                                       string="Close" />
+                                       <button name="print_report" string="Print Report"
+                                       colspan="1" type="object" icon="gtk-ok" />
+                       </form>
+                       </field>
+               </record>
+
+        <record id="action_report_pos_payment_repport_date" model="ir.actions.act_window">
+            <field name="name">Sales lines Report</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">pos.payment.report.date</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="target">new</field>
+        </record>
+               </data>
 </openerp>              
diff --git a/addons/point_of_sale/wizard/pos_payment_report_user.xml b/addons/point_of_sale/wizard/pos_payment_report_user.xml
new file mode 100644 (file)
index 0000000..bccfe92
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>        
+        <!--   pos.details -->
+        
+               <record id="view_pos_payment_report" model="ir.ui.view">
+            <field name="name">Pyament Report</field>
+            <field name="model">pos.payment.report</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Pyament Report ">
+                                   <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_payment" model="ir.actions.act_window">
+            <field name="name">Pyament Report</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">pos.payment.report</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>             
\ No newline at end of file
index 463d864..f2ead0b 100644 (file)
@@ -1,27 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
-                <data>
-                        <record id="pos_payment_report_user_form" model="ir.ui.view">
-                                <field name="name">pos.payment.report.user.form</field>
-                                <field name="model">pos.payment.report.user</field>
-                                <field name="type">form</field>
-                                <field name="arch" type="xml">
-                                <form string="Sale by User">
-                                            <field name="user_id"/>
-                                                <button icon='gtk-cancel' special="cancel"
-                                                string="Close" />
-                                                <button name="print_report" string="Print Report"
-                                                colspan="1" type="object" icon="gtk-ok" />
-                                </form>
-                                </field>
-                        </record>
-                        
-                        <act_window name="Sales lines by Users"
-                        res_model="pos.payment.report.user"
-                        src_model="pos.order"
-                        view_mode="form"
-                        target="new"        
-                        key2="client_action_multi"    
-                        id="action_report_pos_payment_report_user"/> 
-                </data>
+       <data>
+                       <record id="pos_payment_report_user_form" model="ir.ui.view">
+                           <field name="name">pos.payment.report.user.form</field>
+                           <field name="model">pos.payment.report.user</field>
+                           <field name="type">form</field>
+                           <field name="arch" type="xml">
+                           <form string="Sale by User">
+                                       <field name="user_id"/>
+                                           <button icon='gtk-cancel' special="cancel"
+                                           string="Close" />
+                                           <button name="print_report" string="Print Report"
+                                           colspan="1" type="object" icon="gtk-ok" />
+                           </form>
+                           </field>
+                       </record>
+
+        <record id="action_report_pos_payment_report_user" model="ir.actions.act_window">
+            <field name="name">Sales lines by Userst</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">pos.payment.report.user</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="target">new</field>
+        </record>
+               </data>         
 </openerp>              
diff --git a/addons/point_of_sale/wizard/pos_receipt_view.xml b/addons/point_of_sale/wizard/pos_receipt_view.xml
new file mode 100644 (file)
index 0000000..5839e4f
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<openerp>\r
+    <data>        \r
+        <!--   pos.details -->\r
+        \r
+               <record id="view_pos_receipt" model="ir.ui.view">\r
+            <field name="name">Receipt</field>\r
+            <field name="model">pos.receipt</field>\r
+            <field name="type">form</field>\r
+            <field name="arch" type="xml">\r
+                <form string="Receipt :">\r
+                               <button icon='gtk-cancel' special="cancel"
+                                       string="Close" />
+                               <button name="print_report" string="Print Report"
+                                       colspan="1" type="object" icon="gtk-ok" />                                \r
+                </form>\r
+            </field>\r
+        </record>\r
+\r
+       <act_window name="Fill Inventory"                   
+                   res_model="pos.receipt"
+                   src_model="pos.order"
+                   view_mode="form"
+                   target="new"        
+            key2="client_action_multi"    
+                   id="action_report_pos_receipt"/>    \r
+       
+               <!--record id="action_report_pos_receipt" model="ir.actions.act_window">
+            <field name="name">Receipt</field>
+            <field name="res_model">pos.receipt</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>\r
+               <field name="target">new</field>
+        </record-->    
+               \r
+       </data>\r
+</openerp>             
diff --git a/addons/point_of_sale/wizard/wizard_pos_payment_report.py b/addons/point_of_sale/wizard/wizard_pos_payment_report.py
deleted file mode 100644 (file)
index 1f6ed1a..0000000
+++ /dev/null
@@ -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_payment_report(wizard.interface):
-    states = {
-        'init': {
-            'actions': [],
-            'result': {'type':'print', 'report':'pos.payment.report', 'state':'end'}
-             },
-    }
-
-wizard_pos_payment_report('pos.payment.report')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-