Thibault Delavallée (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-pos-tde into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-pos-tde/+merge/92461

This branch holds several fixes for the POS.
- fixed a crash When cancelling a cash register without statement lines
- fixed buggy filters in Reporting search views
- fixed cash register analysis limited to only Administrator
- modified search views for cash registers (there are now new, open, closed 
filters)
- modified redirection when opening cash registers, now leading to correct list 
view instead of web pos interface. Redirection shows now also only opened cash 
registers.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-pos-tde/+merge/92461
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-pos-tde.
=== modified file 'account/account_view.xml'
--- account/account_view.xml	2012-01-31 13:36:57 +0000
+++ account/account_view.xml	2012-02-10 12:50:32 +0000
@@ -524,8 +524,9 @@
             <field name="arch" type="xml">
                 <search string="Search Bank Statements">
                     <group>
-                        <filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
-                        <filter string="Confirmed" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
+                        <filter string="Draft" name="state_draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
+                        <filter string="Open" name="state_open" domain="[('state','=','open')]" icon="terp-document-new"/>
+                        <filter string="Confirmed" name="state_confirmed" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
                         <separator orientation="vertical"/>
                         <field name="date"/>
                         <field name="name"/>

=== modified file 'account_bank_statement_extensions/account_bank_statement.py'
--- account_bank_statement_extensions/account_bank_statement.py	2011-12-23 16:25:28 +0000
+++ account_bank_statement_extensions/account_bank_statement.py	2012-02-10 12:50:32 +0000
@@ -50,9 +50,10 @@
     def button_cancel(self, cr, uid, ids, context=None):
         super(account_bank_statement, self).button_cancel(cr, uid, ids, context=context)
         for st in self.browse(cr, uid, ids, context=context):
-            cr.execute("UPDATE account_bank_statement_line  \
-                SET state='draft' WHERE id in %s ",
-                (tuple([x.id for x in st.line_ids]),))
+            if len(st.line_ids) > 0:
+                cr.execute("UPDATE account_bank_statement_line  \
+                    SET state='draft' WHERE id in %s ",
+                    (tuple([x.id for x in st.line_ids]),))
         return True
 
 account_bank_statement()

=== modified file 'point_of_sale/account_statement_view.xml'
--- point_of_sale/account_statement_view.xml	2011-12-19 16:54:40 +0000
+++ point_of_sale/account_statement_view.xml	2012-02-10 12:50:32 +0000
@@ -114,6 +114,7 @@
             <field name="view_mode">form,tree</field>
             <field name="view_id" ref="account.view_bank_statement_form2"/>
             <field name="search_view_id" ref="account.view_account_bank_statement_filter"/>
+            <field name="context">{'search_default_state_draft': 1, 'search_default_state_open': 1}</field>
         </record>
         <record model="ir.actions.act_window.view" id="act_cash_statement_all_register1">
             <field name="sequence" eval="0"/>

=== modified file 'point_of_sale/report/pos_order_report_view.xml'
--- point_of_sale/report/pos_order_report_view.xml	2011-12-19 16:54:40 +0000
+++ point_of_sale/report/pos_order_report_view.xml	2012-02-10 12:50:32 +0000
@@ -50,7 +50,7 @@
                         <filter icon="terp-go-today"
                              string="Today"
                              name="today"
-                             domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d'))]"
+                             domain="[('date','=', time.strftime('%%Y-%%m-%%d'))]"
                              help="POS ordered created by today"/>
                         <separator orientation="vertical"/>
                         <filter icon="terp-dolar"

=== modified file 'point_of_sale/report/report_cash_register.py'
--- point_of_sale/report/report_cash_register.py	2011-01-14 00:11:01 +0000
+++ point_of_sale/report/report_cash_register.py	2012-02-10 12:50:32 +0000
@@ -56,7 +56,7 @@
                     to_char(s.create_date, 'YYYY') as year,
                     to_char(s.create_date, 'MM') as month,
                     to_char(s.create_date, 'YYYY-MM-DD') as day
-                from account_bank_statement as s where s.user_id=1
+                from account_bank_statement as s
                 group by
                         s.user_id,s.journal_id, s.balance_start, s.balance_end_real,s.state,to_char(s.create_date, 'dd-MM-YYYY'),
                         to_char(s.create_date, 'YYYY'),

=== modified file 'point_of_sale/report/report_cash_register_view.xml'
--- point_of_sale/report/report_cash_register_view.xml	2011-11-10 11:14:48 +0000
+++ point_of_sale/report/report_cash_register_view.xml	2012-02-10 12:50:32 +0000
@@ -43,7 +43,7 @@
                       <filter icon="terp-go-today"
                              string="    Today    "
                              name="today"
-                             domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d'))]"
+                             domain="[('date','=', time.strftime('%%Y-%%m-%%d'))]"
                              help="Cash Analysis created by today"/>
                       <separator orientation="vertical"/>
                         <filter icon="terp-document-new"

=== modified file 'point_of_sale/wizard/pos_open_statement.py'
--- point_of_sale/wizard/pos_open_statement.py	2011-12-30 17:14:02 +0000
+++ point_of_sale/wizard/pos_open_statement.py	2012-02-10 12:50:32 +0000
@@ -50,9 +50,6 @@
 
         for journal in journal_obj.browse(cr, uid, j_ids, context=context):
             ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)], context=context)
-            if len(ids):
-                st_ids += ids
-                continue
 
             if journal.sequence_id:
                 number = sequence_obj.next_by_id(cr, uid, journal.sequence_id.id)
@@ -66,8 +63,8 @@
                 'name': number 
             })
             statement_id = statement_obj.create(cr, uid, data, context=context)
-            st_ids.append(statement_id)
-
+            st_ids.append(int(statement_id))
+            
             if journal.auto_cash:
                 statement_obj.button_open(cr, uid, [statement_id], context)
 
@@ -75,12 +72,20 @@
         tree_id = tree_res and tree_res[1] or False
         form_res = mod_obj.get_object_reference(cr, uid, 'account', 'view_bank_statement_form2')
         form_id = form_res and form_res[1] or False
-        search_id = mod_obj.get_object_reference(cr, uid, 'point_of_sale', 'view_pos_open_cash_statement_filter')
-
+        search_res = mod_obj.get_object_reference(cr, uid, 'account', 'view_account_bank_statement_filter')
+        search_id = search_res and search_res[1] or False
+        
         return {
-            'type': 'ir.actions.client',
-            'tag': 'pos.ui',
+            'type': 'ir.actions.act_window',
+            'name': _('List of Cash Registers'),
+            'view_type': 'form',
+            'view_mode': 'tree, form',
+            'res_model': 'account.bank.statement',
+            'domain': "[('id', 'in', " + str(st_ids) + ")]",
+            'views': [(tree_id, 'tree'), (form_id, 'form')],
+            'search_view_id': search_id,
         }
+    
 pos_open_statement()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to