From 6a9d197c6ba39078a51e935f0a24bcde2f22c616 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 8 Jan 2010 12:50:51 +0530 Subject: [PATCH 01/16] [Fix] crm: Add the graph of crm opportunity bzr revid: sbh@tinyerp.com-20100108072051-tj6y7y4i4znvm9k1 --- addons/crm/crm_opportunity_menu.xml | 2 +- addons/crm/crm_opportunity_view.xml | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/addons/crm/crm_opportunity_menu.xml b/addons/crm/crm_opportunity_menu.xml index 0ab07b3d61b..8f64a729107 100644 --- a/addons/crm/crm_opportunity_menu.xml +++ b/addons/crm/crm_opportunity_menu.xml @@ -26,7 +26,7 @@ graph - + diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml index ffd645fea66..1a4fa729899 100644 --- a/addons/crm/crm_opportunity_view.xml +++ b/addons/crm/crm_opportunity_view.xml @@ -177,6 +177,18 @@ + + CRM - Opportunity Graph + crm.opportunity + graph + + + + + + + + CRM - Opportunities Search @@ -196,7 +208,7 @@ /> - + - + + From 45407b1e1f67ecf3e0efa444aefc3ab3a405a1c6 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 8 Jan 2010 12:57:21 +0530 Subject: [PATCH 02/16] [IMP] Invoice/Sale/Purchase : Made note fields translatable(they may be used for partner reports) bzr revid: jvo@tinyerp.com-20100108072721-vr4s051bqx7bwlmq --- addons/account/invoice.py | 4 ++-- addons/purchase/purchase.py | 4 ++-- addons/sale/sale.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 3442e914634..a3146d9456d 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -236,7 +236,7 @@ class account_invoice(osv.osv): 'reference': fields.char('Invoice Reference', size=64, help="The partner reference of this invoice."), 'reference_type': fields.selection(_get_reference_type, 'Reference Type', required=True), - 'comment': fields.text('Additional Information'), + 'comment': fields.text('Additional Information', translate=True), 'state': fields.selection([ ('draft','Draft'), @@ -1093,7 +1093,7 @@ class account_invoice_line(osv.osv): 'quantity': fields.float('Quantity', required=True), 'discount': fields.float('Discount (%)', digits=(16, int(config['price_accuracy']))), 'invoice_line_tax_id': fields.many2many('account.tax', 'account_invoice_line_tax', 'invoice_line_id', 'tax_id', 'Taxes', domain=[('parent_id','=',False)]), - 'note': fields.text('Notes'), + 'note': fields.text('Notes', translate=True), 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'), 'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company',store=True) } diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 1e11a532738..3d344dc17f8 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -166,7 +166,7 @@ class purchase_order(osv.osv): 'state': fields.selection([('draft', 'Request for Quotation'), ('wait', 'Waiting'), ('confirmed', 'Waiting Supplier Ack'), ('approved', 'Approved'),('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, help="The state of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' state. Then the order has to be confirmed by the user, the state switch to 'Confirmed'. Then the supplier must confirm the order to change the state to 'Approved'. When the purchase order is paid and received, the state becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the state becomes in exception.", select=True), 'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'approved':[('readonly',True)]}), 'validator' : fields.many2one('res.users', 'Validated by', readonly=True), - 'notes': fields.text('Notes'), + 'notes': fields.text('Notes', translate=True), 'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True), 'picking_ids': fields.one2many('stock.picking', 'purchase_id', 'Picking List', readonly=True, help="This is the list of picking list that have been generated for this purchase"), 'shipped':fields.boolean('Received', readonly=True, select=True), @@ -453,7 +453,7 @@ class purchase_order_line(osv.osv): 'move_dest_id': fields.many2one('stock.move', 'Reservation Destination', ondelete='set null'), 'price_unit': fields.float('Unit Price', required=True, digits=(16, int(config['price_accuracy']))), 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits=(16, int(config['price_accuracy']))), - 'notes': fields.text('Notes'), + 'notes': fields.text('Notes', translate=True), 'order_id': fields.many2one('purchase.order', 'Order Reference', select=True, required=True, ondelete='cascade'), 'account_analytic_id':fields.many2one('account.analytic.account', 'Analytic Account',), 'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company') diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 2f79f8a2a08..5389c944b73 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -230,7 +230,7 @@ class sale_order(osv.osv): 'invoiced_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'), 'invoiced': fields.function(_invoiced, method=True, string='Paid', fnct_search=_invoiced_search, type='boolean'), - 'note': fields.text('Notes'), + 'note': fields.text('Notes', translate=True), 'amount_untaxed': fields.function(_amount_all, method=True, digits=(16, int(config['price_accuracy'])), string='Untaxed Amount', store = { @@ -773,7 +773,7 @@ class sale_order_line(osv.osv): 'move_ids': fields.one2many('stock.move', 'sale_line_id', 'Inventory Moves', readonly=True), 'discount': fields.float('Discount (%)', digits=(16, 2)), 'number_packages': fields.function(_number_packages, method=True, type='integer', string='Number Packages'), - 'notes': fields.text('Notes'), + 'notes': fields.text('Notes', translate=True), 'th_weight': fields.float('Weight'), 'state': fields.selection([('draft', 'Draft'),('confirmed', 'Confirmed'),('done', 'Done'),('cancel', 'Cancelled'),('exception', 'Exception')], 'State', required=True, readonly=True, help=' * The \'Draft\' state is set automatically when sale order in draft state. \ From db07bd4427d4cab1cff5b192baed107abae7c138 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Fri, 8 Jan 2010 13:01:08 +0530 Subject: [PATCH 03/16] [FIX] document_caldev: make certificate tag blank in terp bzr revid: mra@tinyerp.com-20100108073108-41b5ml7rc4ec03i8 --- addons/document_caldav/__terp__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/document_caldav/__terp__.py b/addons/document_caldav/__terp__.py index b8b586742b0..9bc22884fee 100644 --- a/addons/document_caldav/__terp__.py +++ b/addons/document_caldav/__terp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -33,6 +33,5 @@ 'demo_xml': ['document_demo.xml'], 'installable': True, 'active': False, - 'certificate': False, } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 9465f58df63b1450858837a380ef993442a757d5 Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Fri, 8 Jan 2010 13:06:42 +0530 Subject: [PATCH 04/16] [FIX] Stock : Reference to Invoice views corrected lp bug: https://launchpad.net/bugs/504443 fixed bzr revid: jvo@tinyerp.com-20100108073642-v08zkfoz21h56a9z --- addons/stock/wizard/wizard_invoice_onshipping.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/stock/wizard/wizard_invoice_onshipping.py b/addons/stock/wizard/wizard_invoice_onshipping.py index 2c6b2f2f4f0..61cd1176973 100644 --- a/addons/stock/wizard/wizard_invoice_onshipping.py +++ b/addons/stock/wizard/wizard_invoice_onshipping.py @@ -121,13 +121,13 @@ def _create_invoice(obj, cr, uid, data, context): raise wizard.except_wizard(_('Error'), _('Invoice is not created')) if type == 'out_invoice': - xml_id = 'action_invoice_tree5' + xml_id = 'action_invoice_tree1' elif type == 'in_invoice': - xml_id = 'action_invoice_tree8' + xml_id = 'action_invoice_tree2' elif type == 'out_refund': - xml_id = 'action_invoice_tree10' + xml_id = 'action_invoice_tree3' else: - xml_id = 'action_invoice_tree12' + xml_id = 'action_invoice_tree4' result = mod_obj._get_id(cr, uid, 'account', xml_id) id = mod_obj.read(cr, uid, result, ['res_id']) From 596b4dfea94baa2cc5eda9f15b51a495a8adb2e9 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 8 Jan 2010 13:53:45 +0530 Subject: [PATCH 05/16] [FIX]: crm: Fixed problem of alarm in import event bzr revid: rpa@openerp.co.in-20100108082345-4yzdcr9n00m89k3j --- addons/crm/crm_meeting.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index 0d067f84210..018fd5e1802 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -135,7 +135,7 @@ class crm_meeting(osv.osv): for meeting in self.browse(cr, uid, ids): self.do_alarm_unlink(cr, uid, [meeting.id]) basic_alarm = meeting.alarm_id - if basic_alarm and meeting.state in ('open'): + if basic_alarm: vals = { 'action': 'display', 'description': meeting.description, @@ -217,17 +217,18 @@ class crm_meeting(osv.osv): is_exists = common.uid2openobjectid(cr, val['id'], self._name) if val.has_key('create_date'): val.pop('create_date') val['caldav_url'] = context.get('url') or '' -# caldav_alarm_id = val['caldav_alarm_id'] val.pop('id') if is_exists: if val['caldav_alarm_id']: - val['alarm_id'] = self.browse(cr, uid, is_exists).caldav_alarm_id.alarm_id.id + cal_alarm = self.browse(cr, uid, is_exists).caldav_alarm_id + val['alarm_id'] = cal_alarm.alarm_id and cal_alarm.alarm_id.id or False self.write(cr, uid, [is_exists], val) else: case_id = self.create(cr, uid, val) - if caldav_alarm_id: - alarm_id = self.browse(cr, uid, is_exists).caldav_alarm_id.alarm_id - self.write(cr, uid, case_id, {'alarm_id': alarm_id}) + if val['caldav_alarm_id']: + cal_alarm = self.browse(cr, uid, case_id).caldav_alarm_id + alarm_id = cal_alarm.alarm_id and cal_alarm.alarm_id.id or False + self.write(cr, uid, [case_id], {'alarm_id': alarm_id}) return {'count': len(vals)} def get_recurrent_ids(self, cr, uid, ids, start_date, until_date, limit=100): From da65f9b1a1b7693bc6a3291d08204ae2f3763ab5 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 8 Jan 2010 14:15:44 +0530 Subject: [PATCH 06/16] [FIX]: crm: Fixed problem of computing deadline from on_change duration bzr revid: rpa@openerp.co.in-20100108084544-l48h5cwrl8w69xr6 --- addons/crm/crm_meeting.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index 018fd5e1802..2e74f467bd7 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -99,7 +99,6 @@ class crm_meeting(osv.osv): _columns = { 'inherit_case_id': fields.many2one('crm.case', 'Case', ondelete='cascade'), - 'date_deadline': fields.datetime('Deadline', help="Deadline Date is automatically computed from Start Date + Duration"), 'class': fields.selection([('public', 'Public'), ('private', 'Private'), \ ('confidential', 'Confidential')], 'Privacy'), 'location': fields.char('Location', size=264, help="Gives Location of Meeting"), @@ -320,7 +319,7 @@ class crm_meeting(osv.osv): if 'case_id' in vals: vals['case_id'] = common.caldav_id2real_id(vals['case_id']) res = super(crm_meeting, self).write(cr, uid, new_ids, vals, context=context) - self.do_alarm_create(cr, uid, ids) + self.do_alarm_create(cr, uid, new_ids) return res def browse(self, cr, uid, ids, context=None, list_class=None, fields_process={}): From 0e4457b63b87bf521f00cc9020539a3357841faa Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 8 Jan 2010 15:03:24 +0530 Subject: [PATCH 07/16] [IMP]: caldav, crm: Improvement for importing/exporting proper data bzr revid: rpa@openerp.co.in-20100108093324-dbopuq81aif61dbi --- addons/caldav/calendar.py | 4 +++- addons/crm/crm_meeting.py | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index 503a02768d8..7136f4ef643 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -61,7 +61,7 @@ def map_data(cr, uid, obj): continue if field_type == 'many2one': id = None - if not map_val: + if not map_val or not isinstance(map_val, dict): vals[field] = id continue model = obj.__attribute__[map_dict].get('object', False) @@ -144,6 +144,8 @@ class CalDAV(object): vevent.add(field).value = parser.parse(data[map_field]) elif map_type == "timedelta": vevent.add(field).value = timedelta(hours=data[map_field]) + elif map_type == "many2one": + vevent.add(field).value = [data.get(map_field)[1]] if self.__attribute__.get(field).has_key('mapping'): for key1, val1 in self.ical_get(field, 'mapping').items(): if val1 == data[map_field]: diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index 2e74f467bd7..7f34c90d4e3 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -54,7 +54,7 @@ class crm_meeting(osv.osv): # 'attach': {'field': 'attachment_ids', 'sub-field': 'datas', 'type': 'list'}, 'attendee': {'field': 'attendee_ids', 'type': 'many2many', 'object': 'calendar.attendee'}, # 'categories': {'field': 'categ_id', 'sub-field': 'name'}, -# 'categories': {'field':None , 'sub-field': 'name', 'type': 'text'}, + 'categories': {'field': 'categ_id', 'type': 'many2one', 'object': 'crm.case.categ'}, 'comment': None, 'contact': None, 'exdate' : {'field': 'exdate', 'type': 'datetime'}, @@ -66,7 +66,7 @@ class crm_meeting(osv.osv): 'rrule': {'field': 'rrule', 'type': 'text'}, 'x-openobject-model': {'value': _name, 'type': 'text'}, # 'duration': {'field': 'duration'}, - 'dtend': {'field': 'date_closed', 'type': 'datetime'}, + 'dtend': {'field': 'date_deadline', 'type': 'datetime'}, 'valarm': {'field': 'caldav_alarm_id', 'type': 'many2one', 'object': 'calendar.alarm'}, } @@ -227,12 +227,12 @@ class crm_meeting(osv.osv): if val['caldav_alarm_id']: cal_alarm = self.browse(cr, uid, case_id).caldav_alarm_id alarm_id = cal_alarm.alarm_id and cal_alarm.alarm_id.id or False - self.write(cr, uid, [case_id], {'alarm_id': alarm_id}) + self.write(cr, uid, [case_id], {'alarm_id': alarm_id}) return {'count': len(vals)} def get_recurrent_ids(self, cr, uid, ids, start_date, until_date, limit=100): if not limit: - limit = 100 + limit = 100 if ids and (start_date or until_date): cr.execute("select m.id, m.rrule, c.date, m.exdate from crm_meeting m\ join crm_case c on (c.id=m.inherit_case_id) \ From 8fe7d4c0a7acc0c83020f4154c7fe0361b978e9a Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 8 Jan 2010 15:58:50 +0530 Subject: [PATCH 08/16] [IMP]: caldav, crm: Implemented maintanence of event data in attendee invitation + Improvements bzr revid: rpa@openerp.co.in-20100108102850-0pqnfppm73fxz8s0 --- addons/caldav/caldav_view.xml | 24 ++-- addons/caldav/common.py | 190 ++++++++++++++++++-------------- addons/crm/crm_meeting_view.xml | 2 +- 3 files changed, 127 insertions(+), 89 deletions(-) diff --git a/addons/caldav/caldav_view.xml b/addons/caldav/caldav_view.xml index 3dc58a6a765..38fa44ecedd 100644 --- a/addons/caldav/caldav_view.xml +++ b/addons/caldav/caldav_view.xml @@ -14,7 +14,8 @@ - + +