[MERGE] 5.0.0-server
authorStephane Wirtel <stephane@tinyerp.com>
Fri, 6 Feb 2009 20:07:00 +0000 (21:07 +0100)
committerStephane Wirtel <stephane@tinyerp.com>
Fri, 6 Feb 2009 20:07:00 +0000 (21:07 +0100)
bzr revid: stephane@tinyerp.com-20090206200700-3x6vlk0k6j79l1bv

addons/account/account_move_line.py
addons/account/demo/account_minimal.xml
addons/hr_attendance/report/bymonth.py
addons/hr_attendance/report/timesheet.py
addons/hr_attendance/wizard/print_bymonth.py
addons/l10n_be/account_pcmn_belgium.xml
bin/tools/config.py

index 7f86f86..0dacc36 100644 (file)
@@ -936,6 +936,8 @@ class account_move_line(osv.osv):
             del vals['account_tax_id']
 
         if not is_new_move and 'date' in vals:
+            if context and ('__last_update' in context):
+                del context['__last_update']
             self.pool.get('account.move').write(cr, uid, [move_id], {'date':vals['date']}, context=context)
         if check:
             tmp = self.pool.get('account.move').validate(cr, uid, [vals['move_id']], context)
index a8c8b75..8ab449a 100644 (file)
@@ -167,8 +167,8 @@ your own chart of account.
             <field name="type">sale</field>
             <field name="view_id" ref="account_journal_view"/>
             <field name="sequence_id" ref="sequence_sale_journal"/>
-            <field model="account.account" name="default_credit_account_id" search="[('type','=','receivable')]"/>
-            <field model="account.account" name="default_debit_account_id" search="[('type','=','receivable')]"/>
+            <field model="account.account" name="default_credit_account_id" ref="a_sale"/>
+            <field model="account.account" name="default_debit_account_id" ref="a_sale"/>
             <field name="user_id" ref="base.user_root"/>
         </record>
         <record id="refund_sales_journal" model="account.journal">
@@ -178,8 +178,8 @@ your own chart of account.
             <field name="refund_journal">True</field>
             <field name="view_id" ref="account_journal_view"/>
             <field name="sequence_id" ref="sequence_sale_journal"/>
-            <field model="account.account" name="default_credit_account_id" search="[('type','=','receivable')]"/>
-            <field model="account.account" name="default_debit_account_id" search="[('type','=','receivable')]"/>
+            <field model="account.account" name="default_credit_account_id" ref="a_sale"/>
+            <field model="account.account" name="default_debit_account_id" ref="a_sale"/>
             <field name="user_id" ref="base.user_root"/>
         </record>
 
@@ -189,8 +189,8 @@ your own chart of account.
             <field name="type">purchase</field>
             <field name="view_id" ref="account_journal_view"/>
             <field name="sequence_id" ref="sequence_purchase_journal"/>
-            <field model="account.account" name="default_debit_account_id" search="[('type','=','payable')]"/>
-            <field model="account.account" name="default_credit_account_id" search="[('type','=','payable')]"/>
+            <field model="account.account" name="default_debit_account_id" ref="a_expense"/>
+            <field model="account.account" name="default_credit_account_id" ref="a_expense"/>
             <field name="user_id" ref="base.user_root"/>
         </record>
         <record id="refund_expenses_journal" model="account.journal">
@@ -200,8 +200,8 @@ your own chart of account.
             <field name="refund_journal">True</field>
             <field name="view_id" ref="account_journal_view"/>
             <field name="sequence_id" ref="sequence_purchase_journal"/>
-            <field model="account.account" name="default_debit_account_id" search="[('type','=','payable')]"/>
-            <field model="account.account" name="default_credit_account_id" search="[('type','=','payable')]"/>
+            <field model="account.account" name="default_debit_account_id" ref="a_expense"/>
+            <field model="account.account" name="default_credit_account_id" ref="a_expense"/>
             <field name="user_id" ref="base.user_root"/>
         </record>
 
index bce9bd4..d0715b4 100644 (file)
@@ -65,7 +65,7 @@ class report_custom(report_rml):
                 where att.name between %s and %s and emp.id = %s
                 order by att.name
                 '''
-                cr.execute(sql, (today, tomor, employee_id))
+                cr.execute(sql, (today.strftime('%Y-%m-%d %H:%M:%S'), tomor.strftime('%Y-%m-%d %H:%M:%S'), employee_id))
                 attendences = cr.dictfetchall()
                 wh = 0
                 # Fake sign ins/outs at week ends, to take attendances across week ends into account
index a3a370b..feec774 100644 (file)
@@ -46,13 +46,9 @@ class report_custom(report_rml):
                service = netsvc.LocalService('object_proxy')
 
                start_date = DateTime.strptime(datas['form']['init_date'], '%Y-%m-%d')
-               print "XXX start_date %s" % start_date
                end_date = DateTime.strptime(datas['form']['end_date'], '%Y-%m-%d')
-               print "XXX end_date %s" % end_date
                first_monday = start_date - DateTime.RelativeDateTime(days=start_date.day_of_week)
-               print "XXX first_monday %s" % first_monday              
                last_monday = end_date + DateTime.RelativeDateTime(days=7 - end_date.day_of_week)
-               print "XXX last_monday %s" % last_monday                
 
                if last_monday < first_monday:
                        first_monday, last_monday = last_monday, first_monday
@@ -60,7 +56,6 @@ class report_custom(report_rml):
                user_xml = []
 
                for employee_id in ids:
-                       print "XXX employee_id %s" % employee_id
                        emp = service.execute(cr.dbname, uid, 'hr.employee', 'read', [employee_id], ['id', 'name'])[0]
                        monday, n_monday = first_monday, first_monday + one_week
                        stop, week_xml = False, []
@@ -80,10 +75,8 @@ class report_custom(report_rml):
                                order by att.name
                                '''
                                for idx in range(7):
-                                       print sql % (monday, monday + DateTime.RelativeDateTime(days=idx+1), employee_id)
-                                       cr.execute(sql, (monday, monday + DateTime.RelativeDateTime(days=idx+1), employee_id))
+                                       cr.execute(sql, (monday.strftime('%Y-%m-%d %H:%M:%S'), (monday + DateTime.RelativeDateTime(days=idx+1)).strftime('%Y-%m-%d %H:%M:%S'), employee_id))
                                        attendances = cr.dictfetchall()
-                                       print "attendances %s" %attendances
                                        week_wh = {}
                        # Fake sign ins/outs at week ends, to take attendances across week ends into account
                        # XXX this is wrong for the first sign-in ever and the last sign out to this date 
@@ -109,7 +102,6 @@ class report_custom(report_rml):
                                week_repr.append('<worked>%sh%02d</worked>' % to_hour(reduce(lambda x,y:x+y, week_wh.values(), 0)))
                                week_repr.append('</total>')
                                week_repr.append('</week>')
-                               print "XXX week_repr %s" % week_repr
                                if len(week_repr) > 21: # 21 = minimal length of week_repr
                                        week_xml.append('\n'.join(week_repr))
                                
@@ -121,7 +113,6 @@ class report_custom(report_rml):
                %s
                </report>
                ''' % '\n'.join(user_xml)
-               print "XXX xml %s" % xml
                return self.post_process_xml_data(cr, uid, xml, context)
 
 report_custom('report.hr.timesheet.allweeks', 'hr.employee', '', 'addons/hr_attendance/report/timesheet.xsl')
index 0261d94..4e28055 100644 (file)
@@ -31,15 +31,26 @@ _date_form = '''<?xml version="1.0"?>
 </form>'''
 
 _date_fields = {
-    'month' : {'string' : 'Month', 'type' : 'selection', 'selection' : [(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], 'required':True },
-    'year' : {'string' : 'Year', 'type' : 'integer', 'required':True, 'default' : lambda *a: time.gmtime()[0]},
+    'month' : {
+               'string' : 'Month',
+               'type' : 'selection',
+               'selection' : [(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')],
+               'required':True,
+               'default' : lambda * a: time.gmtime()[1]
+               },
+    'year' : {
+              'string' : 'Year',
+              'type' : 'integer',
+              'required':True,
+              'default' : lambda * a: time.gmtime()[0]
+              },
 }
 
 class wiz_bymonth(wizard.interface):
     states = {
         'init': {
             'actions': [],
-            'result': {'type': 'form', 'arch':_date_form, 'fields':_date_fields, 'state':[('print','Print Timesheet'),('end','Cancel')]}
+            'result': {'type': 'form', 'arch':_date_form, 'fields':_date_fields, 'state':[('print', 'Print Timesheet'), ('end', 'Cancel')]}
         },
         'print': {
             'actions': [],
index b5d1835..d3ec2a7 100644 (file)
         </record>
         <record id="vat_code_a45" model="account.tax.code.template">
             <field name="code">45</field>
-            <field name="name">Operations avec TVA due par le concotractant</field>
+            <field name="name">Operations avec TVA due par le cocontractant</field>
             <field name="parent_id" ref="vat_code_out"/>
         </record>
         <record id="vat_code_a46" model="account.tax.code.template">
index 27bdf61..e8e3e19 100644 (file)
@@ -272,8 +272,8 @@ class configmanager(object):
         if self.options['db_password']:
             if sys.platform == 'win32' and not self.options['db_host']:
                 self.options['db_host'] = 'localhost'
-            if self.options['db_host']:
-                self._generate_pgpassfile()
+            #if self.options['db_host']:
+            #    self._generate_pgpassfile()
 
         if opt.save:
             self.save()