From cd7181d76f7e627bc0ae262b4a206b8f8801f2ae Mon Sep 17 00:00:00 2001 From: "Rajesh Prajapati (OpenERP)" Date: Fri, 23 Nov 2012 15:19:18 +0530 Subject: [PATCH 01/36] [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 02/36] [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 03/36] [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 04/36] [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 05/36] [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 06/36] [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 07/36] [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 08/36] [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 555c94b81db5d37cb8a8e025d2c21f5f88270e16 Mon Sep 17 00:00:00 2001 From: Jagdish Panchal Date: Tue, 27 Nov 2012 17:56:06 +0530 Subject: [PATCH 09/36] [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 21b1aa529591a54f96ee35c2828106bb23d77f4e Mon Sep 17 00:00:00 2001 From: dhr Date: Fri, 30 Nov 2012 11:30:20 +0530 Subject: [PATCH 10/36] [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 @@ - + - +