From 28c4e5530f062cc7c618c67810220e5126330d5e Mon Sep 17 00:00:00 2001 From: Stuart Longland Date: Fri, 23 Mar 2012 15:21:46 +1000 Subject: [PATCH 001/110] faces: Fix 24-hour and end-at-midnight timespans In cases where a working day either: - Spans 24 hours or - ends at midnight the time span calculation code incorrectly calculates the time of that day, either stating that the day is 0 minutes long, or worse, is negative. The following patch addresses this. Non-working days are specified using the Python 'None', or 'False' values, rather than specifying the same start and end time, as the latter will now be interpreted as a 24-hour period. bzr revid: me@vk4msl.yi.org-20120323052146-vosvz50lg12n7e1i --- addons/resource/faces/pcalendar.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/resource/faces/pcalendar.py b/addons/resource/faces/pcalendar.py index c82c49d4816..4b023911b1e 100644 --- a/addons/resource/faces/pcalendar.py +++ b/addons/resource/faces/pcalendar.py @@ -895,7 +895,16 @@ class Calendar(object): def _recalc_working_time(self): def slot_sum_time(day): slots = self.working_times.get(day, DEFAULT_WORKING_DAYS[day]) - return sum(map(lambda slot: slot[1] - slot[0], slots)) + def time_diff(times): + (start, end) = times + if end == start: + return 24*60 # 24 hours + + diff = end - start + if end < start: + diff += (24*60) + return diff + return sum(map(time_diff, slots)) self.day_times = map(slot_sum_time, range(0, 7)) self.week_time = sum(self.day_times) From 5c4dba40f74f09d5ff0856fb9904f61ff792656e Mon Sep 17 00:00:00 2001 From: Stuart Longland Date: Fri, 23 Mar 2012 15:22:50 +1000 Subject: [PATCH 002/110] resource: Convert working hours to UTC Faces assumes that all times are given in the same timezone. OpenERP uses UTC internally, and uses UTC when communicating task and project start/end times to faces. It unfortunately gives the working hours in local time. The following converts the time zone to UTC, assuming that the working hours are in the time zone of the currently logged-in user. (This will have to be fixed to convert each resources' calendar from the resource's local time zone to UTC.) bzr revid: me@vk4msl.yi.org-20120323052250-m03bth2dy755hw1p --- addons/resource/resource.py | 145 ++++++++++++++++++++++++------------ 1 file changed, 99 insertions(+), 46 deletions(-) diff --git a/addons/resource/resource.py b/addons/resource/resource.py index fb3d8c0980e..b3bfcea9664 100644 --- a/addons/resource/resource.py +++ b/addons/resource/resource.py @@ -19,7 +19,7 @@ # ############################################################################## -from datetime import datetime, timedelta +from datetime import datetime, timedelta, time, date import math from faces import * from osv import fields, osv @@ -28,6 +28,7 @@ from tools.translate import _ from itertools import groupby from operator import itemgetter +import pytz class resource_calendar(osv.osv): _name = "resource.calendar" @@ -279,8 +280,9 @@ def convert_timeformat(time_string): hour_part = split_list[0] mins_part = split_list[1] round_mins = int(round(float(mins_part) * 60,-2)) - converted_string = hour_part + ':' + str(round_mins)[0:2] - return converted_string + return time(int(hour_part), round_mins) + #converted_string = hour_part + ':' + str(round_mins)[0:2] + #return converted_string class resource_resource(osv.osv): _name = "resource.resource" @@ -366,51 +368,102 @@ class resource_resource(osv.osv): Change the format of working calendar from 'Openerp' format to bring it into 'Faces' format. @param calendar_id : working calendar of the project """ + tz = pytz.utc + if context and ('tz' in context): + tz = pytz.timezone(context['tz']) + + wktime_local = None + week_days = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] if not calendar_id: - # Calendar is not specified: working days: 24/7 - return [('fri', '8:0-12:0','13:0-17:0'), ('thu', '8:0-12:0','13:0-17:0'), ('wed', '8:0-12:0','13:0-17:0'), - ('mon', '8:0-12:0','13:0-17:0'), ('tue', '8:0-12:0','13:0-17:0')] - resource_attendance_pool = self.pool.get('resource.calendar.attendance') - time_range = "8:00-8:00" - non_working = "" - week_days = {"0": "mon", "1": "tue", "2": "wed","3": "thu", "4": "fri", "5": "sat", "6": "sun"} - wk_days = {} - wk_time = {} - wktime_list = [] + # Calendar is not specified: working days: some sane default + wktime_local = [ + (0, time(8,0), time(12,0)), + (0, time(13,0), time(17,0)), + (1, time(8,0), time(12,0)), + (1, time(13,0), time(17,0)), + (2, time(8,0), time(12,0)), + (2, time(13,0), time(17,0)), + (3, time(8,0), time(12,0)), + (3, time(13,0), time(17,0)), + (4, time(8,0), time(12,0)), + (4, time(13,0), time(17,0)), + ] + #return [('fri', '8:0-12:0','13:0-17:0'), ('thu', '8:0-12:0','13:0-17:0'), ('wed', '8:0-12:0','13:0-17:0'), + # ('mon', '8:0-12:0','13:0-17:0'), ('tue', '8:0-12:0','13:0-17:0')] + else: + resource_attendance_pool = self.pool.get('resource.calendar.attendance') + non_working = "" + wktime_local = [] + + week_ids = resource_attendance_pool.search(cr, uid, [('calendar_id', '=', calendar_id)], context=context) + weeks = resource_attendance_pool.read(cr, uid, week_ids, ['dayofweek', 'hour_from', 'hour_to'], context=context) + # Convert time formats into appropriate format required + # and create lists inside wktime_local. + for week in weeks: + res_str = "" + day = None + if week['dayofweek']: + day = int(week['dayofweek']) + else: + raise osv.except_osv(_('Configuration Error!'),_('Make sure the Working time has been configured with proper week days!')) + hour_from = convert_timeformat(week['hour_from']) + hour_to = convert_timeformat(week['hour_to']) + wktime_local.append((day, hour_from, hour_to)) + + # We now have working hours _in local time_. Non-working days are an + # empty list, while working days are a list of tuples, consisting of a + # start time and an end time. We will convert these to UTC for time + # calculation purposes. + + # We need to get this into a dict + # which will be in the following format: + # { 'day': [(time(9,0), time(17,0)), ...], ... } + wktime_utc = {} + + # NOTE: This may break with regards to DST! + for (day, start, end) in wktime_local: + # Convert start time to UTC + start_dt_local = datetime.combine(date.today(), start.replace(tzinfo=tz)) + start_dt_utc = start_dt_local.astimezone(pytz.utc) + start_dt_day = (day + (start_dt_utc.date() - start_dt_local.date()).days) % 7 + + # Convert end time to UTC + end_dt_local = datetime.combine(date.today(), end.replace(tzinfo=tz)) + end_dt_utc = end_dt_local.astimezone(pytz.utc) + end_dt_day = (day + (end_dt_utc.date() - end_dt_local.date()).days) % 7 + + # Are start and end still on the same day? + if start_dt_day == end_dt_day: + day_name = week_days[start_dt_day] + if day_name not in wktime_utc: + wktime_utc[day_name] = [] + wktime_utc[day_name].append((start_dt_utc.time(), end_dt_utc.time())) + else: + day_start_name = week_days[start_dt_day] + if day_start_name not in wktime_utc: + wktime_utc[day_start_name] = [] + # We go until midnight that day + wktime_utc[day_start_name].append((start_dt_utc.time(), time(0,0))) + + day_end_name = week_days[end_dt_day] + if day_end_name not in wktime_utc: + wktime_utc[day_end_name] = [] + # Then resume from midnight that day + wktime_utc[day_end_name].append((time(0,0), end_dt_utc.time())) + + # Now having gotten a list of times together, generate the final output wktime_cal = [] - week_ids = resource_attendance_pool.search(cr, uid, [('calendar_id', '=', calendar_id)], context=context) - weeks = resource_attendance_pool.read(cr, uid, week_ids, ['dayofweek', 'hour_from', 'hour_to'], context=context) - # Convert time formats into appropriate format required - # and create a list like [('mon', '8:00-12:00'), ('mon', '13:00-18:00')] - for week in weeks: - res_str = "" - day = None - if week_days.get(week['dayofweek'],False): - day = week_days[week['dayofweek']] - wk_days[week['dayofweek']] = week_days[week['dayofweek']] - else: - raise osv.except_osv(_('Configuration Error!'),_('Make sure the Working time has been configured with proper week days!')) - hour_from_str = convert_timeformat(week['hour_from']) - hour_to_str = convert_timeformat(week['hour_to']) - res_str = hour_from_str + '-' + hour_to_str - wktime_list.append((day, res_str)) - # Convert into format like [('mon', '8:00-12:00', '13:00-18:00')] - for item in wktime_list: - if wk_time.has_key(item[0]): - wk_time[item[0]].append(item[1]) - else: - wk_time[item[0]] = [item[0]] - wk_time[item[0]].append(item[1]) - for k,v in wk_time.items(): - wktime_cal.append(tuple(v)) - # Add for the non-working days like: [('sat, sun', '8:00-8:00')] - for k, v in wk_days.items(): - if week_days.has_key(k): - week_days.pop(k) - for v in week_days.itervalues(): - non_working += v + ',' - if non_working: - wktime_cal.append((non_working[:-1], time_range)) + for day, times in wktime_utc.iteritems(): + # Sort the times + times.sort() + wktime = ['{0}-{1}'.format(s.strftime('%H:%M'), e.strftime('%H:%M')) for (s, e) in times] + wktime.insert(0, day) + wktime_cal.append(tuple(wktime)) + # Finally, add in non-working days + for day in week_days: + if day not in wktime_utc: + wktime_cal.append((day, None)) + return wktime_cal resource_resource() From 67bb69500a43330dc604039e8d8f51d0e4b4870e Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Tue, 28 Aug 2012 17:45:45 +0530 Subject: [PATCH 003/110] [FIX]CRM:creating phone calls from lead sets partner,phone,mobile and sales team bzr revid: kbh@tinyerp.com-20120828121545-6vqvirfa99f3fnhe --- addons/crm/crm_lead.py | 51 ++++++++++++++++++++++++++++++++++++ addons/crm/crm_lead_view.xml | 12 ++------- 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 25a47ecbadc..8e31b17b189 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -717,6 +717,57 @@ class crm_lead(base_stage, osv.osv): self.write(cr, uid, [lead_id], value, context=context) return True + def phonecall_view(self, cr, uid, ids, call_summary, user_id=False, section_id=False, categ_id=False, context=None): + #Open the View for the Phone call for the leads + """ + This opens Phone Call views + @return :Dictionary value for Phone Call view + """ + if context is None: + context = {} + value = {} + data_obj = self.pool.get('ir.model.data') + if not categ_id: + res_id = data_obj._get_id(cr, uid, 'crm', 'categ_phone2') + if res_id: + categ_id = data_obj.browse(cr, uid, res_id, context=context).res_id + for lead in self.browse(cr, uid, ids, context=context): + if not section_id: + section_id = lead.section_id and lead.section_id.id or False + if not user_id: + user_id = lead.user_id and lead.user_id.id or False + # Get Phone Call views + tree_view = data_obj.get_object_reference(cr, uid, 'crm', 'crm_case_phone_tree_view') + form_view = data_obj.get_object_reference(cr, uid, 'crm', 'crm_case_phone_form_view') + search_view = data_obj.get_object_reference(cr, uid, 'crm', 'view_crm_case_phonecalls_filter') + context.update({ + 'default_duration': 1.0, + 'default_opportunity_id': lead.id, + 'default_user_id': user_id or False, + 'default_categ_id' : categ_id or False, + 'default_lead_id': lead.id, + 'default_name': lead.name, + 'default_partner_id': lead.partner_id and lead.partner_id.id or False, + 'default_partner_mobile': lead.mobile or (lead.partner_id and lead.partner_id.mobile or False), + 'default_section_id': section_id or False, + 'default_description': lead.description or False, + 'default_partner_phone': lead.phone or (lead.partner_id and lead.partner_id.phone or False), + }) + value = { + 'name': _('Phone Call'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': 'crm.phonecall', + 'view_id': False, + 'context': context, + 'views': [(form_view and form_view[1] or False, 'form'),(tree_view and tree_view[1] or False, 'tree')], + 'type': 'ir.actions.act_window', + 'search_view_id': search_view and search_view[1] or False, + 'nodestroy': True + } + return value + def schedule_phonecall(self, cr, uid, ids, schedule_time, call_summary, desc, phone, contact_name, user_id=False, section_id=False, categ_id=False, action='schedule', context=None): """ action :('schedule','Schedule a call'), ('log','Log a call') diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 6a715893a17..049aa74fb75 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -105,14 +105,6 @@ -
-
From 149800235092a70d8694bd1836d68c8f67d759b2 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 23 Oct 2012 13:13:01 +0200 Subject: [PATCH 004/110] [ADD] account_test bzr revid: qdp-launchpad@openerp.com-20121023111301-c41qvtxm1l5p0nq0 --- addons/account_test/__init__.py | 2 + addons/account_test/__terp__.py | 42 +++ addons/account_test/account_test.py | 65 +++++ addons/account_test/account_test_data.xml | 175 ++++++++++++ addons/account_test/account_test_demo.xml | 29 ++ addons/account_test/account_test_report.xml | 14 + addons/account_test/account_test_view.xml | 56 ++++ addons/account_test/i18n/fr_FR.po | 264 ++++++++++++++++++ addons/account_test/report/__init__.py | 1 + addons/account_test/report/account_test.rml | 78 ++++++ .../report/account_test_report.py | 105 +++++++ .../account_test/security/ir.model.access.csv | 3 + 12 files changed, 834 insertions(+) create mode 100644 addons/account_test/__init__.py create mode 100644 addons/account_test/__terp__.py create mode 100644 addons/account_test/account_test.py create mode 100644 addons/account_test/account_test_data.xml create mode 100644 addons/account_test/account_test_demo.xml create mode 100644 addons/account_test/account_test_report.xml create mode 100644 addons/account_test/account_test_view.xml create mode 100644 addons/account_test/i18n/fr_FR.po create mode 100644 addons/account_test/report/__init__.py create mode 100644 addons/account_test/report/account_test.rml create mode 100644 addons/account_test/report/account_test_report.py create mode 100644 addons/account_test/security/ir.model.access.csv diff --git a/addons/account_test/__init__.py b/addons/account_test/__init__.py new file mode 100644 index 00000000000..106682f4a12 --- /dev/null +++ b/addons/account_test/__init__.py @@ -0,0 +1,2 @@ +import account_test +import report diff --git a/addons/account_test/__terp__.py b/addons/account_test/__terp__.py new file mode 100644 index 00000000000..5578f0339ae --- /dev/null +++ b/addons/account_test/__terp__.py @@ -0,0 +1,42 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2011 CCI Connect asbl (http://www.cciconnect.be) All Rights Reserved. +# Philmer +# +# 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 . +# +############################################################################## +{ + "name" : "OpenERP", + "version" : "1.0", + "author" : "OpenERP", + "category" : "Test accounting", + "website": "http://www.openerp.com", + "description": "Asserts on accounting", + "depends" : ["account"], + "update_xml" : [ + "account_test_view.xml", + "account_test_report.xml", + "security/ir.model.access.csv", + "account_test_data.xml", + ], + 'demo_xml': [ + "account_test_demo.xml", + ], + "active": False, + "installable": True +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_test/account_test.py b/addons/account_test/account_test.py new file mode 100644 index 00000000000..069ba6601e4 --- /dev/null +++ b/addons/account_test/account_test.py @@ -0,0 +1,65 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved. +# +# $Id: product_expiry.py 4304 2006-10-25 09:54:51Z ged $ +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# 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 2 +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from osv import fields,osv +import pooler +import netsvc +import time +from xml import dom + + +CODE_EXEC_DEFAULT = '''\ +res = [] +cr.execute("select id, code from account_journal") +for record in cr.dictfetchall(): + res.append(record['code']) +result = res +''' + +class accounting_assert_test(osv.osv): + _name = "accounting.assert.test" + _order = "sequence" + + _columns = { + 'name': fields.char('Test Name', size=256, required=True, select=True, translate=True), + 'desc': fields.text('Test Description', select=True, translate=True), + 'code_exec': fields.text('Python code or SQL query', required=True), + 'active': fields.boolean('Active'), + 'sequence': fields.integer('Sequence'), + } + + _defaults = { + 'code_exec': lambda *a: CODE_EXEC_DEFAULT, + 'active': lambda *a: True, + 'sequence': lambda *a: 10, + } + +accounting_assert_test() + diff --git a/addons/account_test/account_test_data.xml b/addons/account_test/account_test_data.xml new file mode 100644 index 00000000000..453d8184b9e --- /dev/null +++ b/addons/account_test/account_test_data.xml @@ -0,0 +1,175 @@ + + + + + + 1 + Test 1: General balance + Check the balance: Debit sum = Credit sum + + + + + 2 + Test 2: Opening a fiscal year + Check if the balance of the new opened fiscal year matches with last year's balance + + + + + 3 + Test 3: Movement lines + Check if movement lines are balanced and have the same date and period + 0 or am.period_id!=ml.period_id or (am.date!=ml.date) +""" +cr.execute(sql) +res = cr.dictfetchall() +if res: + res.insert(0,_('* The test failed for these movement lines:')) + result = res + +]]> + + + + 4 + Test 4: Totally reconciled mouvements + Check if the totally reconciled movements are balanced + 0", (record['reconcile_id'],)) + reconcile_ids=cr.dictfetchall() + if reconcile_ids: + res.append(', '.join(["Reconcile name: %(name)s, id=%(id)s " % r for r in reconcile_ids])) +result = res +if result: + res.insert(0,_('* The test failed for these reconciled items(id/name):')) +]]> + + + + 5 + Test 5.1 : Payable and Receivable accountant lines of reconciled invoices + Check that reconciled invoice for Sales/Purchases has reconciled entries for Payable and Receivable Accounts + + + + + + 6 + Test 5.2 : Reconcilied invoices and Payable/Receivable accounts + Check that reconciled account moves, that define Payable and Receivable accounts, are belonging to reconciled invoices + + + + + 7 + Test 6 : Invoices status + Check that paid/reconciled invoices are not in 'Open' state + + + + + + 8 + Test 7: « View  » account type + Check that there's no move for any account with « View » account type + + + + + 9 + Test 8 : Closing balance on bank statements + Check on bank statement that the Closing Balance = Starting Balance + sum of statement lines + 0.000000001;") +result = cr.dictfetchall() +if result: + result.insert(0,_('* Unbalanced bank statement that need to be checked: ')) +]]> + + + + 10 + Test 9 : Accounts and partners on account moves + Check that general accounts and partners on account moves are active + + + + diff --git a/addons/account_test/account_test_demo.xml b/addons/account_test/account_test_demo.xml new file mode 100644 index 00000000000..d10182f61b8 --- /dev/null +++ b/addons/account_test/account_test_demo.xml @@ -0,0 +1,29 @@ + + + + + + Test 1 + Test 1 + + 0""" +cr.execute(sql) +result = cr.dictfetchall() +]]> + + + + diff --git a/addons/account_test/account_test_report.xml b/addons/account_test/account_test_report.xml new file mode 100644 index 00000000000..480507b6072 --- /dev/null +++ b/addons/account_test/account_test_report.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/addons/account_test/account_test_view.xml b/addons/account_test/account_test_view.xml new file mode 100644 index 00000000000..8351cb0687a --- /dev/null +++ b/addons/account_test/account_test_view.xml @@ -0,0 +1,56 @@ + + + + + + Tests + accounting.assert.test + tree + + + + + + + + + + + Tests + accounting.assert.test + form + +
+ + + + + + + + + + + + + + + + + +
+
+ + + Accounting Tests + accounting.assert.test + tree,form + + + + +
+
diff --git a/addons/account_test/i18n/fr_FR.po b/addons/account_test/i18n/fr_FR.po new file mode 100644 index 00000000000..6266ff9fa54 --- /dev/null +++ b/addons/account_test/i18n/fr_FR.po @@ -0,0 +1,264 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_test +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.16\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2011-11-13 15:05:26+0000\n" +"PO-Revision-Date: 2011-11-13 15:05:26+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_test +#: field:accounting.assert.test,desc:0 +msgid "Test Description" +msgstr "Test Description" + +#. module: account_test +#: constraint:ir.model:0 +msgid "The Object name must start with x_ and not contain any special character !" +msgstr "Le nom de l'object doit commencer par x_ et ne doit pas contenir de caractères spéciaux !" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_02 +msgid "Test 2: Opening a fiscal year" +msgstr "Test 2: Ouverture d'une année fiscale" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_03 +msgid "Check if movement lines are balanced and have the same date and period" +msgstr "Vérifier que les lignes d'un même mouvement sont balancées, avec la même période et la même date" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_09_1 +msgid "Test 9.1 : Gap in Invoices sequence" +msgstr "Test 9: Trous dans la numérotation des factures" + +#. module: account_test +#: model:ir.actions.report.xml,name:account_test.account_assert_test_report +msgid "Accounting Tests" +msgstr "Tests Comptables" + +#. module: account_test +#: field:accounting.assert.test,name:0 +msgid "Test Name" +msgstr "Nom du test" + +#. module: account_test +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "Modèle non valide pour le définition de l'action" + +#. module: account_test +#: field:accounting.assert.test,code_exec:0 +msgid "Python code or SQL query" +msgstr "Code Python ou requête SQL" + +#. module: account_test +#: rml:account.test.assert.print:0 +msgid "Accouting tests on" +msgstr "Tests comptables sur" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_06 +msgid "Check that paid/reconciled invoices are not in 'Open' state" +msgstr "Vérifier que les factures paid/reconcilied ne sont pas 'open'" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_11_2 +msgid "Test 11.2: Analytical moves" +msgstr "Test 11.2: Lignes analytiques" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_09_2 +msgid "Check that there's no gap in Bank Stetement sequence" +msgstr "Test 9: Trous dans la numérotation des extraits de comptes" + +#. module: account_test +#: view:accounting.assert.test:0 +msgid "Tests" +msgstr "Tests" + +#. module: account_test +#: view:accounting.assert.test:0 +msgid "Expression to evaluate" +msgstr "Expression à évaluer" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_06_1 +msgid "Check that there's no move for any account with « View » account type" +msgstr "Vérifier qu'il n'y a pas de mouvements sur des comptes de type 'vue'" + +#. module: account_test +#: model:ir.actions.act_window,name:account_test.action_accounting_assert +#: model:ir.ui.menu,name:account_test.menu_action_license +msgid "Accounting Tests" +msgstr "Tests Comptables" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_09_2 +msgid "Test 9.2 : Gap in Bank Statement sequence" +msgstr "Test 9.2 : Trous dans la numérotation des extraits de comptes" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_01 +msgid "Test 1: General balance" +msgstr "Test 1: Balance Générale" + +#. module: account_test +#: model:ir.module.module,description:account_test.module_meta_information +msgid "Asserts on accounting" +msgstr "Asserts on accounting" + +#. module: account_test +#: code:addons/account_test/report/account_test_report.py:0 +#, python-format +msgid "The test was passed successfully" +msgstr "Le test est passé avec succès" + +#. module: account_test +#: field:accounting.assert.test,active:0 +msgid "Active" +msgstr "Active" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_06 +msgid "Test 6 : Invoices status" +msgstr "Test 6: vérifier les factures" + +#. module: account_test +#: model:ir.model,name:account_test.model_accounting_assert_test +msgid "accounting.assert.test" +msgstr "accounting.assert.test" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_05_2 +msgid "Check that reconciled account moves, that define Payable and Receivable accounts, are belonging to reconciled invoices" +msgstr "Vérifier que les lignes de factures d'achat/vente réconciliées ont des écritures pour les comptes payables et recevables réconciliées" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_11_2 +msgid "Check that amounts by analytical plan are equals to the amount of account move line" +msgstr "Vérifier que les montants par plan analytique sont égaux au montant de la ligne du mouvement comptable" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_11_1 +msgid "Check that each account move line has at least 3 analytical moves" +msgstr "Vérifier que chaque ligne d'un mouvement comptable a au moins 3 lignes analytiques" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_07 +msgid "Test 8 : Closing balance on bank statements" +msgstr "Test 8 : Vérification des lignes financières des extraits de comptes" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_07 +msgid "Check on bank statement that the Closing Balance = Starting Balance + sum of statement lines" +msgstr "Vérifier que le solde de fin est égal au solde de début + la somme des mouvements" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_05 +msgid "Test 5.1 : Payable and Receivable lines accounts of reconciled invoices" +msgstr "Test 5.1 : Vérification des lignes des comptes payables et recevables des factures réconciliées" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_03 +msgid "Test 3: Movement lines" +msgstr "Test 3: Mouvements comptables" + +#. module: account_test +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML Invalide pour cette vue" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_11_1 +msgid "Test 11.1: Analytical moves" +msgstr "Test 11.1: Mouvements analytiques" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_05_2 +msgid "Test 5.2 : Reconcilied invoices and Payable/Receivable accounts" +msgstr "Test 5.2 : Factures réconciliées et les lignes des comptes payables et recevables non réconciliées " + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_15 +msgid "Test 15 : Analytical moves for Analytic multi plan" +msgstr "Test 15 : Mouvements analytiques" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_15 +msgid "Check that analytic accounts used on lines are present in analytic sections of different plans" +msgstr "Vérifier que les centres de coûts présents dans les lignes sont bien présents dans les sections analytiques des différents plans" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_04 +msgid "Test 4: Totally reconciled mouvements" +msgstr "Test 4: Vérification des reconcile complets" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_04 +msgid "Check if the totally reconciled movements are balanced" +msgstr "Vérification des reconcile complets" + +#. module: account_test +#: field:accounting.assert.test,sequence:0 +msgid "Sequence" +msgstr "Séquence" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_02 +msgid "Check if the balance of the new opened fiscal year matches with last year's balance" +msgstr "Vérifier que l'ouverture d'une année fiscale correspond au solde de l'année passée" + +#. module: account_test +#: view:accounting.assert.test:0 +msgid "Python Code" +msgstr "Code Python" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_08 +msgid "Test 9 : Accounts and partners on account moves" +msgstr "Test 9 : Comptes et partenaires sur les mouvements comptables" + +#. module: account_test +#: model:accounting.assert.test,name:account_test.account_test_06_1 +msgid "Test 7: « View  » account type" +msgstr "Test 7: mouvements sur comptes type 'vue'" + +#. module: account_test +#: model:ir.module.module,shortdesc:account_test.module_meta_information +msgid "OpenERP" +msgstr "OpenERP" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_05 +msgid "Check that reconciled invoice for Sales/Purchases has reconciled entries for Payable and Receivable Accounts" +msgstr "Vérifier que les factures réconcilées ont des écritures comptables sur les comptes payables ou recevables réconciliées" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_09_1 +msgid "Check that there's no gap in invoices sequence" +msgstr "Vérifier que les factures n'ont pas de trous dans leur numérotation" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_01 +msgid "Check the balance: Debit sum = Credit sum" +msgstr "Vérifier la balance générale: somme débit = somme crédit" + +#. module: account_test +#: model:accounting.assert.test,desc:account_test.account_test_14 +msgid "Check that general accounts and partners on account moves are active" +msgstr "Vérifier que les comptes généraux ainsi que les partenaires renseignés sur les mouvements comptables sont actifs" + +#. module: account_test +#: view:accounting.assert.test:0 +msgid "Code Help" +msgstr "Code Help" + diff --git a/addons/account_test/report/__init__.py b/addons/account_test/report/__init__.py new file mode 100644 index 00000000000..21a4929330b --- /dev/null +++ b/addons/account_test/report/__init__.py @@ -0,0 +1 @@ +import account_test_report diff --git a/addons/account_test/report/account_test.rml b/addons/account_test/report/account_test.rml new file mode 100644 index 00000000000..1efa12fd5cb --- /dev/null +++ b/addons/account_test/report/account_test.rml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Accouting tests on [[ datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") ]] + + + +
+ [[repeatIn(objects,'o')]] + + + + [[ o.name ]] + + + + + [[ o.desc or '' ]] + + + + + + + [[ repeatIn(execute_code(o.code_exec), 'test_result') ]] + [[ test_result ]] + + + + + + +
+ +
+
diff --git a/addons/account_test/report/account_test_report.py b/addons/account_test/report/account_test_report.py new file mode 100644 index 00000000000..79a52611756 --- /dev/null +++ b/addons/account_test/report/account_test_report.py @@ -0,0 +1,105 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). 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 . +# +############################################################################## + +import datetime +import time +import re +from report import report_sxw +from itertools import groupby +from operator import itemgetter +from tools.translate import _ +# +# Use period and Journal for selection or resources +# +class report_assert_account(report_sxw.rml_parse): + def __init__(self, cr, uid, name, context): + super(report_assert_account, self).__init__(cr, uid, name, context=context) + self.localcontext.update( { + 'time': time, + 'datetime': datetime, + 'execute_code': self.execute_code, + }) + + def execute_code(self, code_exec): + def group(lst, col): + return dict((k, [v for v in itr]) for k, itr in groupby(sorted(lst, key=lambda x: x[col]), itemgetter(col))) + + def sort_by_intified_num(a, b): + if a is None: + return -1 + elif b is None: + return 1 + else: + #if a is not None and b is not None: + return cmp(int(a), int(b)) + + def reconciled_inv(): + reconciled_inv_ids = self.pool.get('account.invoice').search(self.cr, self.uid, [('reconciled','=',True)]) + return reconciled_inv_ids + + + def get_parent(acc_id): + acc_an_id = self.pool.get('account.analytic.account').browse(self.cr, self.uid, acc_id).parent_id + while acc_an_id.parent_id: + acc_an_id = acc_an_id.parent_id + return acc_an_id.id + + def order_columns(item, cols=None): + if cols is None: + cols = item.keys() + return [(col, item.get(col)) for col in cols if col in item.keys()] + + localdict = { + 'cr': self.cr, + '_': _, + 'reconciled_inv' : reconciled_inv, + 'group' : group, + 'get_parent' : get_parent, + 'now': datetime.datetime.now(), + 'result': None, + 'column_order': None, + } + + exec code_exec in localdict + + result = localdict['result'] + column_order = localdict.get('column_order', None) + + if not isinstance(result, (tuple, list, set)): + result = [result] + + if not result: + result = [_('The test was passed successfully')] + elif all([isinstance(x, dict) for x in result]): + result = [', '.join(["%s: %s" % (k, v) for k, v in order_columns(rec, column_order)]) for rec in result] + else: + def _format(a): + if isinstance(a, dict): + return ', '.join(["%s: %s" % (tup[0], tup[1]) for tup in order_columns(a, column_order)]) + else: + return a + result = [_format(rec) for rec in result] + + return result + +report_sxw.report_sxw('report.account.test.assert.print', 'accounting.assert.test', 'addons/account_test/report/account_test.rml', parser=report_assert_account, header=False) + diff --git a/addons/account_test/security/ir.model.access.csv b/addons/account_test/security/ir.model.access.csv new file mode 100644 index 00000000000..fb90ba43825 --- /dev/null +++ b/addons/account_test/security/ir.model.access.csv @@ -0,0 +1,3 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_accounting_assert_test","accounting.assert.test","model_accounting_assert_test",base.group_system,1,1,1,1 +"access_accounting_assert_test","accounting.assert.test","model_accounting_assert_test",account.group_account_manager,1,0,0,0 From 5815b2c2e4be4f915ec892cb808334e9c37e9125 Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Thu, 1 Nov 2012 13:02:08 +0530 Subject: [PATCH 005/110] [IMP] made compatible to version 7.0 bzr revid: bde@tinyerp.com-20121101073208-i1s4m2jca2qvraik --- .../{__terp__.py => __openerp__.py} | 0 addons/account_test/account_test_view.xml | 76 +++++++++---------- 2 files changed, 38 insertions(+), 38 deletions(-) rename addons/account_test/{__terp__.py => __openerp__.py} (100%) diff --git a/addons/account_test/__terp__.py b/addons/account_test/__openerp__.py similarity index 100% rename from addons/account_test/__terp__.py rename to addons/account_test/__openerp__.py diff --git a/addons/account_test/account_test_view.xml b/addons/account_test/account_test_view.xml index 8351cb0687a..5f0d7f45090 100644 --- a/addons/account_test/account_test_view.xml +++ b/addons/account_test/account_test_view.xml @@ -2,10 +2,9 @@ - - Tests - accounting.assert.test - tree + + Tests + accounting.assert.test @@ -14,43 +13,44 @@ - - - Tests - accounting.assert.test - form + + + Tests + accounting.assert.test -
- - - - - - - - - - - - - - - - + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+
+ + + Accounting Tests + accounting.assert.test + tree,form + + + - - Accounting Tests - accounting.assert.test - tree,form - - - - -
+
From d73ccce5ba6c15e1a93b3da4f8478b77ea58ee35 Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Thu, 1 Nov 2012 15:15:56 +0530 Subject: [PATCH 006/110] [IMP] improved module according to version 7 conventions bzr revid: bde@tinyerp.com-20121101094556-s05h6ymbrxdgjfk1 --- addons/account_test/__openerp__.py | 31 ++++++++++----------- addons/account_test/account_test_view.xml | 33 ++++++++++++++--------- 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/addons/account_test/__openerp__.py b/addons/account_test/__openerp__.py index 5578f0339ae..13328cddcb4 100644 --- a/addons/account_test/__openerp__.py +++ b/addons/account_test/__openerp__.py @@ -20,23 +20,24 @@ # ############################################################################## { - "name" : "OpenERP", - "version" : "1.0", - "author" : "OpenERP", - "category" : "Test accounting", - "website": "http://www.openerp.com", - "description": "Asserts on accounting", - "depends" : ["account"], - "update_xml" : [ - "account_test_view.xml", - "account_test_report.xml", - "security/ir.model.access.csv", - "account_test_data.xml", + 'name' : 'Accounting Consistency Tests', + 'version' : '1.0', + 'author' : 'OpenERP', + 'category' : 'Test accounting', + 'website': 'http://www.openerp.com', + 'description': """Asserts on accounting + =====================""", + 'depends' : ['account'], + 'data' : [ + 'security/ir.model.access.csv', + 'account_test_view.xml', + 'account_test_report.xml', + 'account_test_data.xml', ], 'demo_xml': [ - "account_test_demo.xml", + 'account_test_demo.xml', ], - "active": False, - "installable": True + 'active': False, + 'installable': True } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_test/account_test_view.xml b/addons/account_test/account_test_view.xml index 5f0d7f45090..c6fc0c8294b 100644 --- a/addons/account_test/account_test_view.xml +++ b/addons/account_test/account_test_view.xml @@ -22,23 +22,32 @@ + - - + - -
- -
- - - -
- -
+ + + + + + + + + +
+Example: 
+sql = 'select id, name, ref, date from account_move_line where account_id in 
+(select id from account_account where type = 'view')'
+cr.execute(sql)
+result = cr.dictfetchall()
+                                    
+
+
+
From f3377ee338daf8863ef1e0add8dc1f9eb7fc1c27 Mon Sep 17 00:00:00 2001 From: "Pinakin Nayi (OpenERP)" Date: Fri, 9 Nov 2012 12:09:12 +0530 Subject: [PATCH 007/110] [IMP] improve module bzr revid: pna@tinyerp.com-20121109063912-7g5jy22j3fx2vxu8 --- addons/account_test/__openerp__.py | 2 +- addons/account_test/account_test_view.xml | 7 ++++++- addons/account_test/report/__init__.py | 2 ++ addons/account_test/report/account_test_report.py | 1 + addons/account_test/security/ir.model.access.csv | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/addons/account_test/__openerp__.py b/addons/account_test/__openerp__.py index 13328cddcb4..b755d4aa872 100644 --- a/addons/account_test/__openerp__.py +++ b/addons/account_test/__openerp__.py @@ -34,7 +34,7 @@ 'account_test_report.xml', 'account_test_data.xml', ], - 'demo_xml': [ + 'demo': [ 'account_test_demo.xml', ], 'active': False, diff --git a/addons/account_test/account_test_view.xml b/addons/account_test/account_test_view.xml index c6fc0c8294b..bcedebf0eeb 100644 --- a/addons/account_test/account_test_view.xml +++ b/addons/account_test/account_test_view.xml @@ -29,7 +29,7 @@ - + @@ -57,6 +57,11 @@ result = cr.dictfetchall() Accounting Tests accounting.assert.test tree,form + +

+ Click to create Accounting Test. +

+
diff --git a/addons/account_test/report/__init__.py b/addons/account_test/report/__init__.py index 21a4929330b..0e4fbf07082 100644 --- a/addons/account_test/report/__init__.py +++ b/addons/account_test/report/__init__.py @@ -1 +1,3 @@ import account_test_report + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_test/report/account_test_report.py b/addons/account_test/report/account_test_report.py index 79a52611756..66d5043412f 100644 --- a/addons/account_test/report/account_test_report.py +++ b/addons/account_test/report/account_test_report.py @@ -103,3 +103,4 @@ class report_assert_account(report_sxw.rml_parse): report_sxw.report_sxw('report.account.test.assert.print', 'accounting.assert.test', 'addons/account_test/report/account_test.rml', parser=report_assert_account, header=False) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_test/security/ir.model.access.csv b/addons/account_test/security/ir.model.access.csv index fb90ba43825..95f2336f80b 100644 --- a/addons/account_test/security/ir.model.access.csv +++ b/addons/account_test/security/ir.model.access.csv @@ -1,3 +1,3 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_accounting_assert_test","accounting.assert.test","model_accounting_assert_test",base.group_system,1,1,1,1 -"access_accounting_assert_test","accounting.assert.test","model_accounting_assert_test",account.group_account_manager,1,0,0,0 +"access_accounting_assert_test_manager","accounting.assert.test","model_accounting_assert_test",account.group_account_manager,1,0,0,0 From 87d7129447683964bcd0baada807829506d5ed6f Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Mon, 19 Nov 2012 11:53:46 +0530 Subject: [PATCH 008/110] [IMP] improved description in __openerp__.py bzr revid: bde@tinyerp.com-20121119062346-no2y4123ravq2abu --- addons/account_test/__openerp__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/account_test/__openerp__.py b/addons/account_test/__openerp__.py index b755d4aa872..c3261797c26 100644 --- a/addons/account_test/__openerp__.py +++ b/addons/account_test/__openerp__.py @@ -25,8 +25,15 @@ 'author' : 'OpenERP', 'category' : 'Test accounting', 'website': 'http://www.openerp.com', - 'description': """Asserts on accounting - =====================""", + 'description': """ +Asserts on accounting. +====================== +With this module you can manually check consistencies and inconsistencies of accounting module. + +How to perform Consistency Tests: +--------------------------------- +Reporting/Accounting/Accounting Tests +""", 'depends' : ['account'], 'data' : [ 'security/ir.model.access.csv', From 4bf8dbc14d31c54ce13709cb822d635278ae31de Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Mon, 19 Nov 2012 14:19:42 +0530 Subject: [PATCH 009/110] [IMP] improved module description bzr revid: bde@tinyerp.com-20121119084942-fa7ctfz7wd9pd2zm --- addons/account_test/__openerp__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/account_test/__openerp__.py b/addons/account_test/__openerp__.py index c3261797c26..ae65eb4b4c8 100644 --- a/addons/account_test/__openerp__.py +++ b/addons/account_test/__openerp__.py @@ -28,11 +28,7 @@ 'description': """ Asserts on accounting. ====================== -With this module you can manually check consistencies and inconsistencies of accounting module. - -How to perform Consistency Tests: ---------------------------------- -Reporting/Accounting/Accounting Tests +With this module you can manually check consistencies and inconsistencies of accounting module from menu Reporting/Accounting/Accounting Tests. """, 'depends' : ['account'], 'data' : [ From 982223b577a9f3db01a2a993247f244f6fec92b7 Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Mon, 19 Nov 2012 14:26:36 +0530 Subject: [PATCH 010/110] [IMP] changed module category bzr revid: bde@tinyerp.com-20121119085636-a9otys3xhcth94yj --- addons/account_test/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_test/__openerp__.py b/addons/account_test/__openerp__.py index ae65eb4b4c8..3e98734fe72 100644 --- a/addons/account_test/__openerp__.py +++ b/addons/account_test/__openerp__.py @@ -23,7 +23,7 @@ 'name' : 'Accounting Consistency Tests', 'version' : '1.0', 'author' : 'OpenERP', - 'category' : 'Test accounting', + 'category' : 'Accounting & Finance', 'website': 'http://www.openerp.com', 'description': """ Asserts on accounting. From d9c266eeb4be9d31a27055ae907e0788f054585c Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 20 Nov 2012 17:29:30 +0100 Subject: [PATCH 011/110] [FIX]some minor corrections and TODO comments bzr revid: csn@openerp.com-20121120162930-hwj1ilshe99uvyau --- addons/account_test/account_test.py | 6 +++--- addons/account_test/account_test_data.xml | 21 ++++++++++--------- addons/account_test/account_test_view.xml | 2 ++ .../report/account_test_report.py | 3 ++- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/addons/account_test/account_test.py b/addons/account_test/account_test.py index 069ba6601e4..dc7442b1247 100644 --- a/addons/account_test/account_test.py +++ b/addons/account_test/account_test.py @@ -56,9 +56,9 @@ class accounting_assert_test(osv.osv): } _defaults = { - 'code_exec': lambda *a: CODE_EXEC_DEFAULT, - 'active': lambda *a: True, - 'sequence': lambda *a: 10, + 'code_exec': CODE_EXEC_DEFAULT, + 'active': True, + 'sequence': 10, } accounting_assert_test() diff --git a/addons/account_test/account_test_data.xml b/addons/account_test/account_test_data.xml index 453d8184b9e..5b82fb82350 100644 --- a/addons/account_test/account_test_data.xml +++ b/addons/account_test/account_test_data.xml @@ -30,7 +30,7 @@ cr.execute("select coalesce(sum(debit),0) as debit_new_fyear,coalesce(sum(credit rec = cr.dictfetchall() cr.execute("select coalesce(sum(debit),0) as debit_last_fyear,coalesce(sum(credit),0) as credit_last_fyear from account_move_line where period_id in (select period_id from account_fiscalyear where state='done' order by id desc limit 1);") rec2= cr.dictfetchall() -if (rec2[0]['credit_last_fyear']-rec[0]['credit_new_fyear']!=0) or (rec2[0]['dedit_last_fyear']-rec[0]['dedit_new_fyear']!=0) : +if (rec2[0]['credit_last_fyear']-rec[0]['credit_new_fyear']!=0) or (rec2[0]['debit_last_fyear']-rec[0]['debit_new_fyear']!=0) : res.append(rec[0]) res.insert(0,_('* New fiscalyear debit and credit are:')) res.append(rec2[0]) @@ -61,7 +61,7 @@ cr.execute(sql) res = cr.dictfetchall() if res: res.insert(0,_('* The test failed for these movement lines:')) - result = res +result = res ]]>
@@ -80,7 +80,7 @@ for record in rec_ids : res.append(', '.join(["Reconcile name: %(name)s, id=%(id)s " % r for r in reconcile_ids])) result = res if result: - res.insert(0,_('* The test failed for these reconciled items(id/name):')) + result.insert(0,_('* The test failed for these reconciled items(id/name):')) ]]> @@ -101,18 +101,19 @@ if result: ]]> - 6 Test 5.2 : Reconcilied invoices and Payable/Receivable accounts Check that reconciled account moves, that define Payable and Receivable accounts, are belonging to reconciled invoices diff --git a/addons/account_test/account_test_view.xml b/addons/account_test/account_test_view.xml index bcedebf0eeb..ea8572554ed 100644 --- a/addons/account_test/account_test_view.xml +++ b/addons/account_test/account_test_view.xml @@ -38,6 +38,8 @@ +
 Example: 
 sql = 'select id, name, ref, date from account_move_line where account_id in 
diff --git a/addons/account_test/report/account_test_report.py b/addons/account_test/report/account_test_report.py
index 66d5043412f..5c274773cd4 100644
--- a/addons/account_test/report/account_test_report.py
+++ b/addons/account_test/report/account_test_report.py
@@ -43,6 +43,7 @@ class report_assert_account(report_sxw.rml_parse):
         def group(lst, col):
             return dict((k, [v for v in itr]) for k, itr in groupby(sorted(lst, key=lambda x: x[col]), itemgetter(col)))
 
+        #TODO what is this method used for, name unclear and doesn't seem to be used
         def sort_by_intified_num(a, b):
             if a is None:
                 return -1
@@ -56,7 +57,6 @@ class report_assert_account(report_sxw.rml_parse):
             reconciled_inv_ids = self.pool.get('account.invoice').search(self.cr, self.uid, [('reconciled','=',True)])
             return reconciled_inv_ids
 
-
         def get_parent(acc_id):
             acc_an_id = self.pool.get('account.analytic.account').browse(self.cr, self.uid, acc_id).parent_id
             while acc_an_id.parent_id:
@@ -89,6 +89,7 @@ class report_assert_account(report_sxw.rml_parse):
 
         if not result:
             result = [_('The test was passed successfully')]
+        #TODO: not sure this condition is needed, it is only a subcategory of the final else
         elif all([isinstance(x, dict) for x in result]):
             result = [', '.join(["%s: %s" % (k, v) for k, v in order_columns(rec, column_order)]) for rec in result]
         else:

From 3b3c32f58f4900508b7dc730f0c1453c43bac84e Mon Sep 17 00:00:00 2001
From: Cedric Snauwaert 
Date: Wed, 21 Nov 2012 15:06:43 +0100
Subject: [PATCH 012/110] [REF]some minor changes in code and add list of TODO
 in commentaries

bzr revid: csn@openerp.com-20121121140643-5aary4uc9hp6xuk2
---
 addons/account_test/account_test_data.xml | 21 ++++++++++-----------
 addons/account_test/account_test_demo.xml |  1 +
 addons/account_test/account_test_view.xml |  3 ++-
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/addons/account_test/account_test_data.xml b/addons/account_test/account_test_data.xml
index 5b82fb82350..415664b9653 100644
--- a/addons/account_test/account_test_data.xml
+++ b/addons/account_test/account_test_data.xml
@@ -11,31 +11,30 @@ sum(debit)-sum(credit) as balance
 FROM  account_move_line 
 """
 cr.execute(sql)
-result= cr.dictfetchall()
-cr.execute(sql)
 result=[]
 res= cr.dictfetchall()
-if res[0]['balance']!=0.0:
-  result=res
-  result.insert(0,_('* The difference of the balance is: '))
+if res[0]['balance']!=0.0 and res[0]['balance'] is not None:
+  result.append(_('* The difference of the balance is: '))
+  result.append(res)
 ]]>
     
 
     
         2
         Test 2: Opening a fiscal year
+        
         Check if the balance of the new opened fiscal year matches with last year's balance
-        
     
 
diff --git a/addons/account_test/account_test_demo.xml b/addons/account_test/account_test_demo.xml
index d10182f61b8..a342040683b 100644
--- a/addons/account_test/account_test_demo.xml
+++ b/addons/account_test/account_test_demo.xml
@@ -3,6 +3,7 @@
 
 
     
+      
         Test 1
         Test 1
         
diff --git a/addons/account_test/account_test_view.xml b/addons/account_test/account_test_view.xml
index ea8572554ed..848d04c7188 100644
--- a/addons/account_test/account_test_view.xml
+++ b/addons/account_test/account_test_view.xml
@@ -39,7 +39,8 @@
                                 
                                 
                                     
+                                    we won't see the result of the tests good or bad, give detail on function that can be used, like 
+                                    'group(a,b)' 'reconciled_inv()' 'get_parent(a)' 'now()' ... -->
                                     
 Example: 
 sql = 'select id, name, ref, date from account_move_line where account_id in 

From cd7181d76f7e627bc0ae262b4a206b8f8801f2ae Mon Sep 17 00:00:00 2001
From: "Rajesh Prajapati (OpenERP)" 
Date: Fri, 23 Nov 2012 15:19:18 +0530
Subject: [PATCH 013/110] [IMP] account_check_writing : improvements on
 account_check_writing as per requirement

bzr revid: rpr@tinyerp.com-20121123094918-wrj9sli48tp95n1p
---
 addons/account_check_writing/__openerp__.py   |  2 +
 .../account_check_sequence.xml                | 15 +++++
 .../account_check_writing/wizard/__init__.py  | 24 ++++++++
 .../wizard/account_check.py                   | 61 +++++++++++++++++++
 .../wizard/account_check_view.xml             | 28 +++++++++
 5 files changed, 130 insertions(+)
 create mode 100644 addons/account_check_writing/account_check_sequence.xml
 create mode 100644 addons/account_check_writing/wizard/__init__.py
 create mode 100644 addons/account_check_writing/wizard/account_check.py
 create mode 100644 addons/account_check_writing/wizard/account_check_view.xml

diff --git a/addons/account_check_writing/__openerp__.py b/addons/account_check_writing/__openerp__.py
index f5a2355b002..292215044fb 100644
--- a/addons/account_check_writing/__openerp__.py
+++ b/addons/account_check_writing/__openerp__.py
@@ -30,10 +30,12 @@ Module for the Check Writing and Check Printing.
     'website': 'http://www.openerp.com',
     'depends' : ['account_voucher'],
     'data': [
+        'wizard/account_check_view.xml',
         'account_check_writing_report.xml',
         'account_view.xml',
         'account_voucher_view.xml',
         'account_check_writing_data.xml',
+        'account_check_sequence.xml'
     ],
     'demo': ['account_demo.xml'],
     'test': [],
diff --git a/addons/account_check_writing/account_check_sequence.xml b/addons/account_check_writing/account_check_sequence.xml
new file mode 100644
index 00000000000..def380bbe8a
--- /dev/null
+++ b/addons/account_check_writing/account_check_sequence.xml
@@ -0,0 +1,15 @@
+
+
+    
+        
+            Number
+            account.check.write
+        
+
+        
+            Number
+            account.check.write
+            
+                
+    
+
diff --git a/addons/account_check_writing/wizard/__init__.py b/addons/account_check_writing/wizard/__init__.py
new file mode 100644
index 00000000000..74c20e11397
--- /dev/null
+++ b/addons/account_check_writing/wizard/__init__.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL ().
+#
+#    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 .
+#
+##############################################################################
+
+import account_check
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_check_writing/wizard/account_check.py b/addons/account_check_writing/wizard/account_check.py
new file mode 100644
index 00000000000..123febf2cfc
--- /dev/null
+++ b/addons/account_check_writing/wizard/account_check.py
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL ().
+#
+#    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 .
+#
+##############################################################################
+
+import datetime
+import time
+import tools
+from osv import fields, osv
+from tools.translate import _
+
+class account_check_write(osv.osv_memory):
+    _name = 'account.check.write'
+    _description = 'Take input as sequence and print report'
+    _columns = {
+        'check_number': fields.char('Check Number', required=True, help="This is the Check Number"),
+    }
+
+    _defaults = {
+        'check_number': lambda obj, cr, uid, context:obj.pool.get('ir.sequence').get(cr, uid, 'account.check.write'),
+   }
+    def print_check_write(self, cr, uid, ids, context=None):
+        if not ids:
+            return  {}
+
+        check_layout_report = {
+            'top' : 'account.print.check.top',
+            'middle' : 'account.print.check.middle',
+            'bottom' : 'account.print.check.bottom',
+        }
+        check_layout = self.pool.get('account.voucher').browse(cr, uid, context['active_ids'], context=context)[0].company_id.check_layout
+        return {
+            'type': 'ir.actions.report.xml', 
+            'report_name':check_layout_report[check_layout],
+            'datas': {
+                    'model':'account.voucher',
+                    'id': context['active_ids'] and context['active_ids'][0] or False,
+                    'ids': context['active_ids'] and context['active_ids'] or [],
+                    'report_type': 'pdf'
+                },
+            'nodestroy': True
+            }
+
+account_check_write()
+
diff --git a/addons/account_check_writing/wizard/account_check_view.xml b/addons/account_check_writing/wizard/account_check_view.xml
new file mode 100644
index 00000000000..a3930540e43
--- /dev/null
+++ b/addons/account_check_writing/wizard/account_check_view.xml
@@ -0,0 +1,28 @@
+
+
+    
+
+        
+            account.check.form
+            account.check.write
+            
+            
+ + + +
+
+
+
+
+ + + +
+
From 5757c6d051d329903cf1874227aed4e3b0d9d58b Mon Sep 17 00:00:00 2001 From: "Rajesh Prajapati (OpenERP)" Date: Fri, 23 Nov 2012 16:27:51 +0530 Subject: [PATCH 014/110] [IMP] sequence : sequence id changed bzr revid: rpr@tinyerp.com-20121123105751-31kpg6qcrex2p1tv --- addons/account_check_writing/account_check_sequence.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_check_writing/account_check_sequence.xml b/addons/account_check_writing/account_check_sequence.xml index def380bbe8a..f1dd75c5467 100644 --- a/addons/account_check_writing/account_check_sequence.xml +++ b/addons/account_check_writing/account_check_sequence.xml @@ -6,7 +6,7 @@ account.check.write - + Number account.check.write From debb4c004542d1c51af1aecdbbac56d0dd0469b3 Mon Sep 17 00:00:00 2001 From: "Rajesh Prajapati (OpenERP)" Date: Fri, 23 Nov 2012 17:55:46 +0530 Subject: [PATCH 015/110] [IMP] check_writing : method updated for check number sequence behaviour bzr revid: rpr@tinyerp.com-20121123122546-2br0icbjfz75c0vd --- .../wizard/account_check.py | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/addons/account_check_writing/wizard/account_check.py b/addons/account_check_writing/wizard/account_check.py index 123febf2cfc..372a892d19d 100644 --- a/addons/account_check_writing/wizard/account_check.py +++ b/addons/account_check_writing/wizard/account_check.py @@ -18,16 +18,12 @@ # along with this program. If not, see . # ############################################################################## - -import datetime -import time -import tools from osv import fields, osv -from tools.translate import _ class account_check_write(osv.osv_memory): _name = 'account.check.write' _description = 'Take input as sequence and print report' + _columns = { 'check_number': fields.char('Check Number', required=True, help="This is the Check Number"), } @@ -35,24 +31,35 @@ class account_check_write(osv.osv_memory): _defaults = { 'check_number': lambda obj, cr, uid, context:obj.pool.get('ir.sequence').get(cr, uid, 'account.check.write'), } + def print_check_write(self, cr, uid, ids, context=None): - if not ids: - return {} + voucher_obj = self.pool.get('account.voucher') + if context is None: + context = {} + voucher_ids = context.get('active_ids', []) + number = int(self.browse(cr, uid, ids[0], context=context).check_number) + if voucher_ids: + checks = voucher_obj.browse(cr, uid, context['active_ids'], context=context) + for check in checks: + voucher_obj.write(cr, uid, [check.id], {'number': str(number)}, context=context) + number += 1 check_layout_report = { 'top' : 'account.print.check.top', 'middle' : 'account.print.check.middle', 'bottom' : 'account.print.check.bottom', } - check_layout = self.pool.get('account.voucher').browse(cr, uid, context['active_ids'], context=context)[0].company_id.check_layout + + check_layout = voucher_obj.browse(cr, uid, voucher_ids[0], context=context).company_id.check_layout + if not check_layout: + check_layout = 'top' return { 'type': 'ir.actions.report.xml', 'report_name':check_layout_report[check_layout], 'datas': { - 'model':'account.voucher', - 'id': context['active_ids'] and context['active_ids'][0] or False, - 'ids': context['active_ids'] and context['active_ids'] or [], - 'report_type': 'pdf' + 'model':'account.voucher', + 'ids': voucher_ids, + 'report_type': 'pdf' }, 'nodestroy': True } From a15d1ea2e22ca234bf87b5792fb6792288a15ce1 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Fri, 23 Nov 2012 18:20:23 +0530 Subject: [PATCH 016/110] [IMP] account_check_writing : Improved the code. bzr revid: mdi@tinyerp.com-20121123125023-oqkzividb5lct287 --- .../wizard/account_check.py | 2 +- .../wizard/account_check_view.xml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/account_check_writing/wizard/account_check.py b/addons/account_check_writing/wizard/account_check.py index 372a892d19d..d9904249154 100644 --- a/addons/account_check_writing/wizard/account_check.py +++ b/addons/account_check_writing/wizard/account_check.py @@ -39,7 +39,7 @@ class account_check_write(osv.osv_memory): voucher_ids = context.get('active_ids', []) number = int(self.browse(cr, uid, ids[0], context=context).check_number) if voucher_ids: - checks = voucher_obj.browse(cr, uid, context['active_ids'], context=context) + checks = voucher_obj.browse(cr, uid, voucher_ids, context=context) for check in checks: voucher_obj.write(cr, uid, [check.id], {'number': str(number)}, context=context) number += 1 diff --git a/addons/account_check_writing/wizard/account_check_view.xml b/addons/account_check_writing/wizard/account_check_view.xml index a3930540e43..0e4121e9f08 100644 --- a/addons/account_check_writing/wizard/account_check_view.xml +++ b/addons/account_check_writing/wizard/account_check_view.xml @@ -6,15 +6,15 @@ account.check.form account.check.write -
- - - -
-
-
+
+ + + +
+
+
From 62e9ffdfb11aa760f4a39eca2028bc2d694b0e0f Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Fri, 23 Nov 2012 18:37:55 +0530 Subject: [PATCH 017/110] [IMP] account_check_writing : Removed the unnecessary sequence. bzr revid: mdi@tinyerp.com-20121123130755-ryz3n70j855v4cz1 --- addons/account_check_writing/__openerp__.py | 1 - .../account_check_sequence.xml | 15 --------------- .../account_check_writing/wizard/account_check.py | 2 +- 3 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 addons/account_check_writing/account_check_sequence.xml diff --git a/addons/account_check_writing/__openerp__.py b/addons/account_check_writing/__openerp__.py index 292215044fb..c0189a938e7 100644 --- a/addons/account_check_writing/__openerp__.py +++ b/addons/account_check_writing/__openerp__.py @@ -35,7 +35,6 @@ Module for the Check Writing and Check Printing. 'account_view.xml', 'account_voucher_view.xml', 'account_check_writing_data.xml', - 'account_check_sequence.xml' ], 'demo': ['account_demo.xml'], 'test': [], diff --git a/addons/account_check_writing/account_check_sequence.xml b/addons/account_check_writing/account_check_sequence.xml deleted file mode 100644 index f1dd75c5467..00000000000 --- a/addons/account_check_writing/account_check_sequence.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Number - account.check.write - - - - Number - account.check.write - - - - diff --git a/addons/account_check_writing/wizard/account_check.py b/addons/account_check_writing/wizard/account_check.py index d9904249154..9691d83f331 100644 --- a/addons/account_check_writing/wizard/account_check.py +++ b/addons/account_check_writing/wizard/account_check.py @@ -29,7 +29,7 @@ class account_check_write(osv.osv_memory): } _defaults = { - 'check_number': lambda obj, cr, uid, context:obj.pool.get('ir.sequence').get(cr, uid, 'account.check.write'), + 'check_number': lambda obj, cr, uid, context:obj.pool.get('ir.sequence').get(cr, uid, 'check.number'), } def print_check_write(self, cr, uid, ids, context=None): From e8850d8f64d62bd640737e3f459ddc1e7257a1ad Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Mon, 26 Nov 2012 11:32:23 +0530 Subject: [PATCH 018/110] [IMP] account_check_writing : Improved the code. bzr revid: mdi@tinyerp.com-20121126060223-w9mzzsqv4o7xa4zo --- addons/account_check_writing/wizard/account_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_check_writing/wizard/account_check.py b/addons/account_check_writing/wizard/account_check.py index 9691d83f331..7d94c6be80f 100644 --- a/addons/account_check_writing/wizard/account_check.py +++ b/addons/account_check_writing/wizard/account_check.py @@ -22,10 +22,10 @@ from osv import fields, osv class account_check_write(osv.osv_memory): _name = 'account.check.write' - _description = 'Take input as sequence and print report' + _description = 'Assign Check Number' _columns = { - 'check_number': fields.char('Check Number', required=True, help="This is the Check Number"), + 'check_number': fields.char('Check Number', required=True, help="The Check Number."), } _defaults = { From 104af6411bb96345cb4dc94e12378bea6e92596d Mon Sep 17 00:00:00 2001 From: "Rajesh Prajapati (OpenERP)" Date: Mon, 26 Nov 2012 18:49:25 +0530 Subject: [PATCH 019/110] [IMP] check_writing : method updated bzr revid: rpr@tinyerp.com-20121126131925-6hinm1yfv918zyw3 --- addons/account_check_writing/wizard/account_check.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account_check_writing/wizard/account_check.py b/addons/account_check_writing/wizard/account_check.py index 7d94c6be80f..8f98a554c66 100644 --- a/addons/account_check_writing/wizard/account_check.py +++ b/addons/account_check_writing/wizard/account_check.py @@ -41,8 +41,9 @@ class account_check_write(osv.osv_memory): if voucher_ids: checks = voucher_obj.browse(cr, uid, voucher_ids, context=context) for check in checks: - voucher_obj.write(cr, uid, [check.id], {'number': str(number)}, context=context) - number += 1 + if not check.number: + voucher_obj.write(cr, uid, [check.id], {'number': str(number)}, context=context) + number += 1 check_layout_report = { 'top' : 'account.print.check.top', From 8705820fd7b3cd99f4a48c7ef86a1eccf1d7bce0 Mon Sep 17 00:00:00 2001 From: dhr Date: Tue, 27 Nov 2012 14:48:29 +0530 Subject: [PATCH 020/110] [IMP]Solved the traceback issues of settings:From Incoming mail server options open messages bzr revid: dhr@tinyerp.com-20121127091829-1z7e9fi5lh4icz5c --- addons/fetchmail/fetchmail_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/fetchmail/fetchmail_view.xml b/addons/fetchmail/fetchmail_view.xml index 66c7e5a7f5c..6202701714c 100644 --- a/addons/fetchmail/fetchmail_view.xml +++ b/addons/fetchmail/fetchmail_view.xml @@ -117,7 +117,7 @@ + res_model="mail.mail" src_model="fetchmail.server"/> From 7722389ade0b6c2b55c11f321b726c0d854075e3 Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Tue, 27 Nov 2012 15:19:11 +0530 Subject: [PATCH 021/110] [IMP] improved description of consistency test, code help and removed unused functions and condition bzr revid: bde@tinyerp.com-20121127094911-rnidlbk1obfc48tm --- addons/account_test/account_test_data.xml | 3 +-- addons/account_test/account_test_demo.xml | 6 +++--- addons/account_test/account_test_view.xml | 12 +++++++++--- addons/account_test/report/account_test_report.py | 14 -------------- 4 files changed, 13 insertions(+), 22 deletions(-) diff --git a/addons/account_test/account_test_data.xml b/addons/account_test/account_test_data.xml index 415664b9653..2a23c1196f9 100644 --- a/addons/account_test/account_test_data.xml +++ b/addons/account_test/account_test_data.xml @@ -22,8 +22,7 @@ if res[0]['balance']!=0.0 and res[0]['balance'] is not None: 2 Test 2: Opening a fiscal year - - Check if the balance of the new opened fiscal year matches with last year's balance + Displays the debit and credit amount, of closed and newly created fiscal year, if the balance of current and newly created fiscal year mismatch - - Test 1 - Test 1 + 11 + Test 11: Consistency check between Account Move and Account Move Line + Checks id of 'account_move' = move_id of 'account_move_line', and state of 'account_move_line' is valid, and having sum(debit-credit) != 0 -
+You can write a query in order to create Consistency Test and you will get the result of the test 
+in PDF format which can be accessed by Menu Reporting -> Accounting Tests, then select the test 
+and print the report from Print button in header area.
+
+You can also use the following functions:
+
+get_parent(acc_id) : return parent id of analytic account(acc_id)
+reconciled_inv() : returns ids of records which are reconciled
+    
 Example: 
 sql = 'select id, name, ref, date from account_move_line where account_id in 
 (select id from account_account where type = 'view')'
diff --git a/addons/account_test/report/account_test_report.py b/addons/account_test/report/account_test_report.py
index 5c274773cd4..f8ba7a47f65 100644
--- a/addons/account_test/report/account_test_report.py
+++ b/addons/account_test/report/account_test_report.py
@@ -43,16 +43,6 @@ class report_assert_account(report_sxw.rml_parse):
         def group(lst, col):
             return dict((k, [v for v in itr]) for k, itr in groupby(sorted(lst, key=lambda x: x[col]), itemgetter(col)))
 
-        #TODO what is this method used for, name unclear and doesn't seem to be used
-        def sort_by_intified_num(a, b):
-            if a is None:
-                return -1
-            elif b is None:
-                return 1
-            else:
-                #if a is not None and b is not None:
-                return cmp(int(a), int(b))
-
         def reconciled_inv():
             reconciled_inv_ids = self.pool.get('account.invoice').search(self.cr, self.uid, [('reconciled','=',True)])
             return reconciled_inv_ids
@@ -86,12 +76,8 @@ class report_assert_account(report_sxw.rml_parse):
 
         if not isinstance(result, (tuple, list, set)):
             result = [result]
-
         if not result:
             result = [_('The test was passed successfully')]
-        #TODO: not sure this condition is needed, it is only a subcategory of the final else
-        elif all([isinstance(x, dict) for x in result]):
-            result = [', '.join(["%s: %s" % (k, v) for k, v in order_columns(rec, column_order)]) for rec in result]
         else:
             def _format(a):
                 if isinstance(a, dict):

From 555c94b81db5d37cb8a8e025d2c21f5f88270e16 Mon Sep 17 00:00:00 2001
From: Jagdish Panchal 
Date: Tue, 27 Nov 2012 17:56:06 +0530
Subject: [PATCH 022/110] [IMP] project_issue: remove categ_ids filed from
 group by in search

bzr revid: jap@tinyerp.com-20121127122606-fdbnkeps2egxgwhm
---
 addons/project_issue/project_issue_view.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index e3105127c5d..ff936d1b5bb 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -200,12 +200,12 @@
                     
                     
                     
+                    
                     
                         
                         
                         
                         
-                        
                         
                         
                         

From 2d123cbdc6fc22aa56e2f5a53a4022e0f5aa8e8d Mon Sep 17 00:00:00 2001
From: Cedric Snauwaert 
Date: Tue, 27 Nov 2012 15:03:59 +0100
Subject: [PATCH 023/110] [REF]remove some unused lines and add some tips
 message

bzr revid: csn@openerp.com-20121127140359-pvf025717k4m2wsu
---
 addons/account_test/__openerp__.py        |  7 +++---
 addons/account_test/account_test_data.xml |  4 +--
 addons/account_test/account_test_demo.xml | 30 -----------------------
 addons/account_test/account_test_view.xml | 16 ++++++------
 4 files changed, 13 insertions(+), 44 deletions(-)
 delete mode 100644 addons/account_test/account_test_demo.xml

diff --git a/addons/account_test/__openerp__.py b/addons/account_test/__openerp__.py
index 3e98734fe72..cfd4007fed0 100644
--- a/addons/account_test/__openerp__.py
+++ b/addons/account_test/__openerp__.py
@@ -29,6 +29,10 @@
 Asserts on accounting.
 ======================
 With this module you can manually check consistencies and inconsistencies of accounting module from menu Reporting/Accounting/Accounting Tests.
+
+You can write a query in order to create Consistency Test and you will get the result of the test 
+in PDF format which can be accessed by Menu Reporting -> Accounting Tests, then select the test 
+and print the report from Print button in header area.
 """,
     'depends' : ['account'],
     'data' : [
@@ -37,9 +41,6 @@ With this module you can manually check consistencies and inconsistencies of acc
         'account_test_report.xml',
         'account_test_data.xml',
     ],
-    'demo': [
-        'account_test_demo.xml',
-    ],
     'active': False,
     'installable': True
 }
diff --git a/addons/account_test/account_test_data.xml b/addons/account_test/account_test_data.xml
index 2a23c1196f9..4970bef6a0d 100644
--- a/addons/account_test/account_test_data.xml
+++ b/addons/account_test/account_test_data.xml
@@ -22,7 +22,7 @@ if res[0]['balance']!=0.0 and res[0]['balance'] is not None:
     
         2
         Test 2: Opening a fiscal year
-        Displays the debit and credit amount, of closed and newly created fiscal year, if the balance of current and newly created fiscal year mismatch
+        Check if the balance of the new opened fiscal year matches with last year's balance
         
-
-
-
-    
-        11
-        Test 11: Consistency check between Account Move and Account Move Line
-        Checks id of 'account_move' = move_id of 'account_move_line', and state of 'account_move_line' is valid, and having sum(debit-credit) != 0
-        
-         0"""
-cr.execute(sql)
-result = cr.dictfetchall()
-]]>
-    
-
-
-
diff --git a/addons/account_test/account_test_view.xml b/addons/account_test/account_test_view.xml
index 46f02d81d3b..1faca55c4d6 100644
--- a/addons/account_test/account_test_view.xml
+++ b/addons/account_test/account_test_view.xml
@@ -39,15 +39,15 @@
                                 
                                 
                                     
-You can write a query in order to create Consistency Test and you will get the result of the test 
-in PDF format which can be accessed by Menu Reporting -> Accounting Tests, then select the test 
-and print the report from Print button in header area.
+Code should always return a result value. If result is an empty list, it means that
+the test is succesful. Otherwise it will print what is inside result.
+Code must be python with correct indentation (if needed).
+Here is a list of function that you can use in your test :
+ - group(lst, col) : 
+ - reconciled_inv() : return the list of all reconciled invoices
+ - get_parent(acc_id) : get parent analytical account
+ - now() : return current datetime
 
-You can also use the following functions:
-
-get_parent(acc_id) : return parent id of analytic account(acc_id)
-reconciled_inv() : returns ids of records which are reconciled
-    
 Example: 
 sql = 'select id, name, ref, date from account_move_line where account_id in 
 (select id from account_account where type = 'view')'

From 21b1aa529591a54f96ee35c2828106bb23d77f4e Mon Sep 17 00:00:00 2001
From: dhr 
Date: Fri, 30 Nov 2012 11:30:20 +0530
Subject: [PATCH 024/110] [IMP]Get email on change of partner and made
 invitation tab visible to all users

bzr revid: dhr@tinyerp.com-20121130060020-9pn7666r96dag2nc
---
 addons/base_calendar/base_calendar.py     | 19 ++++++++++++++++++-
 addons/base_calendar/crm_meeting_view.xml |  4 ++--
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index d225c3f90d9..4c4e7a16876 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -384,9 +384,26 @@ property or property parameter."),
         'cutype': 'individual',
     }
 
+
     def copy(self, cr, uid, id, default=None, context=None):
         raise osv.except_osv(_('Warning!'), _('You cannot duplicate a calendar attendee.'))
-
+    
+    def onchange_partner_id(self, cr, uid, ids, partner_id,context=None):
+        """
+        Make entry on email and availbility on change of partner_id field.
+        @param cr: the current row, from the database cursor
+        @param uid: the current user's ID for security checks
+        @param ids: list of calendar attendee's IDs
+        @param partner_id: changed value of partner id
+        @param context: a standard dictionary for contextual values
+        @return: dictionary of values which put value in email and availability fields
+        """
+        
+        if not partner_id:
+            return {'value': {'email': ''}}
+        partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
+        return {'value': {'email': partner.email}}
+    
     def get_ics_file(self, cr, uid, event_obj, context=None):
         """
         Returns iCalendar file for the event invitation.
diff --git a/addons/base_calendar/crm_meeting_view.xml b/addons/base_calendar/crm_meeting_view.xml
index 84c03d68dbd..77018898c84 100644
--- a/addons/base_calendar/crm_meeting_view.xml
+++ b/addons/base_calendar/crm_meeting_view.xml
@@ -171,10 +171,10 @@
                             
                         
                     
-                    
+                    
                         
                             
-                                
+