From 3d98f01646fc82233698d895170eadeaee459938 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Wed, 17 Jun 2009 09:27:15 +0200 Subject: [PATCH 002/470] [ADD] Added a module to easily enter RIBs (standard French bank details slips). bzr revid: ls@numerigraphe.fr-20090617072715-hdkf86qq0nskc5q7 --- addons/base_rib/__init__.py | 26 +++++++ addons/base_rib/__terp__.py | 40 +++++++++++ addons/base_rib/base_rib.py | 112 ++++++++++++++++++++++++++++++ addons/base_rib/base_rib_data.xml | 38 ++++++++++ addons/base_rib/base_rib_view.xml | 90 ++++++++++++++++++++++++ addons/base_rib/i18n/fr_FR.po | 81 +++++++++++++++++++++ 6 files changed, 387 insertions(+) create mode 100644 addons/base_rib/__init__.py create mode 100644 addons/base_rib/__terp__.py create mode 100644 addons/base_rib/base_rib.py create mode 100644 addons/base_rib/base_rib_data.xml create mode 100644 addons/base_rib/base_rib_view.xml create mode 100644 addons/base_rib/i18n/fr_FR.po diff --git a/addons/base_rib/__init__.py b/addons/base_rib/__init__.py new file mode 100644 index 00000000000..f715da6a386 --- /dev/null +++ b/addons/base_rib/__init__.py @@ -0,0 +1,26 @@ +# -*- 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 base_rib + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/base_rib/__terp__.py b/addons/base_rib/__terp__.py new file mode 100644 index 00000000000..4712b449b9d --- /dev/null +++ b/addons/base_rib/__terp__.py @@ -0,0 +1,40 @@ +# -*- 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 . +# +############################################################################## + + +{ + 'name': 'RIB', + 'version': '0.1', + 'category': 'Generic Modules/Base', + 'description': """ +This module install the base for RIB bank accounts (French standard for bank accounts). +To make it easier to enter RIB data, it will also allow to search for banks by code. + + """, + "author" : "Numérigraphe SARL", + 'depends': ['base', 'account'], + 'init_xml': ['base_rib_data.xml', ], + 'update_xml': ['base_rib_view.xml', ], + 'installable': True, + 'active': False, +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_rib/base_rib.py b/addons/base_rib/base_rib.py new file mode 100644 index 00000000000..34c86902a67 --- /dev/null +++ b/addons/base_rib/base_rib.py @@ -0,0 +1,112 @@ +# -*- 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 string +import unicodedata + +import netsvc +from osv import fields, osv + +# Add fields and behavior for French RIB +class res_partner_bank(osv.osv): + _inherit = "res.partner.bank" + + def _check_key(self, cr, uid, ids): + ''' + Check the RIB key + ''' + for bank_acc in self.browse(cr, uid, ids): + # ignore the accounts of type other than rib + if bank_acc.state !='rib': + continue + + # Fail if the needed values are empty of too short + if (not bank_acc.bank or not bank_acc.bank.code or len(bank_acc.bank.code) != 5 + or not bank_acc.office or len(bank_acc.office) != 5 + or not bank_acc.acc_number or len(bank_acc.acc_number) != 11 + or not bank_acc.key or len(bank_acc.key) != 2): + return False + + # get the rib data (without the key) + rib = "%s%s%s" % (bank_acc.bank.code, bank_acc.office, bank_acc.acc_number) + # translate letters into numbers according to a specific table (notice how s -> 2) + # Note: maketrans and translate work best with latin1 - that should not be a problem for RIB data + rib = rib.lower().encode('latin-1').translate(string.maketrans(u'abcdefghijklmnopqrstuvwxyz', u'12345678912345678923456789')) + + # compute the key + key = 97 - (100 * int(rib)) % 97 + + if int(bank_acc.key) != key: + return False + return True + + def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): + #overwrite the search method in order to search not only on bank type == basic account number but also on type == rib + res = super(res_partner_bank, self).search(cr, uid, args, offset, limit, order, context=context, count=count) + if filter(lambda x:x[0] == 'acc_number' , args): + #get the value of the search + rib_value = filter(lambda x:x[0] == 'acc_number' , args)[0][2] + #get the other arguments of the search + args1 = filter(lambda x:x[0] != 'acc_number' , args) + #add the new criterion + args1 += [('rib', 'ilike', rib_value)] + #append the results to the older search + res += super(res_partner_bank, self).search(cr, uid, args1, offset, limit, + order, context=context, count=count) + return res + + _columns = { + 'office': fields.char('Office Code', size=5, readonly=True, help="Office Code"), + 'key': fields.char('Key', size=2, readonly=True, help="The key is a number allowing to check the correctness of the other codes."), + } + + _constraints = [(_check_key, "The RIB key does not correspond to the other codes.", ["key"])] + +res_partner_bank() + +# overload the name_search method on banks to make it easier to enter RIB data +class res_bank(osv.osv): + _inherit = 'res.bank' + + # allow a search by code + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + if not args: + args = [] + if context is None: + context = {} + ids = [] + if name: + ids = self.search(cr, user, [('name', operator, name)] + args, limit=limit, context=context) + if not ids: + ids = self.search(cr, user, [('code', operator, name)] + args, limit=limit, context=context) + return self.name_get(cr, user, ids, context) + + # show the code before the name + def name_get(self, cr, uid, ids, context=None): + result = [] + for bank in self.browse(cr, uid, ids, context): + result.append((bank.id, (bank.code and (bank.code + ' - ') or '') + bank.name)) + return result + +res_bank() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/base_rib/base_rib_data.xml b/addons/base_rib/base_rib_data.xml new file mode 100644 index 00000000000..40d57851912 --- /dev/null +++ b/addons/base_rib/base_rib_data.xml @@ -0,0 +1,38 @@ + + + + + + + RIB Bank Details + rib + + + bank + + + + + + office + + + + + + acc_number + + + + 11 + + + key + + + + + + diff --git a/addons/base_rib/base_rib_view.xml b/addons/base_rib/base_rib_view.xml new file mode 100644 index 00000000000..eacfaf1cb5b --- /dev/null +++ b/addons/base_rib/base_rib_view.xml @@ -0,0 +1,90 @@ + + + + + + res.partner.form.rib0.inherit + res.partner + + form + + + + + + res.partner.form.rib1.inherit + res.partner + + form + + + + + + + + + + + res.partner.form.rib2.inherit + res.partner + + form + + + + + + + + + diff --git a/addons/base_rib/i18n/fr_FR.po b/addons/base_rib/i18n/fr_FR.po new file mode 100644 index 00000000000..af12a611964 --- /dev/null +++ b/addons/base_rib/i18n/fr_FR.po @@ -0,0 +1,81 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_rib +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-06-16 14:15:16+0000\n" +"PO-Revision-Date: 2009-06-16 14:15:16+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: base_rib +#: model:res.partner.bank.type.field,name:base_rib.rib_key_field +msgid "key" +msgstr "key" + +#. module: base_rib +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML non valide pour l'architecture de la vue" + +#. module: base_rib +#: model:ir.module.module,description:base_rib.module_meta_information +msgid "\n" +"This module install the base for RIB bank accounts (French standard for bank accounts). \n" +"To make it easier to enter RIB data, it will also allow to search for banks by code.\n" +"\n" +" " +msgstr "\n" +"Ce module configure la base pour la saisie des RIB (Relevés d'Identité Bancaires) standards français. \n" +"Pour faciliter la saisie des RIB, il permet également une recherche des banques par code.\n" +"\n" +" " + +#. module: base_rib +#: model:res.partner.bank.type.field,name:base_rib.rib_office_field +msgid "office" +msgstr "Agence" + +#. module: base_rib +#: field:res.partner.bank,office:0 +#: help:res.partner.bank,office:0 +msgid "Office Code" +msgstr "Code agence" + +#. module: base_rib +#: model:res.partner.bank.type,name:base_rib.bank_rib +msgid "RIB Bank Details" +msgstr "Relevé d'identité bancaire (RIB)" + +#. module: base_rib +#: help:res.partner.bank,key:0 +msgid "The key is a number allowing to check the correctness of the other codes." +msgstr "La clé est un nombre permettant de vérifier que les autres codes sont corrects." + +#. module: base_rib +#: field:res.partner.bank,key:0 +msgid "Key" +msgstr "Clé" + +#. module: base_rib +#: model:ir.module.module,shortdesc:base_rib.module_meta_information +msgid "RIB" +msgstr "RIB" + +#. module: base_rib +#: model:res.partner.bank.type.field,name:base_rib.rib_bank_field +msgid "bank" +msgstr "bank" + +#. module: base_rib +#: model:res.partner.bank.type.field,name:base_rib.bank_acc_number_field +msgid "acc_number" +msgstr "acc_number" + From cf00c7a7be240762baf092d30966a54a930d8df4 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Fri, 19 Jun 2009 10:28:35 +0200 Subject: [PATCH 003/470] Fixed licence for base_rib bzr revid: ls@numerigraphe.fr-20090619082835-b4vr0z9tojhpnk5a --- addons/base_rib/__init__.py | 4 +--- addons/base_rib/__terp__.py | 5 +---- addons/base_rib/base_rib.py | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/addons/base_rib/__init__.py b/addons/base_rib/__init__.py index f715da6a386..b49b0bdb212 100644 --- a/addons/base_rib/__init__.py +++ b/addons/base_rib/__init__.py @@ -1,9 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# $Id$ +# Copyright (C) 2009 Numérigraphe SARL. # # 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 diff --git a/addons/base_rib/__terp__.py b/addons/base_rib/__terp__.py index 4712b449b9d..30741be0543 100644 --- a/addons/base_rib/__terp__.py +++ b/addons/base_rib/__terp__.py @@ -1,9 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# $Id$ +# Copyright (C) 2009 Numérigraphe SARL. # # 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 @@ -20,7 +18,6 @@ # ############################################################################## - { 'name': 'RIB', 'version': '0.1', diff --git a/addons/base_rib/base_rib.py b/addons/base_rib/base_rib.py index 34c86902a67..69a9d2284f2 100644 --- a/addons/base_rib/base_rib.py +++ b/addons/base_rib/base_rib.py @@ -1,9 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# $Id$ +# Copyright (C) 2009 Numérigraphe SARL. All Rights Reserved # # 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 From 297637f890a77b7b119698f56ca6264fac71b1aa Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Fri, 19 Jun 2009 13:54:17 +0200 Subject: [PATCH 004/470] [IMP] POT file for base_rib. bzr revid: ls@numerigraphe.fr-20090619115417-e14n1md5j9aakzmc --- addons/base_rib/i18n/base_rib.pot | 77 +++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 addons/base_rib/i18n/base_rib.pot diff --git a/addons/base_rib/i18n/base_rib.pot b/addons/base_rib/i18n/base_rib.pot new file mode 100644 index 00000000000..393825233e5 --- /dev/null +++ b/addons/base_rib/i18n/base_rib.pot @@ -0,0 +1,77 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_rib +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-06-19 11:39:18+0000\n" +"PO-Revision-Date: 2009-06-19 11:39:18+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: base_rib +#: model:res.partner.bank.type.field,name:base_rib.rib_key_field +msgid "key" +msgstr "" + +#. module: base_rib +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: base_rib +#: model:ir.module.module,description:base_rib.module_meta_information +msgid "\n" +"This module install the base for RIB bank accounts (French standard for bank accounts). \n" +"To make it easier to enter RIB data, it will also allow to search for banks by code.\n" +"\n" +" " +msgstr "" + +#. module: base_rib +#: model:res.partner.bank.type.field,name:base_rib.rib_office_field +msgid "office" +msgstr "" + +#. module: base_rib +#: field:res.partner.bank,office:0 +#: help:res.partner.bank,office:0 +msgid "Office Code" +msgstr "" + +#. module: base_rib +#: model:res.partner.bank.type,name:base_rib.bank_rib +msgid "RIB Bank Details" +msgstr "" + +#. module: base_rib +#: help:res.partner.bank,key:0 +msgid "The key is a number allowing to check the correctness of the other codes." +msgstr "" + +#. module: base_rib +#: field:res.partner.bank,key:0 +msgid "Key" +msgstr "" + +#. module: base_rib +#: model:ir.module.module,shortdesc:base_rib.module_meta_information +msgid "RIB" +msgstr "" + +#. module: base_rib +#: model:res.partner.bank.type.field,name:base_rib.rib_bank_field +msgid "bank" +msgstr "" + +#. module: base_rib +#: model:res.partner.bank.type.field,name:base_rib.bank_acc_number_field +msgid "acc_number" +msgstr "" + From 5ec8cd1146a15d170c5f460f570f38b6037889b9 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 23 May 2011 18:04:04 +0530 Subject: [PATCH 005/470] [FIX] analytic:Wrong adaptation of the partner address in the Project view lp bug: https://launchpad.net/bugs/781189 fixed bzr revid: ara@tinyerp.com-20110523123404-zjqi69go1ecv36f1 --- addons/account/project/project_view.xml | 3 ++- addons/analytic/analytic.py | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 8fd35a21a89..983d8311229 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -88,7 +88,8 @@ - + + diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 6dfaac21e70..e487a742e47 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -236,6 +236,13 @@ class account_analytic_account(osv.osv): res['value']['partner_id'] = partner return res + def onchange_partner_id(self, cr, uid, ids, partner, context=None): + partner_obj = self.pool.get('res.partner') + if not partner: + return {'value':{'contact_id': False}} + address = partner_obj.address_get(cr, uid, [partner], ['contact']) + return {'value':{'contact_id': address['contact']}} + def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): if not args: args=[] From ecd639c4ef8d7ab73cef51767ef3397e30bc9d94 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Wed, 25 May 2011 15:44:03 +0530 Subject: [PATCH 006/470] [FIX] STOCK:Physical Inventory - wrong calculation, now calculate current location stock not child location stock lp bug: https://launchpad.net/bugs/787717 fixed bzr revid: aag@tinyerp.co.in-20110525101403-l02frg06h70lq6y4 --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 636ae0cb067..7811d22377f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2646,7 +2646,7 @@ class stock_inventory_line(osv.osv): return {'value': {'product_qty': 0.0, 'product_uom': False}} obj_product = self.pool.get('product.product').browse(cr, uid, product) uom = uom or obj_product.uom_id.id - amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom, 'to_date': to_date})[product] + amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom, 'to_date': to_date, 'compute_child': False})[product] result = {'product_qty': amount, 'product_uom': uom} return {'value': result} From f407e76f9167b8fbad0cbe50a8a23d93567a674d Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 25 May 2011 16:39:06 +0530 Subject: [PATCH 007/470] [FIX] Accounting - Generic Chart of Accounts - Wrong demo data lp bug: https://launchpad.net/bugs/785110 fixed bzr revid: ara@tinyerp.com-20110525110906-nel3idjx81zsuq5s --- addons/account/configurable_account_chart.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/account/configurable_account_chart.xml b/addons/account/configurable_account_chart.xml index 1a0a21d3971..14dceb185a6 100644 --- a/addons/account/configurable_account_chart.xml +++ b/addons/account/configurable_account_chart.xml @@ -593,12 +593,18 @@ - + - + + + + + + + From 753dba6bf7510c012da1d366b04c3c9b749d01a3 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Fri, 17 Jun 2011 19:13:05 +0530 Subject: [PATCH 008/470] [FIX] stock:payment term is set for supplier invoices in PO from Picking lp bug: https://launchpad.net/bugs/798256 fixed bzr revid: aag@tinyerp.co.in-20110617134305-2f5gvs58blj1e5rf --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d478ab39c9c..ef71c273273 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1012,7 +1012,7 @@ class stock_picking(osv.osv): 'address_invoice_id': address_invoice_id, 'address_contact_id': address_contact_id, 'comment': comment, - 'payment_term': payment_term_id, + 'payment_term': address.partner_id.property_payment_term and address.partner_id.property_payment_term.id or False, 'fiscal_position': partner.property_account_position.id, 'date_invoice': context.get('date_inv',False), 'company_id': picking.company_id.id, From b55387a8bb0b8fd4b4e3164652cef72e839ad825 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Tue, 21 Jun 2011 14:27:43 +0530 Subject: [PATCH 009/470] [REF] account: Replaced tax mappings for Normal tax in generic chart of accounts demo data. bzr revid: uco@tinyerp.com-20110621085743-36fua2qguh2q1cj9 --- addons/account/configurable_account_chart.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/configurable_account_chart.xml b/addons/account/configurable_account_chart.xml index 14dceb185a6..2373d01618c 100644 --- a/addons/account/configurable_account_chart.xml +++ b/addons/account/configurable_account_chart.xml @@ -592,8 +592,8 @@ - - + + From 8e6ca32aebb6a20ccc3586814f9c263856154497 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Tue, 21 Jun 2011 17:55:25 +0530 Subject: [PATCH 010/470] [FIX] sale: Fixed wrong quantities on Sales Analysis report. lp bug: https://launchpad.net/bugs/798148 fixed bzr revid: uco@tinyerp.com-20110621122525-td4gwknknl92bx54 --- addons/sale/report/sale_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py index aaaec228d7b..57f47176b75 100644 --- a/addons/sale/report/sale_report.py +++ b/addons/sale/report/sale_report.py @@ -95,7 +95,7 @@ class sale_report(osv.osv): else u.name end) as uom_name, - sum(l.product_uom_qty * u.factor) as product_uom_qty, + sum(l.product_uom_qty / u.factor) as product_uom_qty, sum(l.product_uom_qty * l.price_unit) as price_total, pt.categ_id, l.order_id from From 965b3320826d05e807ed490817baa6012678065b Mon Sep 17 00:00:00 2001 From: "mayur maheshwari (Open ERP)" Date: Tue, 21 Jun 2011 18:15:42 +0530 Subject: [PATCH 011/470] [FIX]product: set a default value public price in pricelist rule lp bug: https://launchpad.net/bugs/799615 fixed bzr revid: mma@tinyerp.com-20110621124542-lldjf5fnjb6ff9e5 --- addons/product/pricelist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index 81cec0e7d95..abbc6dc86f2 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -522,7 +522,7 @@ class product_pricelist_item(osv.osv): _description = "Pricelist item" _order = "sequence, min_quantity desc" _defaults = { - 'base': lambda *a: -1, + 'base': lambda *a: 1, 'min_quantity': lambda *a: 0, 'sequence': lambda *a: 5, 'price_discount': lambda *a: 0, From c5fe5a76c36097eef182bb19288e8a395d83c2e3 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Tue, 21 Jun 2011 18:59:56 +0530 Subject: [PATCH 012/470] [FIX] stock:payment term is set for supplier invoices in PO from Picking and code optimize lp bug: https://launchpad.net/bugs/798256 fixed bzr revid: aag@tinyerp.co.in-20110621132956-d3tru3edcsx430fe --- addons/stock/stock.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index ef71c273273..8b83cad915d 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -971,7 +971,6 @@ class stock_picking(osv.osv): for picking in self.browse(cr, uid, ids, context=context): if picking.invoice_state != '2binvoiced': continue - payment_term_id = False partner = picking.address_id and picking.address_id.partner_id if not partner: raise osv.except_osv(_('Error, no partner !'), @@ -979,13 +978,7 @@ class stock_picking(osv.osv): if not inv_type: inv_type = self._get_invoice_type(picking) - - if inv_type in ('out_invoice', 'out_refund'): - account_id = partner.property_account_receivable.id - payment_term_id = self._get_payment_term(cr, uid, picking) - else: - account_id = partner.property_account_payable.id - + account_id = partner.property_account_payable.id address_contact_id, address_invoice_id = \ self._get_address_invoice(cr, uid, picking).values() address = address_obj.browse(cr, uid, address_contact_id, context=context) @@ -1012,7 +1005,7 @@ class stock_picking(osv.osv): 'address_invoice_id': address_invoice_id, 'address_contact_id': address_contact_id, 'comment': comment, - 'payment_term': address.partner_id.property_payment_term and address.partner_id.property_payment_term.id or False, + 'payment_term': self._get_payment_term(cr, uid, picking), 'fiscal_position': partner.property_account_position.id, 'date_invoice': context.get('date_inv',False), 'company_id': picking.company_id.id, From 91efe04bcbf794849dd583388a7b5c1ebbfe2cdc Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Wed, 22 Jun 2011 14:56:54 +0530 Subject: [PATCH 013/470] [FIX] stock:payment term is set for supplier invoices in PO from Picking and code optimize bzr revid: aag@tinyerp.co.in-20110622092654-2f96sin4szcnvcuy --- addons/stock/stock.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 8b83cad915d..35f54c2c8c2 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -978,7 +978,11 @@ class stock_picking(osv.osv): if not inv_type: inv_type = self._get_invoice_type(picking) - account_id = partner.property_account_payable.id + + if inv_type in ('out_invoice', 'out_refund'): + account_id = partner.property_account_receivable.id + else: + account_id = partner.property_account_payable.id address_contact_id, address_invoice_id = \ self._get_address_invoice(cr, uid, picking).values() address = address_obj.browse(cr, uid, address_contact_id, context=context) From f469345cfdcadf9c2985d95bad6318535209a971 Mon Sep 17 00:00:00 2001 From: "mayur maheshwari (Open ERP)" Date: Mon, 27 Jun 2011 10:43:35 +0530 Subject: [PATCH 014/470] [FIX]purchase,sale,stock: putting a product UOM decimal prescription In quantity field lp bug: https://launchpad.net/bugs/800970 fixed bzr revid: mma@tinyerp.com-20110627051335-nj8cnvdd993aagfb --- addons/purchase/purchase.py | 2 +- addons/sale/sale.py | 2 +- addons/stock/wizard/stock_partial_move.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 6f6ab0c1b44..124de6d2136 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -614,7 +614,7 @@ class purchase_order_line(osv.osv): _columns = { 'name': fields.char('Description', size=256, required=True), - 'product_qty': fields.float('Quantity', required=True, digits=(16,2)), + 'product_qty': fields.float('Quantity', required=True, digits_compute= dp.get_precision('Product UoM')), 'date_planned': fields.date('Scheduled Date', required=True, select=True), 'taxes_id': fields.many2many('account.tax', 'purchase_order_taxe', 'ord_id', 'tax_id', 'Taxes'), 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True), diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 0b436f0dc91..53e60b3d1a2 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -856,7 +856,7 @@ class sale_order_line(osv.osv): 'type': fields.selection([('make_to_stock', 'from stock'), ('make_to_order', 'on order')], 'Procurement Method', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'property_ids': fields.many2many('mrp.property', 'sale_order_line_property_rel', 'order_id', 'property_id', 'Properties', readonly=True, states={'draft': [('readonly', False)]}), 'address_allotment_id': fields.many2one('res.partner.address', 'Allotment Partner'), - 'product_uom_qty': fields.float('Quantity (UoM)', digits=(16, 2), required=True, readonly=True, states={'draft': [('readonly', False)]}), + 'product_uom_qty': fields.float('Quantity (UoM)', digits_compute= dp.get_precision('Product UoM'), required=True, readonly=True, states={'draft': [('readonly', False)]}), 'product_uom': fields.many2one('product.uom', 'Unit of Measure ', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'product_uos_qty': fields.float('Quantity (UoS)', readonly=True, states={'draft': [('readonly', False)]}), 'product_uos': fields.many2one('product.uom', 'Product UoS'), diff --git a/addons/stock/wizard/stock_partial_move.py b/addons/stock/wizard/stock_partial_move.py index 874b22844d1..20bb351a42c 100644 --- a/addons/stock/wizard/stock_partial_move.py +++ b/addons/stock/wizard/stock_partial_move.py @@ -22,6 +22,7 @@ from osv import fields, osv from tools.translate import _ import time +import decimal_precision as dp class stock_partial_move_memory_out(osv.osv_memory): @@ -29,7 +30,7 @@ class stock_partial_move_memory_out(osv.osv_memory): _rec_name = 'product_id' _columns = { 'product_id' : fields.many2one('product.product', string="Product", required=True), - 'quantity' : fields.float("Quantity", required=True), + 'quantity' : fields.float("Quantity", required=True, digits_compute= dp.get_precision('Product UoM')), 'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True), 'prodlot_id' : fields.many2one('stock.production.lot', 'Production Lot'), 'move_id' : fields.many2one('stock.move', "Move"), From f0cc97b2e46370896bec5f667652a1e278b80aba Mon Sep 17 00:00:00 2001 From: Thibaut DIRLIK Date: Thu, 25 Aug 2011 16:58:56 +0200 Subject: [PATCH 015/470] [FIX] create() does not write in the _inherits parent when fields have the same name. The problem is that when you have a field in an object, and that field is also defined in its parent (defined with _inherits), when OpenERP creates the object, the field value was used to fill the parent value, not object. bzr revid: t.dirlik@adep.com-20110825145856-2qa7im2awmm5gxjz --- openerp/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index d4a5d808990..8de5c829402 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -4050,7 +4050,7 @@ class orm(orm_template): (upd0, upd1, upd2) = ('', '', []) upd_todo = [] for v in vals.keys(): - if v in self._inherit_fields: + if v in self._inherit_fields and v not in self._columns: (table, col, col_detail) = self._inherit_fields[v] tocreate[table][v] = vals[v] del vals[v] From 6da1004cf514289103af8fb8a51790aa4d3388c1 Mon Sep 17 00:00:00 2001 From: "Dhara (OpenERP)" <> Date: Thu, 22 Sep 2011 15:08:23 -0700 Subject: [PATCH 017/470] [NEW] new address_format field for country bzr revid: dhara_openerp-20110922220823-qaghdh4urgjdtea0 --- openerp/addons/base/base_data.xml | 10 ++++++++++ openerp/addons/base/res/res_country.py | 4 ++++ openerp/addons/base/res/res_country_view.xml | 3 +++ openerp/addons/base/res/res_partner.py | 20 ++++++++++++++++++++ 4 files changed, 37 insertions(+) diff --git a/openerp/addons/base/base_data.xml b/openerp/addons/base/base_data.xml index 00fb83a0796..0da83dbb1d2 100644 --- a/openerp/addons/base/base_data.xml +++ b/openerp/addons/base/base_data.xml @@ -85,6 +85,7 @@ Australia au + Aruba @@ -109,6 +110,7 @@ Belgium be + Burkina Faso @@ -145,6 +147,7 @@ Brazil br + Bahamas @@ -173,6 +176,7 @@ Canada ca + Cocos (Keeling) Islands @@ -254,6 +258,7 @@ Germany de + Djibouti @@ -298,6 +303,7 @@ Spain es + Ethiopia @@ -326,6 +332,7 @@ France fr + Gabon @@ -434,6 +441,7 @@ India in + British Indian Ocean Territory @@ -917,6 +925,7 @@ United Kingdom + gb @@ -926,6 +935,7 @@ United States us + Uruguay diff --git a/openerp/addons/base/res/res_country.py b/openerp/addons/base/res/res_country.py index 99e12a96f78..aa98c3995a0 100644 --- a/openerp/addons/base/res/res_country.py +++ b/openerp/addons/base/res/res_country.py @@ -31,6 +31,7 @@ class Country(osv.osv): 'code': fields.char('Country Code', size=2, help='The ISO country code in two chars.\n' 'You can use this field for quick search.', required=True), + 'address_format': fields.text('Address Format') } _sql_constraints = [ ('name_uniq', 'unique (name)', @@ -38,6 +39,9 @@ class Country(osv.osv): ('code_uniq', 'unique (code)', 'The code of the country must be unique !') ] + _defaults = { + 'address_format': "%(street)s\n%(street2)s\n%(city)s,%(state_code)s %(zip)s", + } def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): diff --git a/openerp/addons/base/res/res_country_view.xml b/openerp/addons/base/res/res_country_view.xml index 36b3c6f875f..af2a72a5b40 100644 --- a/openerp/addons/base/res/res_country_view.xml +++ b/openerp/addons/base/res/res_country_view.xml @@ -26,6 +26,9 @@
+ + +
diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index 4b8f1279787..e4c0db75e8a 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -345,6 +345,26 @@ class res_partner_address(osv.osv): def get_city(self, cr, uid, id): return self.browse(cr, uid, id).city + def display_address(self, cr, uid, context, address_obj): #,field_list=[]): +# if isinstance(address_id, list): +# address_id = address_id[0] +# address_obj = self.browse(cr, uid, address_id) + + address_field = ['title','street','street2','zip','city'] + args = {} + for field in address_field : +# args[field] = field_list and field in field_list and getattr(address_obj,field) or getattr(address_obj,field) or '' + args[field] = getattr(address_obj,field) and getattr(address_obj,field) or '' + #TODO + args['state_code'] = address_obj.state_id and address_obj.state_id.code or '' + args['state_name'] = address_obj.state_id and address_obj.state_id.name or '' + args['country_code'] = address_obj.country_id and address_obj.country_id.code or '' + args['country_name'] = address_obj.country_id and address_obj.country_id.name or '' + # If no country is defined - just in case + address_format = address_obj.country_id and address_obj.country_id.address_format or \ + '%(street)s\n%(street2)s\n%(city)s,%(state_code)s %(zip)s' + return address_format % args + res_partner_address() class res_partner_category(osv.osv): From a74985d4767d073d3e33d582cf655e818701106e Mon Sep 17 00:00:00 2001 From: "Dhara (OpenERP)" <> Date: Thu, 22 Sep 2011 15:09:01 -0700 Subject: [PATCH 018/470] [NEW] changes for the address printing bzr revid: dhara_openerp-20110922220901-szgpm1lforrlgvgy --- .../account/report/account_print_invoice.rml | 6 +----- .../report/report_account_invoice_layout.rml | 6 +----- .../report/special_message_invoice.rml | 6 +----- addons/auction/report/buyer_form_report.rml | 4 +--- addons/auction/report/deposit_seller.rml | 4 +--- addons/auction/report/seller_form_report.rml | 4 +--- addons/delivery/report/shipping.rml | 12 ++---------- addons/mrp_repair/report/order.rml | 18 +++--------------- addons/purchase/report/order.rml | 12 ++---------- addons/purchase/report/request_quotation.rml | 14 +++----------- addons/report_intrastat/report/invoice.rml | 8 ++------ addons/sale/report/sale_order.rml | 17 +++-------------- .../sale_layout/report/report_sale_layout.rml | 19 ++++--------------- addons/stock/report/picking.rml | 12 ++---------- 14 files changed, 27 insertions(+), 115 deletions(-) diff --git a/addons/account/report/account_print_invoice.rml b/addons/account/report/account_print_invoice.rml index 0350fbf7379..2ca6afee023 100644 --- a/addons/account/report/account_print_invoice.rml +++ b/addons/account/report/account_print_invoice.rml @@ -162,11 +162,7 @@ [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.street) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.street2) or removeParentNode('para') ]] - [[ (o.address_invoice_id and o.address_invoice_id.zip) or '' ]] [[ (o.address_invoice_id and o.address_invoice_id.city) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.state_id and o.address_invoice_id.state_id.name) or removeParentNode('para') ]] - [[ (o.address_invoice_id and o.address_invoice_id.country_id and o.address_invoice_id.country_id.name) or '' ]] + [[ o.address_invoice_id.display_address(o.address_invoice_id) ]] diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml index 4e6bdfd0aa0..e47aa58b645 100644 --- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml +++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml @@ -215,11 +215,7 @@ [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.street) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.street2) or removeParentNode('para') ]] - [[ (o.address_invoice_id and o.address_invoice_id.zip) or '' ]] [[ (o.address_invoice_id and o.address_invoice_id.city) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.state_id and o.address_invoice_id.state_id.name) or removeParentNode('para') ]] - [[ (o.address_invoice_id and o.address_invoice_id.country_id and o.address_invoice_id.country_id.name) or '' ]] + [[ o.address_invoice_id.display_address(o.address_invoice_id) ]] diff --git a/addons/account_invoice_layout/report/special_message_invoice.rml b/addons/account_invoice_layout/report/special_message_invoice.rml index eabb8efe9c2..08c28f4a22f 100644 --- a/addons/account_invoice_layout/report/special_message_invoice.rml +++ b/addons/account_invoice_layout/report/special_message_invoice.rml @@ -219,11 +219,7 @@ [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.street) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.street2) or removeParentNode('para') ]] - [[ (o.address_invoice_id and o.address_invoice_id.zip) or '' ]] [[ (o.address_invoice_id and o.address_invoice_id.city) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.state_id and o.address_invoice_id.state_id.name) or removeParentNode('para') ]] - [[ (o.address_invoice_id and o.address_invoice_id.country_id and o.address_invoice_id.country_id.name) or '' ]] + [[ o.address_invoice_id.display_address(o.address_invoice_id) ]] diff --git a/addons/auction/report/buyer_form_report.rml b/addons/auction/report/buyer_form_report.rml index c917a931fd3..60858372fcf 100644 --- a/addons/auction/report/buyer_form_report.rml +++ b/addons/auction/report/buyer_form_report.rml @@ -99,9 +99,7 @@ [[ o['partner'] and o['partner'].name or False]] - [[o['partner'] and o['partner'].address[0].street or False]] - [[o['partner'] and o['partner'].address[0].zip or False]][[o['partner'] and o['partner'].address[0].city or False]] - [[o['partner'] and o['partner'].address[0].country_id.name or False]] + [[o['partner'] and o['partner'].address[0] and o['partner'].address[0].display_address(o['partner'].address[0]) ]] diff --git a/addons/auction/report/deposit_seller.rml b/addons/auction/report/deposit_seller.rml index 3adc1152067..84979212d12 100644 --- a/addons/auction/report/deposit_seller.rml +++ b/addons/auction/report/deposit_seller.rml @@ -84,9 +84,7 @@ [[o.bord_vnd_id.partner_id.title]] [[o.bord_vnd_id.partner_id.name]] - [[o.bord_vnd_id.partner_id.address[0].street]] - [[o.bord_vnd_id.partner_id.address[0].zip]],[[o.bord_vnd_id.partner_id.address[0].city]] - [[o.bord_vnd_id.partner_id.address[0].country_id.name]] + [[o.bord_vnd_id.partner_id.address[0] and o.bord_vnd_id.partner_id.address[0].display_address(o.bord_vnd_id.partner_id.address[0]) ]] diff --git a/addons/auction/report/seller_form_report.rml b/addons/auction/report/seller_form_report.rml index c2d724eb259..da12d3f4ce4 100644 --- a/addons/auction/report/seller_form_report.rml +++ b/addons/auction/report/seller_form_report.rml @@ -74,9 +74,7 @@ [[ o['partner'] and o['partner'].name or False]] - [[o['partner'] and o['partner'].address[0].street or False]] - [[o['partner'] and o['partner'].address[0].zip or False]][[o['partner'] and o['partner'].address[0].city or False]] - [[o['partner'] and o['partner'].address[0].country_id.name or False]] + [[ o['partner'] and o['partner'].address[0] and o['partner'].address[0].display_address(o['partner'].address[0]) diff --git a/addons/delivery/report/shipping.rml b/addons/delivery/report/shipping.rml index 563c3bda826..2bebdb11279 100644 --- a/addons/delivery/report/shipping.rml +++ b/addons/delivery/report/shipping.rml @@ -131,19 +131,11 @@ Invoiced to [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.name or '']] - [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.street or '']] - [[ (o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.street2) or removeParentNode('para')]] - [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.zip or '']] [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.city or '' ]] - [[ (o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.state_id and o.sale_id.partner_invoice_id.state_id.name) or removeParentNode('para') ]] - [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.country_id and o.sale_id.partner_invoice_id.country_id.name or '']] + [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.display_address(o.sale_id.partner_invoice_id) ]] [[ o.address_id and o.address_id.partner_id and o.address_id.partner_id.name or '' ]] - [[ o.address_id and o.address_id.street or '']] - [[ o.address_id and o.address_id.street2 or removeParentNode('para')]] - [[ o.address_id and o.address_id.zip or '']] [[ o.address_id and o.address_id.city or '']] - [[ (o.address_id and o.address_id.state_id and o.address_id.state_id.name) or removeParentNode('para') ]] - [[ o.address_id and o.address_id.country_id and o.address_id.country_id.name or '']] + [[ o.address_id and o.address_id and o.address_id.display_address(o.address_id) ]] diff --git a/addons/mrp_repair/report/order.rml b/addons/mrp_repair/report/order.rml index b72f3d7a130..126e92d2586 100644 --- a/addons/mrp_repair/report/order.rml +++ b/addons/mrp_repair/report/order.rml @@ -189,21 +189,13 @@ Shipping address : [[ o.partner_id.name ]] - [[ o.address_id.street ]] - [[ o.address_id.street2 or removeParentNode('para') ]] - [[ o.address_id.city or '' ]] [[ o.address_id.zip or '' ]] - [[ (o.address_id.state_id and o.address_id.state_id.name) or removeParentNode('para') ]] - [[ o.address_id.country_id and o.address_id.country_id.name or '' ]] + [[ o.address_id and o.address_id.display_address(o.address_id) ]] Invoice address : [[ o.partner_id and o.partner_id.property_payment_term.name ]] - [[ o.partner_invoice_id.street ]] - [[ o.partner_invoice_id.street2 or removeParentNode('para') ]] - [[ o.partner_invoice_id.zip or '' ]] [[ o.partner_invoice_id.city or '' ]] - [[ (o.partner_invoice_id.state_id and o.partner_invoice_id.state_id.name) or removeParentNode('para') ]] - [[ o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '' ]] + [[ o.partner_invoice_id and o.partner_invoice_id.display_address(o.partner_invoice_id) ]] @@ -212,11 +204,7 @@ [[ o.partner_id.name or removeParentNode('para') ]] - [[ o.default_address_id and o.default_address_id.street or removeParentNode('para') ]] - [[ o.default_address_id and o.default_address_id.street2 or removeParentNode('para') ]] - [[ o.default_address_id and o.default_address_id.zip or removeParentNode('para') ]][[ o.default_address_id and o.default_address_id.city or removeParentNode('para') ]] - [[ o.default_address_id and o.default_address_id.state_id and o.default_address_id.state_id.name or removeParentNode('para') ]] - [[ o.default_address_id and o.default_address_id.country_id and o.default_address_id.country_id.name or removeParentNode('para') ]] + [[ o.default_address_id and o.default_address_id.display_address(o.default_address_id) ]] diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index 4b143d0f961..a775e8bf249 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -175,11 +175,7 @@ [[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]] Shipping address : [[ (addr.partner_id and addr.partner_id.title and addr.partner_id.title.name) or '' ]] [[ (addr.partner_id and addr.partner_id.name) or '' ]] - [[ addr.street ]] - [[ addr.street2 or removeParentNode('para') ]] - [[ addr.zip or '' ]] [[ addr.city or '' ]] - [[ addr.state_id and addr.state_id.name or removeParentNode('para') ]] - [[ addr.country_id and addr.country_id.name or '' ]] + [[ addr.partner_id and addr.partner_id.display_address(addr.partner_id) ]] @@ -194,11 +190,7 @@ [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ (o.partner_address_id and o.partner_address_id.street ) or '']] - [[ (o.partner_address_id and o.partner_address_id.street2) or removeParentNode('para') ]] - [[ (o.partner_address_id and o.partner_address_id.zip) or '' ]] [[ (o.partner_address_id and o.partner_address_id.city) or '' ]] - [[ (o.partner_address_id and o.partner_address_id.state_id and o.partner_address_id.state_id.name) or removeParentNode('para')]] - [[ (o.partner_address_id and o.partner_address_id.country_id and o.partner_address_id.country_id.name) or '' ]] + [[ o.partner_address_id and o.partner_address_id.display_address(o.partner_address_id) ]] diff --git a/addons/purchase/report/request_quotation.rml b/addons/purchase/report/request_quotation.rml index 27e4ac39602..221fc0f2c7c 100644 --- a/addons/purchase/report/request_quotation.rml +++ b/addons/purchase/report/request_quotation.rml @@ -92,11 +92,7 @@ Expected Delivery address: [[ (order.dest_address_id and order.dest_address_id.partner_id.name) or (order.warehouse_id and order.warehouse_id.name) or '']] - [[ (order.dest_address_id and order.dest_address_id and order.dest_address_id.street) or (order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.street) or '']] - [[ (order.dest_address_id and order.dest_address_id and order.dest_address_id.street2) or (order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.street2) or removeParentNode('para') ]] - [[ (order.dest_address_id and order.dest_address_id and order.dest_address_id.zip) or (order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.zip) or '' ]][[ (order.dest_address_id and order.dest_address_id and order.dest_address_id.city) or (order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.city) or '' ]] - [[(order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.state_id and order.warehouse_id.partner_address_id.state_id.name) or order.partner_address_id and order.partner_address_id.state_id and order.partner_address_id.state_id.name or removeParentNode('para') ]] - [[(order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.country_id and order.warehouse_id.partner_address_id.country_id.name) or order.partner_address_id.country_id.name ]] + [[ order.dest_address_id and order.dest_address_id.display_address(order.dest_address_id) ]] @@ -105,11 +101,7 @@ [[ (order.partner_id and order.partner_id.title and order.partner_id.title.name) or '' ]] [[ order.partner_id.name ]] - [[ (order.partner_address_id and order.partner_address_id.street) or '']] - [[ (order.partner_address_id.street2) or removeParentNode('para') ]] - [[ (order.partner_address_id and order.partner_address_id.zip) or '' ]][[ (order.partner_address_id and order.partner_address_id.city) or '' ]] - [[ (order.partner_address_id.state_id.name) or removeParentNode('para') ]] - [[ (order.partner_address_id and order.partner_address_id.country_id and order.partner_address_id.country_id.name) or '' ]] + [[ order.partner_address_id and order.partner_address_id.display_address(order.partner_address_id) ]] @@ -180,4 +172,4 @@ [[ user.signature or '' ]] - \ No newline at end of file + diff --git a/addons/report_intrastat/report/invoice.rml b/addons/report_intrastat/report/invoice.rml index c66a39413ee..aa80e3a1cad 100644 --- a/addons/report_intrastat/report/invoice.rml +++ b/addons/report_intrastat/report/invoice.rml @@ -142,11 +142,7 @@ [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.street) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.street2) or removeParentNode('para') ]] - [[ (o.address_invoice_id and o.address_invoice_id.zip) or '' ]] [[ (o.address_invoice_id and o.address_invoice_id.city) or '' ]] - [[ (o.address_invoice_id and o.address_invoice_id.state_id and o.address_invoice_id.state_id.name) or removeParentNode('para') ]] - [[ (o.address_invoice_id and o.address_invoice_id.country_id and o.address_invoice_id.country_id.name) or '' ]] + [[ o.address_invoice_id and o.address_invoice_id.display_address(o.address_invoice_id) ]] @@ -402,4 +398,4 @@ - \ No newline at end of file + diff --git a/addons/sale/report/sale_order.rml b/addons/sale/report/sale_order.rml index 00ebb50472e..0d984a19e8d 100644 --- a/addons/sale/report/sale_order.rml +++ b/addons/sale/report/sale_order.rml @@ -158,21 +158,13 @@ Shipping address : [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ (o.partner_shipping_id and o.partner_shipping_id.street) or '' ]] - [[ (o.partner_shipping_id and o.partner_shipping_id.street2) or removeParentNode('para') ]] - [[ (o.partner_shipping_id and o.partner_shipping_id.zip) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.city) or '' ]] - [[ (o.partner_shipping_id and o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name) or removeParentNode('para') ]] - [[ (o.partner_shipping_id and o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name) or '' ]] + [[ o.partner_shipping_id and o.partner_shipping_id.display_address(o.partner_shipping_id) ]] Invoice address : [[ (o.partner_invoice_id and o.partner_invoice_id.title and o.partner_invoice_id.title.name) or '' ]] [[ (o.partner_invoice_id and o.partner_invoice_id.name) or '' ]] - [[ (o.partner_invoice_id and o.partner_invoice_id.street) or '' ]] - [[ (o.partner_invoice_id and o.partner_invoice_id.street2) or removeParentNode('para') ]] - [[ (o.partner_invoice_id and o.partner_invoice_id.zip) or '' ]] [[ (o.partner_invoice_id and o.partner_invoice_id.city) or '' ]] - [[ (o.partner_invoice_id and o.partner_invoice_id.state_id and o.partner_invoice_id.state_id.name) or removeParentNode('para') ]] - [[ (o.partner_invoice_id and o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name) or '' ]] + [[ o.partner_invoice_id and o.partner_invoice_id.display_address(o.partner_invoice_id) ]] @@ -181,10 +173,7 @@ [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ (o.partner_order_id and o.partner_order_id.street) or '' ]] - [[ (o.partner_order_id and o.partner_order_id.street2) or removeParentNode('para') ]] - [[ (o.partner_order_id and o.partner_order_id.zip) or '' ]] [[ (o.partner_order_id and o.partner_order_id.city) or '' ]] - [[ (o.partner_order_id and o.partner_order_id.state_id and o.partner_order_id.state_id.name) or removeParentNode('para')]] [[ (o.partner_order_id and o.partner_order_id.country_id and o.partner_order_id.country_id.name) or '' ]] + [[ o.partner_order_id and o.partner_order_id.display_address(o.partner_order_id) ]] diff --git a/addons/sale_layout/report/report_sale_layout.rml b/addons/sale_layout/report/report_sale_layout.rml index 941df09aeb5..15ea96f7212 100644 --- a/addons/sale_layout/report/report_sale_layout.rml +++ b/addons/sale_layout/report/report_sale_layout.rml @@ -165,21 +165,13 @@ Shipping address : [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ (o.partner_shipping_id and o.partner_shipping_id.street) or '' ]] - [[ (o.partner_shipping_id and o.partner_shipping_id.street2) or removeParentNode('para') ]] - [[ (o.partner_shipping_id and o.partner_shipping_id.zip) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.city) or '' ]] - [[ (o.partner_shipping_id and o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name) or removeParentNode('para') ]] - [[ (o.partner_shipping_id and o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name) or '' ]] + [[ o.partner_shipping_id and o.partner_shipping_id.display_address(o.partner_shipping_id) ]] Invoice address : [[ (o.partner_invoice_id and o.partner_invoice_id.title and o.partner_invoice_id.title.name) or '' ]] [[ (o.partner_invoice_id and o.partner_invoice_id.name) or '' ]] - [[ (o.partner_invoice_id and o.partner_invoice_id.street) or '' ]] - [[ (o.partner_invoice_id and o.partner_invoice_id.street2) or removeParentNode('para') ]] - [[ (o.partner_invoice_id and o.partner_invoice_id.zip) or '' ]] [[ (o.partner_invoice_id and o.partner_invoice_id.city) or '' ]] - [[ (o.partner_invoice_id and o.partner_invoice_id.state_id and o.partner_invoice_id.state_id.name) or removeParentNode('para') ]] - [[ (o.partner_invoice_id and o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name) or '' ]] + [[ o.partner_invoice_id and o.partner_invoice_id.display_address(o.partner_invoice_id) ]] @@ -188,10 +180,7 @@ [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ (o.partner_order_id and o.partner_order_id.street) or '' ]] - [[ (o.partner_order_id and o.partner_order_id.street2) or removeParentNode('para') ]] - [[ (o.partner_order_id and o.partner_order_id.zip) or '' ]] [[ (o.partner_order_id and o.partner_order_id.city) or '' ]] - [[ (o.partner_order_id and o.partner_order_id.state_id and o.partner_order_id.state_id.name) or removeParentNode('para')]] [[ (o.partner_order_id and o.partner_order_id.country_id and o.partner_order_id.country_id.name) or '' ]] + [[ o.partner_order_id and o.partner_order_id.display_address(o.partner_order_id) ]] @@ -398,4 +387,4 @@ - \ No newline at end of file + diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml index 3d66a1b825a..2cba0b55fdd 100644 --- a/addons/stock/report/picking.rml +++ b/addons/stock/report/picking.rml @@ -163,20 +163,12 @@ Shipping Address : [[ (picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.title.name) or '' ]] [[ picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.name ]] - [[ picking.address_id and picking.address_id.street or '' ]] - [[ (picking.address_id and picking.address_id.street2) or removeParentNode('para') ]] - [[ picking.address_id and picking.address_id.zip or '' ]] [[ picking.address_id and picking.address_id.city or '' ]] - [[ (picking.address_id and picking.address_id.state_id and picking.address_id.state_id.name) or removeParentNode('para') ]] - [[ (picking.address_id and picking.address_id.country_id and picking.address_id.country_id.name) or '' ]] + [[ picking.address_id and picking.address_id.display_address(picking.address_id) ]] Contact Address : [[ picking.address_id and picking.address_id.title.name or '' ]] [[ picking.address_id and picking.address_id.name or '' ]] - [[ picking.address_id and picking.address_id.street or '' ]] - [[ (picking.address_id and picking.address_id.street2) or removeParentNode('para') ]] - [[ picking.address_id and picking.address_id.zip or '' ]] [[ picking.address_id and picking.address_id.city or '' ]] - [[ (picking.address_id and picking.address_id.state_id and picking.address_id.state_id.name) or removeParentNode('para') ]] - [[ (picking.address_id and picking.address_id.country_id and picking.address_id.country_id.name) or '' ]] + [[ picking.address_id and picking.address_id.display_address(picking.address_id) ]] From 3d82d827c854b63316fa1fba29187921c24f38d8 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 10 Oct 2011 18:56:22 +0530 Subject: [PATCH 019/470] [ADD, REF]: CRM: 1)Created new process folder and moved test_crm_lead.yml to process_crm_lead.yml, 2)Removed unused created user for crm (process_crm_lead.yml), 3)Changed Lead name New Customer to proper name, 4)Removed Cancle operation from process_crm_lead.yml bzr revid: ron@tinyerp.com-20111010132622-329w2fv0jbt0rc7y --- addons/crm/__openerp__.py | 3 +- .../process_crm_lead.yml} | 32 ++----------------- 2 files changed, 4 insertions(+), 31 deletions(-) rename addons/crm/test/{test_crm_lead.yml => process/process_crm_lead.yml} (81%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index a6f5f1630f7..27beb8e58ee 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -119,7 +119,8 @@ Creates a dashboard for CRM that includes: 'crm_phonecall_demo.xml', ], 'test': [ - 'test/test_crm_lead.yml', + 'test/process/process_crm_lead.yml', + 'test/process/cancle_crm_lead.yml', 'test/test_crm_meeting.yml', 'test/test_crm_opportunity.yml', 'test/test_crm_phonecall.yml', diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/process/process_crm_lead.yml similarity index 81% rename from addons/crm/test/test_crm_lead.yml rename to addons/crm/test/process/process_crm_lead.yml index d5d3c6b933b..f35b03dcd4f 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/process/process_crm_lead.yml @@ -1,27 +1,10 @@ -- - In order to test the CRM in OpenERP, I will do a customer qualification - process that starts with a fist contact with a customer (a lead), which will - be converted to a business opportunity and a partner. -- - I create a two new users "user_crm" and I assign the group "salesman". -- - !record {model: res.users, id: res_users_usercrm0}: - company_id: base.main_company - context_lang: en_US - context_section_id: crm.section_sales_department - groups_id: - - base.group_sale_salesman - login: user_crm - name: user_crm - password: user_crm - - | - I start by creating a new lead "New Customer" and I provide an address to this + I start by creating a new lead "Steave Jon" and I provide an address to this new customer, as well as an email "info@mycustomer.com". - !record {model: crm.lead, id: crm_lead_newcustomer0}: email_from: info@mycustomer.com - name: New Customer + name: Steave Jon partner_name: Capegemini partner_id: base.res_partner_9 phone: (855) 924-4364 @@ -125,17 +108,6 @@ - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in done state}: - state == "done" -- - I cancel lead by click on "cancel" button. -- - !python {model: crm.lead}: | - self.case_cancel(cr, uid, [ref("crm_lead_newcustomer0")]) -- | - I check that lead is now in 'cancel' state. -- - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in cancel state}: - - state == "cancel" - #- # | # yaml is also not working with smtp server and send new email. From d202549512dea80767b844e2a7a732e58e1f29bc Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 11 Oct 2011 12:25:03 +0530 Subject: [PATCH 020/470] [ADD]: crm: 1) Add new yml on process folder cancle_crm_lead.yml 2) Checked for lead from any stage, It will be cancle or not 3) If Lead not handle by executive team so its need to Escalate lead from sales executive department to sales department and checked that 4) Checked for lead cancle from Escalate stage bzr revid: ron@tinyerp.com-20111011065503-x1o4pbhtkyaznuyp --- addons/crm/test/process/cancle_crm_lead.yml | 48 +++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 addons/crm/test/process/cancle_crm_lead.yml diff --git a/addons/crm/test/process/cancle_crm_lead.yml b/addons/crm/test/process/cancle_crm_lead.yml new file mode 100644 index 00000000000..c8d02c6414c --- /dev/null +++ b/addons/crm/test/process/cancle_crm_lead.yml @@ -0,0 +1,48 @@ +- + Cheking for lead from any stage, It will be cancle or not. +- + !python {model: crm.lead}: | + lead_on_draft=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_on_draft.state == 'draft', "Lead is not in draft state" + self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_on_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_on_cancel.state == 'cancel', "Lead is not in cancel state" + self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_on_reset=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_on_reset.state == 'draft', "Lead is not in draft state" + self.case_pending(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_on_pending=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_on_pending.state == 'pending', "Lead is not in pending state" + self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_pending_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_pending_cancel.state == 'cancel', "Lead is not in cancel state" + +- + For working on parent child relationship, we are creating sales executive department that will be work under + Sales Department. +- + !record {model: crm.case.section, id: section_sales_exe_department}: + name: "Sales Executive" + parent_id: crm.section_sales_department + +- + If Lead not handle by executive team so its need to Escalate lead from sales executive department to sales department, + for that purpose i Assign sales executive department on lead, after we will be process to escalate lead to sales department +- + !record {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0}: + section_id: section_sales_exe_department +- + Processing on Lead escalate to sales Departemnt, we are checking for lead Escalate to sales Department from Executive + department or not. +- + !python {model: crm.lead}: | + lead_rec=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_cancle_reset=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_cancle_reset.state == 'draft', "Lead is not in draft state" + self.case_escalate(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_on_escalate=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_on_escalate.section_id.name == 'Sales Department', "Do not Escalate lead to on sales team from Executive team" + self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_escalate_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_escalate_cancel.state == 'cancel', "Lead is not in cancel state" From 618fc88e3336276cef93502677bbf465c67f3444 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 11 Oct 2011 15:36:49 +0530 Subject: [PATCH 021/470] [ADD, REF]: crm: 1) Moved test_crm_meeting.yml to process/process_crm_meeting.yml 2) Used demo data from xml file instead of created yml data, 3) Improved all string regarding to end user and remove all string like coder, 4) Added confirm state and done state of meeting and cheked its worked or not bzr revid: ron@tinyerp.com-20111011100649-wmokfc1tiknua2zz --- addons/crm/__openerp__.py | 2 +- .../crm/test/process/process_crm_meeting.yml | 72 ++++++++++++++ addons/crm/test/test_crm_meeting.yml | 97 ------------------- 3 files changed, 73 insertions(+), 98 deletions(-) create mode 100644 addons/crm/test/process/process_crm_meeting.yml delete mode 100644 addons/crm/test/test_crm_meeting.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 27beb8e58ee..36e8fdb4d1e 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -121,7 +121,7 @@ Creates a dashboard for CRM that includes: 'test': [ 'test/process/process_crm_lead.yml', 'test/process/cancle_crm_lead.yml', - 'test/test_crm_meeting.yml', + 'test/process/process_crm_meeting.yml', 'test/test_crm_opportunity.yml', 'test/test_crm_phonecall.yml', 'test/test_crm_recurrent_meeting.yml', diff --git a/addons/crm/test/process/process_crm_meeting.yml b/addons/crm/test/process/process_crm_meeting.yml new file mode 100644 index 00000000000..91535424964 --- /dev/null +++ b/addons/crm/test/process/process_crm_meeting.yml @@ -0,0 +1,72 @@ +- | + Customer want to do initial discussion with us so we will arrage meeting or + phonecalles or internal Meeting with them. +- + !assert {model: crm.meeting, id: crm.crm_case_initialdiscussion0}: + - state == "draft" +- | + For Remember purpose for meeting, i put reminder "30 minutes before" and assign + to meeting. +- + !python {model: crm.meeting}: | + self.write(cr, uid, [ref('crm_case_initialdiscussion0')], {'alarm_id': ref("base_calendar.alarm5")}) +- | + In order to check recurrence on meetings I will set Recurrency to Custom + and I set the fields so that the meeting will occur weekly on Monday to Friday 10 times. +- + !python {model: crm.meeting}: | + self.write(cr, uid, [ref("crm_case_initialdiscussion0")], {'fr': 1, 'mo': 1, 'th': 1, 'tu': 1, 'we':1, 'count':10, 'interval': 1, 'rrule_type': 'weekly'}) + +- | + The meeting is scheduled on Monday and Friday for 10 times so i can see from the calendar view +- + !python {model: crm.meeting}: | + self.fields_view_get(cr, uid, False, 'calendar', context) +- | + We can check for one of the recurrent event and count the number of meeting. +- + !python {model: crm.meeting}: | + import time + from datetime import datetime, date, timedelta + ids = self.search(cr, uid, [('date', '>=', time.strftime('%Y-%m-%d 00:00:00')), ('date', '<=', (datetime.now()+timedelta(31)).strftime('%Y-%m-%d 00:00:00')), ('name', '=', 'Initial discussion')], context={'virtual_id': True}) + assert len(ids) == 10 + +- | + If I want to edit meetings information for all occurrence I click on "Edit All" button. +- + !python {model: crm.meeting}: | + self.write(cr, uid, [ref('crm_case_initialdiscussion0')], {'edit_all':'True'},context) +- | + I can see that new meeting form is opened with same value. + I change some data for meeting and save it. + I can see from meeting's calendar view that all meeting occurrences are changed accordingly. +- + !record {model: crm.meeting, id: crm.crm_case_initialdiscussion0}: + alarm_id: base_calendar.alarm9 + rrule_type: weekly +- | + In order to invite people(internal user) for this meetings, Create record for + people will come on meeting. +- + !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}: + type: internal + send_mail: False + partner_id: base.res_partner_9 + user_ids: + - base.user_demo +- + Now inviting those people which we are registers. +- + !python {model: base_calendar.invite.attendee}: | + self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_case_initialdiscussion0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) +- | + All conformation is completed for meeting now going to confirm meeting + and we can check also after completion of meeting, it is done or not. +- + !python {model: crm.meeting}: | + self.case_open(cr, uid, [ref('crm_case_initialdiscussion0')]) + meeting_rec = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) + assert meeting_rec.state == 'open', "Meeting is not in confirm state" + self.case_close(cr, uid, [ref('crm_case_initialdiscussion0')]) + meeting_rec_close = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) + assert meeting_rec_close.state == 'done', "Meeting is not in done state" diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml deleted file mode 100644 index 8d851dd58c7..00000000000 --- a/addons/crm/test/test_crm_meeting.yml +++ /dev/null @@ -1,97 +0,0 @@ -- | - I will test Meetings which may be customer meeting or phonecall meeting or - internal Meeting. -- | - I start by creating a new Meeting. -- - !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}: - categ_id: crm.categ_meet2 - date: !eval time.strftime('%Y-%m-%d 16:04:00') - date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:04:00')" - duration: 8.0 - email_from: info@balmerinc.be - location: Ahmedabad - name: Regarding Presentation - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - rrule_type: weekly - section_id: crm.section_sales_department -- | - I check that the Meetings is in 'UnConfirmed' state. -- - !assert {model: crm.meeting, id: crm_meeting_regardingpresentation0}: - - state == "draft" -- | - I can set reminder on meeting if I put reminder "40 minutes before" . -- | - For that, I first create alarm. -- - !record {model: res.alarm, id: res_alarm_minituesbefore0}: - name: 40 minutes before - trigger_duration: 40 - trigger_interval: minutes - trigger_occurs: before - trigger_related: start -- | - I will assign this reminder. - -- !python {model: crm.meeting}: | - self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'alarm_id': ref("res_alarm_minituesbefore0")}) -- | - In order to check recurrence on meetings I will set Recurrency to Custom - and I set the fields so that the meeting will occur weekly on Monday and Friday 10 times. -- - !python {model: crm.meeting}: | - self.write(cr, uid, [ref("crm_meeting_regardingpresentation0")], {'fr': 1, 'mo': 1, 'th': 1, 'tu': 1, 'we':1, 'count':10, 'interval': 1, 'rrule_type': 'weekly'}) - -- | - I can see from the calendar view that the meeting is scheduled on Monday and Friday - for 10 times. - -- - !python {model: crm.meeting}: | - self.fields_view_get(cr, uid, False, 'calendar', context) -- | - I will search for one of the recurrent event and count the number of meeting. -- - !python {model: crm.meeting}: | - import time - from datetime import datetime, date, timedelta - ids = self.search(cr, uid, [('date', '>=', time.strftime('%Y-%m-%d 00:00:00')), ('date', '<=', (datetime.now()+timedelta(31)).strftime('%Y-%m-%d 00:00:00')), ('name', '=', 'Regarding Presentation')], context={'virtual_id': True}) - assert len(ids) == 10 - -- | - If I want to edit meetings information for all occurrence I click on "Edit All" button. -- - !python {model: crm.meeting}: | - self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'edit_all':'True'},context) -- | - I can see that new meeting form is opened with same value. - I change some data for meeting and save it. - I can see from meeting's calendar view that all meeting occurrences are changed accordingly. -- - !record {model: crm.meeting, id: crm.crm_meeting_regardingpresentation0}: - alarm_id: base_calendar.alarm9 - rrule_type: weekly - -- | - In order to invite people for this meetings, I click on "Invite People" button - I can invite internal user. -- - !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}: - type: internal - send_mail: False - partner_id: base.res_partner_9 - user_ids: - - base.user_demo -- - I click on "Invite" button of "Invite attendee" wizard. -- - !python {model: base_calendar.invite.attendee}: | - self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_meeting_regardingpresentation0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) - -- | - After direct/indirect confirmation for meetings I can confirm meeting. -- - !python {model: crm.meeting}: | - self.case_open(cr, uid, [ref('crm_meeting_regardingpresentation0')]) From 7316a069b348634586c1f0f3864a60c98a3388f9 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 11 Oct 2011 15:42:57 +0530 Subject: [PATCH 022/470] [IMP] crm : user not assign properly on test_crm_lead_case2.yml bzr revid: ron@tinyerp.com-20111011101257-p8fiuov1xtjcfvdh --- addons/crm/test/test_crm_lead_case2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml index 23a654d31a8..af1b7e7e07b 100644 --- a/addons/crm/test/test_crm_lead_case2.yml +++ b/addons/crm/test/test_crm_lead_case2.yml @@ -25,7 +25,7 @@ - I assign segmentation. - - !record {model: res.users, id: res_users_usercrm0}: + !record {model: res.users, id: base.user_root}: context_section_id: crm_case_section_demosalesteam - | I create a new lead "Test Customer" and I provide an address to this From da3aca4263643ca170dd395b81827a2e96dd4fd3 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 11 Oct 2011 18:30:50 +0530 Subject: [PATCH 023/470] [ADD, REF]: crm: 1) Moved test_crm_phonecall.yml to process/process_crm_phonecall.yml 2) Removed Phonecall by log seduling, 3) Improved varibles names and conversion, 4) changed string Interview call to interest with openerp, 5) Improved all string regarding to end user and remove all string like coder, 6) Added stage after completion of phonecall and cheked that working properly or not bzr revid: ron@tinyerp.com-20111011130050-vk24chpik6y4ijc4 --- addons/crm/__openerp__.py | 2 +- .../test/process/process_crm_phonecall.yml | 73 +++++++++++ addons/crm/test/test_crm_phonecall.yml | 116 ------------------ 3 files changed, 74 insertions(+), 117 deletions(-) create mode 100644 addons/crm/test/process/process_crm_phonecall.yml delete mode 100644 addons/crm/test/test_crm_phonecall.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 36e8fdb4d1e..05ed350bea1 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -123,7 +123,7 @@ Creates a dashboard for CRM that includes: 'test/process/cancle_crm_lead.yml', 'test/process/process_crm_meeting.yml', 'test/test_crm_opportunity.yml', - 'test/test_crm_phonecall.yml', + 'test/process/process_crm_phonecall.yml', 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', diff --git a/addons/crm/test/process/process_crm_phonecall.yml b/addons/crm/test/process/process_crm_phonecall.yml new file mode 100644 index 00000000000..25f3069fac6 --- /dev/null +++ b/addons/crm/test/process/process_crm_phonecall.yml @@ -0,0 +1,73 @@ +- | + For customer or partner purpose, I called to him/her for discussion about openerp. +- + !record {model: crm.phonecall, id: crm_phonecall_disc_openerp}: + date: !eval time.strftime('%Y-%m-%d 08:00:00') + name: Discussion About Openerp + duration: 2.0 + section_id: crm.section_sales_department +- + After called to Customer/partner, So creating record to merge with exiting partner +- + !record {model: crm.phonecall2partner, id: crm_phonecall2partner_existed}: + action: exist + partner_id: base.res_partner_9 + +- + We are going to create partner. +- + !python {model: crm.phonecall2partner}: | + + self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_disc_openerp")]}) + self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_existed")], {"active_ids": [ref("crm_phonecall_disc_openerp")]}) + self.make_partner(cr, uid, [ref("crm_phonecall2partner_existed")], {"active_ids": [ref("crm_phonecall_disc_openerp")]}) + +- | + As the success of phonecall seems to be a real business opportunity, It will convert + it to opportunity. +- + !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_disc_openerp}: + name: Discussion About Openerp + partner_id: base.res_partner_9 + planned_revenue: 0.0 + probability: 0.0 +- | + Business opportunity is now assigned to this phonecall. +- + !assert {model: crm.phonecall, id: crm_phonecall_disc_openerp}: + - opportunity_id != False +- + Succeed phonecall, it will be convert into on opportunity. +- + !python {model: crm.phonecall2opportunity}: | + self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_phonecall_disc_openerp")}) +- | + For business And I check that the phonecall and the newly created business + opportunity is linked to same partner. +- + !python {model: crm.phonecall}: | + obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_disc_openerp')) + ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) + obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] + assert obj_phonecall.partner_id == obj_opp.partner_id +- | + Customer/partner intested with our product, so we will call back to him/her +- + !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_disc_openerp}: + date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" + name: interest with openerp + section_id: crm.section_sales_department + user_id: base.user_root + action: schedule + categ_id: crm.categ_phone1 +- | + Create other sedular call which is interested customer/partner. +- + !python {model: crm.phonecall2phonecall}: | + self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_disc_openerp')], {'active_id': ref('crm_phonecall_disc_openerp')}) +- | + Completion of phonecall, Cheking for phonecall summary is close or not. +- + !python {model: crm.phonecall}: | + phonecall_rec = self.browse(cr, uid, ref('crm_phonecall_disc_openerp')) + assert phonecall_rec.state == 'done', "Phonecall is not in done state" diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml deleted file mode 100644 index 0754a5b9544..00000000000 --- a/addons/crm/test/test_crm_phonecall.yml +++ /dev/null @@ -1,116 +0,0 @@ -- | - I start by creating a new phonecall. -- - !record {model: crm.phonecall, id: crm_phonecall_interviewcall0}: - date: !eval time.strftime('%Y-%m-%d 08:00:00') - name: Interview call - duration: 2.0 - section_id: crm.section_sales_department -- - I select partner by click on "Create a Partner" button. -- - !record {model: crm.phonecall2partner, id: crm_phonecall2partner_1}: - action: exist - partner_id: base.res_partner_9 - -- - I click on "Continue" button of this wizard and make partner. -- - !python {model: crm.phonecall2partner}: | - - self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_interviewcall0")]}) - self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]}) - self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]}) - -- | - As the success of phonecall seems to be a real business opportunity, I will convert - it to opportunity by clicking on the "Convert to Opportunity" button. -- - !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_interviewcall0}: - name: Interview call - partner_id: base.res_partner_9 - planned_revenue: 0.0 - probability: 0.0 -- | - I can see that a business opportunity is now assigned to this phonecall -- - !assert {model: crm.phonecall, id: crm_phonecall_interviewcall0}: - - opportunity_id != False -- - I click on "Convert" button of this wizard. -- - !python {model: crm.phonecall2opportunity}: | - self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_interviewcall0")], {"active_id": ref("crm_phonecall_interviewcall0")}) -- | - And I check that the phonecall and the newly created business opportunity is linked - to same partner. -- - !python {model: crm.phonecall}: | - obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_interviewcall0')) - ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) - obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] - assert obj_phonecall.partner_id == obj_opp.partner_id -- | - I schedule Meeting on this current phonecall by clicking on "schedule - Meeting". -- - !python {model: crm.phonecall}: | - self.action_make_meeting(cr, uid, [ref('crm_phonecall_interviewcall0')]) - -- | - I can see that Meeting's calendar view is shown. - then I click on the date on which I want schedule meeting. - I fill proper data for that meeting and save it. -- - !record {model: crm.meeting, id: crm_meeting_interviewcall0}: - alarm_id: base_calendar.alarm3 - date: !eval "'%s-%s-%s 09:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" - date_deadline: !eval "'%s-%s-%s 17:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" - duration: 8.0 - email_from: info@balmerinc.be - name: Interview call - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - phonecall_id: 'crm_phonecall_interviewcall0' - state: open - -- | - In order to schedule other phonecall to the partner - I click on "schedule other call" button. and plan for other call - I can see that it will open other phonecall view with some data same as current - phonecall. -- - !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall0}: - date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" - name: Interview call - section_id: crm.section_sales_department - user_id: base.user_root - action: schedule - categ_id: crm.categ_phone1 -- - I click on "schedule other call" button. and plan for other call. -- - !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall1}: - date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" - name: Interview call - section_id: crm.section_sales_department - user_id: base.user_root - action: log - categ_id: crm.categ_phone1 -- | - I click on "Schedule" button of this wizard. -- - !python {model: crm.phonecall2phonecall}: | - fields = { - 'name': 'Interview call', - 'section_id': ref('crm.section_sales_department'), - 'user_id': ref('base.user_root'), - 'categ_id': ref('crm.categ_phone1') - } - self.default_get(cr, uid, fields,{'active_id': ref('crm_phonecall_interviewcall0')}) - self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall0')], {'active_id': ref('crm_phonecall_interviewcall0')}) -- | - I click on "Schedule" button of this wizard with log option. -- - !python {model: crm.phonecall2phonecall}: | - self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall1')], {'active_id': ref('crm_phonecall_interviewcall0')}) From e85f8215237e5feb62311d70c2ed53b53f763a0b Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 11 Oct 2011 18:34:48 +0530 Subject: [PATCH 024/470] [IMP] crm: String improvement in process_crm_meeting.yml bzr revid: ron@tinyerp.com-20111011130448-vtijq1p0s83o3e4y --- addons/crm/test/process/process_crm_meeting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/test/process/process_crm_meeting.yml b/addons/crm/test/process/process_crm_meeting.yml index 91535424964..8f8ae2cd417 100644 --- a/addons/crm/test/process/process_crm_meeting.yml +++ b/addons/crm/test/process/process_crm_meeting.yml @@ -55,7 +55,7 @@ user_ids: - base.user_demo - - Now inviting those people which we are registers. + Now inviting those people which we are registered. - !python {model: base_calendar.invite.attendee}: | self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_case_initialdiscussion0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) From cce4c999e1f0095cc6a20023a156341c548b0f59 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 11:06:14 +0530 Subject: [PATCH 025/470] [IMP, REF]: crm: All Changes on process_crm_lead.yml, 1) Used demo data instead of yml creation data of lead, 2) Improved variables names and conversion, 3) Improved all string regarding to end user and remove all string like coder, 4) Removed mass wizard to convert lead to opportunity bzr revid: ron@tinyerp.com-20111012053614-4fddssqes817phtg --- addons/crm/test/process/process_crm_lead.yml | 100 +++++++------------ 1 file changed, 34 insertions(+), 66 deletions(-) diff --git a/addons/crm/test/process/process_crm_lead.yml b/addons/crm/test/process/process_crm_lead.yml index f35b03dcd4f..db1ffa4e753 100644 --- a/addons/crm/test/process/process_crm_lead.yml +++ b/addons/crm/test/process/process_crm_lead.yml @@ -1,112 +1,80 @@ -- | - I start by creating a new lead "Steave Jon" and I provide an address to this - new customer, as well as an email "info@mycustomer.com". - - !record {model: crm.lead, id: crm_lead_newcustomer0}: - email_from: info@mycustomer.com - name: Steave Jon - partner_name: Capegemini - partner_id: base.res_partner_9 - phone: (855) 924-4364 - mobile: (333) 715-1450 - section_id: crm.section_sales_department - referred: False -- | - I check that the lead is in 'draft' state. + Communication by phonecall or mail I got lead from Customer/partner, I test to created lead in initial stage. - - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in Draft}: + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in Draft}: - state == "draft" - - I open lead by click on "Open" button. + After some discussion about lead with customer/partner some possibillity to go ahead, so we are opening this lead. - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref("crm_lead_newcustomer0")]) + self.case_open(cr, uid, [ref("crm_case_qrecorp0")]) fields={ 'day_open': 0.0, 'day_close': 0.0 } - self._compute_day(cr, uid, [ref("crm_lead_newcustomer0")], fields, context) + self._compute_day(cr, uid, [ref("crm_case_qrecorp0")], fields, context) - | - I check that lead is now in 'open' state. + In order to test lead, i will test lead is in open stage. - - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}: + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}: - state == "open" - - I search id for case object. -- - !python {model: crm.case.categ}: | - self._find_object_id(cr, uid, context) -- | - As the lead seems to be a real business opportunity, I will convert it to a - partner - and a business opportunity by clicking on the "Convert" button. + As the lead seems to be a real business opportunity, I will convert it to a partner + and a business opportunity. - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_lead_newcustomer0')) - action = self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")], {'active_ids': [ref("crm_lead_newcustomer0")]}) + lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) + action = self.convert_opportunity(cr, uid, [ref("crm_case_qrecorp0")], {'active_ids': [ref("crm_case_qrecorp0")]}) assert action['res_model'] == 'crm.lead2opportunity.partner' - - | - I select "create a new partner" option. + In order to create partner, It is possible to check for partner is exiting or i will create new partner + according to this lead. so first i will create new partner. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_0}: action: 'create' name: 'convert' - - Then, Click on "Create Opportunity" button. + In order to create opportunity and its created by new partner. - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) - - | - I select "Link to an existing partner" option. + In order to test with exiting partner, so i will test with exiting partner and create opportunities based + on exiting partner. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: action: 'exist' - - Then, Click on "Create Opportunity" button. + Create opportunity based on exiting partner - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) - - | - I select "Do not link to a partner" option. + In order to test with no link wih partner, so i will test create opportunities based + no link to any partner. - - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}: - action: 'nothing' + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}: + action: 'nothing' - - Then, Click on "Create Opportunity" button. + In order to test create opportunity based on no link to any partner. - - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) -- | - In order to check the opportunity is created or not, I check type. + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) +- + In order to test lead, i will test to lead is converted to opportunity. - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref("crm_lead_newcustomer0")) + lead = self.browse(cr, uid, ref("crm_case_qrecorp0")) assert lead.type == 'opportunity' - - - I create mass report of lead to opprtunity partner. + Finally, i won this lead and congratulation we have new partner so i will close this lead. - - !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}: - user_ids: - - base.user_root - section_id: crm.section_sales_department + !python {model: crm.lead}: | + self.case_close(cr, uid, [ref("crm_case_qrecorp0")]) - - Then, execute that mass wizard. + In order to test lead, i will test its on close or not. - - !python {model: crm.lead2opportunity.partner.mass}: | - self.mass_convert(cr, uid, [ref("crm_lead2opportunity_partner_mass0")],{'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) -- - I close lead by click on "close" button. -- - !python {model: crm.lead}: | - self.case_close(cr, uid, [ref("crm_lead_newcustomer0")]) -- | - I check that lead is now in 'done' state. -- - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in done state}: + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: - state == "done" #- # | From 7e237da6090533e7ea2f374719abef1592986eee Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 12:00:36 +0530 Subject: [PATCH 026/470] [IMP] crm: Error generated by assigned wrong reference on test_crm_opportunity.yml bzr revid: ron@tinyerp.com-20111012063036-hlm825p2gut48o29 --- addons/crm/test/test_crm_opportunity.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index 734a1cae46c..8f171311b4d 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -109,5 +109,5 @@ !python {model: crm.merge.opportunity}: | op_list = [ref('crm_opportunity_1'),ref('crm_opportunity_2')] op_ids=self.pool.get('crm.lead').browse(cr,uid,op_list) - lead_ids = [ref('crm_lead_newcustomer0')] + lead_ids = [ref('crm_case_qrecorp0')] self.merge(cr, uid, op_ids, {'lead_ids': lead_ids}) From ac090c0b3ec42a5d458a7564338694166a717588 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 14:45:33 +0530 Subject: [PATCH 027/470] [REF] crm: 1) rename file process_crm_lead.yml to crm_lead_open.yml and its have checked till qualified lead bzr revid: ron@tinyerp.com-20111012091533-bwxqz7t6f5dsni1s --- addons/crm/test/process/crm_lead_open.yml | 10 +++ addons/crm/test/process/process_crm_lead.yml | 94 -------------------- 2 files changed, 10 insertions(+), 94 deletions(-) create mode 100644 addons/crm/test/process/crm_lead_open.yml delete mode 100644 addons/crm/test/process/process_crm_lead.yml diff --git a/addons/crm/test/process/crm_lead_open.yml b/addons/crm/test/process/crm_lead_open.yml new file mode 100644 index 00000000000..d5c6bb2d101 --- /dev/null +++ b/addons/crm/test/process/crm_lead_open.yml @@ -0,0 +1,10 @@ +- + Communication by phonecall or mail I got lead from Customer/partner, I test to created lead in initial stage. +- + !python {model: crm.lead}: | + self.case_open(cr, uid, [ref("crm_case_qrecorp0")]) +- | + In order to test lead, i will test lead is in open stage. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}: + - state == "open" diff --git a/addons/crm/test/process/process_crm_lead.yml b/addons/crm/test/process/process_crm_lead.yml deleted file mode 100644 index db1ffa4e753..00000000000 --- a/addons/crm/test/process/process_crm_lead.yml +++ /dev/null @@ -1,94 +0,0 @@ -- - Communication by phonecall or mail I got lead from Customer/partner, I test to created lead in initial stage. -- - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in Draft}: - - state == "draft" -- - After some discussion about lead with customer/partner some possibillity to go ahead, so we are opening this lead. -- - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref("crm_case_qrecorp0")]) - fields={ - 'day_open': 0.0, - 'day_close': 0.0 - } - self._compute_day(cr, uid, [ref("crm_case_qrecorp0")], fields, context) -- | - In order to test lead, i will test lead is in open stage. -- - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}: - - state == "open" -- - As the lead seems to be a real business opportunity, I will convert it to a partner - and a business opportunity. -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) - action = self.convert_opportunity(cr, uid, [ref("crm_case_qrecorp0")], {'active_ids': [ref("crm_case_qrecorp0")]}) - assert action['res_model'] == 'crm.lead2opportunity.partner' -- - In order to create partner, It is possible to check for partner is exiting or i will create new partner - according to this lead. so first i will create new partner. -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_0}: - action: 'create' - name: 'convert' -- - In order to create opportunity and its created by new partner. -- - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) -- - In order to test with exiting partner, so i will test with exiting partner and create opportunities based - on exiting partner. -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: - action: 'exist' -- - Create opportunity based on exiting partner -- - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) -- - In order to test with no link wih partner, so i will test create opportunities based - no link to any partner. -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}: - action: 'nothing' -- - In order to test create opportunity based on no link to any partner. -- - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) -- - In order to test lead, i will test to lead is converted to opportunity. -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref("crm_case_qrecorp0")) - assert lead.type == 'opportunity' -- - Finally, i won this lead and congratulation we have new partner so i will close this lead. -- - !python {model: crm.lead}: | - self.case_close(cr, uid, [ref("crm_case_qrecorp0")]) -- - In order to test lead, i will test its on close or not. -- - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: - - state == "done" -#- -# | -# yaml is also not working with smtp server and send new email. - -- | - I configure with smtp server. -- | - And I communicate with lead through send New mail to Lead using its email address from the user who is logged in. -- | - I check that communication history generated when send email to lead. -- | - Then, I add a cc which receive copy of future communication between partner and users by mail. - -- | - I Reply to last Email to lead with some document attached.and check that communication history generated or not. - From aef95be470d8b889fb4ede1131f000f30ad31abc Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 15:31:34 +0530 Subject: [PATCH 028/470] [ADD] crm: 1) Added new crm_lead_to_opportunity.yml bzr revid: ron@tinyerp.com-20111012100134-gueog210ck07yhx6 --- addons/crm/__openerp__.py | 3 +- .../test/process/crm_lead_to_opportunity.yml | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 addons/crm/test/process/crm_lead_to_opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 05ed350bea1..d7256360d40 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -119,7 +119,8 @@ Creates a dashboard for CRM that includes: 'crm_phonecall_demo.xml', ], 'test': [ - 'test/process/process_crm_lead.yml', + 'test/process/crm_lead_open.yml', + 'test/process/crm_lead_to_opportunity.yml', 'test/process/cancle_crm_lead.yml', 'test/process/process_crm_meeting.yml', 'test/test_crm_opportunity.yml', diff --git a/addons/crm/test/process/crm_lead_to_opportunity.yml b/addons/crm/test/process/crm_lead_to_opportunity.yml new file mode 100644 index 00000000000..2c1ccc65bfb --- /dev/null +++ b/addons/crm/test/process/crm_lead_to_opportunity.yml @@ -0,0 +1,36 @@ +- + As the lead seems to be a real business opportunity, I will convert it to a partner + and a business opportunity. +- + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: + action: 'exist' +- + Create opportunity based on exiting partner +- + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) +- + In order to test lead, i will test to lead is converted to opportunity. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead is not converted on opportunity}: + - type == 'opportunity' +- + Finally, i won this lead, so i will close this lead. +- + !python {model: crm.lead}: | + self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) +- + In order to test lead, it is close or not. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: + - state == "done" +- + After won this lead probability is 100. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: + - probability == 100.0 +- + In order to test stage of opportunity after win, i will test stage of opportunity. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: + - stage_id.name == "Won" From b864f6dbb749b093d2b2fb4e2b24155518b8082d Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 16:03:09 +0530 Subject: [PATCH 029/470] [REF] crm: 1) Rename process_crm_meeting.yml to crm_meeting.yml 2) Covered from confirmatation to close meeting bzr revid: ron@tinyerp.com-20111012103309-j71jwxzn52xbsnma --- addons/crm/test/process/crm_meeting.yml | 12 ++++ .../crm/test/process/process_crm_meeting.yml | 72 ------------------- 2 files changed, 12 insertions(+), 72 deletions(-) create mode 100644 addons/crm/test/process/crm_meeting.yml delete mode 100644 addons/crm/test/process/process_crm_meeting.yml diff --git a/addons/crm/test/process/crm_meeting.yml b/addons/crm/test/process/crm_meeting.yml new file mode 100644 index 00000000000..508b1eaff59 --- /dev/null +++ b/addons/crm/test/process/crm_meeting.yml @@ -0,0 +1,12 @@ +- | + Customer want to do initial discussion with us so we will arrage meeting + with them and checked also confirm meeting and after cheked it will be + completed. +- + !python {model: crm.meeting}: | + self.case_open(cr, uid, [ref('crm_case_initialdiscussion0')]) + meeting_rec = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) + assert meeting_rec.state == 'open', "Meeting is not in confirm state" + self.case_close(cr, uid, [ref('crm_case_initialdiscussion0')]) + meeting_rec_close = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) + assert meeting_rec_close.state == 'done', "Meeting is not in done state" \ No newline at end of file diff --git a/addons/crm/test/process/process_crm_meeting.yml b/addons/crm/test/process/process_crm_meeting.yml deleted file mode 100644 index 8f8ae2cd417..00000000000 --- a/addons/crm/test/process/process_crm_meeting.yml +++ /dev/null @@ -1,72 +0,0 @@ -- | - Customer want to do initial discussion with us so we will arrage meeting or - phonecalles or internal Meeting with them. -- - !assert {model: crm.meeting, id: crm.crm_case_initialdiscussion0}: - - state == "draft" -- | - For Remember purpose for meeting, i put reminder "30 minutes before" and assign - to meeting. -- - !python {model: crm.meeting}: | - self.write(cr, uid, [ref('crm_case_initialdiscussion0')], {'alarm_id': ref("base_calendar.alarm5")}) -- | - In order to check recurrence on meetings I will set Recurrency to Custom - and I set the fields so that the meeting will occur weekly on Monday to Friday 10 times. -- - !python {model: crm.meeting}: | - self.write(cr, uid, [ref("crm_case_initialdiscussion0")], {'fr': 1, 'mo': 1, 'th': 1, 'tu': 1, 'we':1, 'count':10, 'interval': 1, 'rrule_type': 'weekly'}) - -- | - The meeting is scheduled on Monday and Friday for 10 times so i can see from the calendar view -- - !python {model: crm.meeting}: | - self.fields_view_get(cr, uid, False, 'calendar', context) -- | - We can check for one of the recurrent event and count the number of meeting. -- - !python {model: crm.meeting}: | - import time - from datetime import datetime, date, timedelta - ids = self.search(cr, uid, [('date', '>=', time.strftime('%Y-%m-%d 00:00:00')), ('date', '<=', (datetime.now()+timedelta(31)).strftime('%Y-%m-%d 00:00:00')), ('name', '=', 'Initial discussion')], context={'virtual_id': True}) - assert len(ids) == 10 - -- | - If I want to edit meetings information for all occurrence I click on "Edit All" button. -- - !python {model: crm.meeting}: | - self.write(cr, uid, [ref('crm_case_initialdiscussion0')], {'edit_all':'True'},context) -- | - I can see that new meeting form is opened with same value. - I change some data for meeting and save it. - I can see from meeting's calendar view that all meeting occurrences are changed accordingly. -- - !record {model: crm.meeting, id: crm.crm_case_initialdiscussion0}: - alarm_id: base_calendar.alarm9 - rrule_type: weekly -- | - In order to invite people(internal user) for this meetings, Create record for - people will come on meeting. -- - !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}: - type: internal - send_mail: False - partner_id: base.res_partner_9 - user_ids: - - base.user_demo -- - Now inviting those people which we are registered. -- - !python {model: base_calendar.invite.attendee}: | - self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_case_initialdiscussion0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) -- | - All conformation is completed for meeting now going to confirm meeting - and we can check also after completion of meeting, it is done or not. -- - !python {model: crm.meeting}: | - self.case_open(cr, uid, [ref('crm_case_initialdiscussion0')]) - meeting_rec = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) - assert meeting_rec.state == 'open', "Meeting is not in confirm state" - self.case_close(cr, uid, [ref('crm_case_initialdiscussion0')]) - meeting_rec_close = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) - assert meeting_rec_close.state == 'done', "Meeting is not in done state" From 6b19d9baa1d501d18a4dd1550ff50d88d6354faa Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 16:22:21 +0530 Subject: [PATCH 030/470] [IMP] crm: 1) Improvement in openerp for correct path of crm_meeting.yml bzr revid: ron@tinyerp.com-20111012105221-mxlfnzeg16s93d7u --- addons/crm/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index d7256360d40..51489fd5aa4 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -122,7 +122,7 @@ Creates a dashboard for CRM that includes: 'test/process/crm_lead_open.yml', 'test/process/crm_lead_to_opportunity.yml', 'test/process/cancle_crm_lead.yml', - 'test/process/process_crm_meeting.yml', + 'test/process/crm_meeting.yml', 'test/test_crm_opportunity.yml', 'test/process/process_crm_phonecall.yml', 'test/test_crm_recurrent_meeting.yml', From e355b8b55d9995bb4533fac1f914a83908159f32 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 17:26:44 +0530 Subject: [PATCH 031/470] [ADD] crm: 1) Added lead_form.yml, 2) Covered onchange_partner operation and unlink operation bzr revid: ron@tinyerp.com-20111012115644-q91ejya01c8k28m1 --- addons/crm/__openerp__.py | 1 + addons/crm/test/ui/lead_form.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 addons/crm/test/ui/lead_form.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 51489fd5aa4..dee4a6766ed 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -123,6 +123,7 @@ Creates a dashboard for CRM that includes: 'test/process/crm_lead_to_opportunity.yml', 'test/process/cancle_crm_lead.yml', 'test/process/crm_meeting.yml', + 'test/ui/lead_form.yml', 'test/test_crm_opportunity.yml', 'test/process/process_crm_phonecall.yml', 'test/test_crm_recurrent_meeting.yml', diff --git a/addons/crm/test/ui/lead_form.yml b/addons/crm/test/ui/lead_form.yml new file mode 100644 index 00000000000..5ad241ca104 --- /dev/null +++ b/addons/crm/test/ui/lead_form.yml @@ -0,0 +1,20 @@ +- + In order to check for changes on partner, data will be change automatically according to partner, +- + !python {model: crm.lead}: | + action = self.onchange_partner_address_id(cr, uid, ref("crm_case_initialdiscussion0"), ref("base.res_partner_address_notsotinysarl0"), email=False) + assert action['value']['country_id'] == 20, "Country name not True" + assert action['value']['phone'] == '(+32).81.81.37.00', "phone number is wrong" +- + I try to Unlink the Lead I create new record of lead. +- + !record {model: crm.lead, id: crm_lead_intested_openerp}: + name: Interested in openerp +- + In order to test unlink lead, i will do unlink this lead +- + !python {model: crm.lead}: | + from tools.translate import _ + self.unlink(cr, uid, [ref("crm_lead_intested_openerp")]) + id = self.search(cr, uid, [('id', '=', ref("crm_lead_intested_openerp"))]) + assert len(id) < 1, _('Lead is not deleted') From 0df8ef1c6c7b3f0154efb8717617bf9d7b68b2ac Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 17:51:41 +0530 Subject: [PATCH 032/470] [REF] crm: 1) Rename process_crm_phonecall.yml to crm_phonecall.yml, 2) Covered phonecall and its coverted to opportunity and close this phonecall bzr revid: ron@tinyerp.com-20111012122141-7slvyilesfbxq1cw --- addons/crm/test/process/crm_phonecall.yml | 34 +++++++++ .../test/process/process_crm_phonecall.yml | 73 ------------------- 2 files changed, 34 insertions(+), 73 deletions(-) create mode 100644 addons/crm/test/process/crm_phonecall.yml delete mode 100644 addons/crm/test/process/process_crm_phonecall.yml diff --git a/addons/crm/test/process/crm_phonecall.yml b/addons/crm/test/process/crm_phonecall.yml new file mode 100644 index 00000000000..541f92133fe --- /dev/null +++ b/addons/crm/test/process/crm_phonecall.yml @@ -0,0 +1,34 @@ +- | + For customer or partner purpose, I called to him/her for discussion about openerp. + As the success of phonecall seems to be a real business opportunity, It will convert + it to opportunity. +- + !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_disc_openerp}: + name: Discuss Review Process + partner_id: base.res_partner_tinyatwork + planned_revenue: 0.0 + probability: 0.0 +- | + Business opportunity is now assigned to this phonecall. +- + !assert {model: crm.phonecall, id: crm_case_phone04}: + - opportunity_id != False +- + Succeed phonecall, it will be convert into on opportunity. +- + !python {model: crm.phonecall2opportunity}: | + self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_case_phone04")}) +- | + For business And I check that the phonecall and the newly created business + opportunity is linked to same partner. +- + !python {model: crm.phonecall}: | + obj_phonecall = self.browse(cr, uid, ref('crm_case_phone04')) + ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) + obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] + assert obj_phonecall.partner_id == obj_opp.partner_id, "created business opportunity is not linked to same partner" +- + Completion of phonecall, Cheking for phonecall summary is close or not. +- + !assert {model: crm.phonecall, id: crm.crm_case_phone04, string: phonecall is held}: + - state == 'done' diff --git a/addons/crm/test/process/process_crm_phonecall.yml b/addons/crm/test/process/process_crm_phonecall.yml deleted file mode 100644 index 25f3069fac6..00000000000 --- a/addons/crm/test/process/process_crm_phonecall.yml +++ /dev/null @@ -1,73 +0,0 @@ -- | - For customer or partner purpose, I called to him/her for discussion about openerp. -- - !record {model: crm.phonecall, id: crm_phonecall_disc_openerp}: - date: !eval time.strftime('%Y-%m-%d 08:00:00') - name: Discussion About Openerp - duration: 2.0 - section_id: crm.section_sales_department -- - After called to Customer/partner, So creating record to merge with exiting partner -- - !record {model: crm.phonecall2partner, id: crm_phonecall2partner_existed}: - action: exist - partner_id: base.res_partner_9 - -- - We are going to create partner. -- - !python {model: crm.phonecall2partner}: | - - self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_disc_openerp")]}) - self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_existed")], {"active_ids": [ref("crm_phonecall_disc_openerp")]}) - self.make_partner(cr, uid, [ref("crm_phonecall2partner_existed")], {"active_ids": [ref("crm_phonecall_disc_openerp")]}) - -- | - As the success of phonecall seems to be a real business opportunity, It will convert - it to opportunity. -- - !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_disc_openerp}: - name: Discussion About Openerp - partner_id: base.res_partner_9 - planned_revenue: 0.0 - probability: 0.0 -- | - Business opportunity is now assigned to this phonecall. -- - !assert {model: crm.phonecall, id: crm_phonecall_disc_openerp}: - - opportunity_id != False -- - Succeed phonecall, it will be convert into on opportunity. -- - !python {model: crm.phonecall2opportunity}: | - self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_phonecall_disc_openerp")}) -- | - For business And I check that the phonecall and the newly created business - opportunity is linked to same partner. -- - !python {model: crm.phonecall}: | - obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_disc_openerp')) - ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) - obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] - assert obj_phonecall.partner_id == obj_opp.partner_id -- | - Customer/partner intested with our product, so we will call back to him/her -- - !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_disc_openerp}: - date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" - name: interest with openerp - section_id: crm.section_sales_department - user_id: base.user_root - action: schedule - categ_id: crm.categ_phone1 -- | - Create other sedular call which is interested customer/partner. -- - !python {model: crm.phonecall2phonecall}: | - self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_disc_openerp')], {'active_id': ref('crm_phonecall_disc_openerp')}) -- | - Completion of phonecall, Cheking for phonecall summary is close or not. -- - !python {model: crm.phonecall}: | - phonecall_rec = self.browse(cr, uid, ref('crm_phonecall_disc_openerp')) - assert phonecall_rec.state == 'done', "Phonecall is not in done state" From cbe30f479ebbfacaf2fd2f287a40efa759227b52 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 18:07:50 +0530 Subject: [PATCH 033/470] [IMP] crm: 1) Improvement in openerp for correct path of crm_phonecall.yml bzr revid: ron@tinyerp.com-20111012123750-31997j4tkpx4odjt --- addons/crm/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index dee4a6766ed..ff9030cc2e8 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -125,7 +125,7 @@ Creates a dashboard for CRM that includes: 'test/process/crm_meeting.yml', 'test/ui/lead_form.yml', 'test/test_crm_opportunity.yml', - 'test/process/process_crm_phonecall.yml', + 'test/process/crm_phonecall.yml', 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', From 8e32600b09b62c0edd505c2c974c9fa99dad457d Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 18:22:13 +0530 Subject: [PATCH 034/470] [IMP] crm: Add more assert cheking and remove initial checking on crm_phonecall.yml bzr revid: ron@tinyerp.com-20111012125213-yq4vhekyblxl7017 --- addons/crm/test/process/crm_phonecall.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/addons/crm/test/process/crm_phonecall.yml b/addons/crm/test/process/crm_phonecall.yml index 541f92133fe..7f81a7d86fc 100644 --- a/addons/crm/test/process/crm_phonecall.yml +++ b/addons/crm/test/process/crm_phonecall.yml @@ -8,11 +8,6 @@ partner_id: base.res_partner_tinyatwork planned_revenue: 0.0 probability: 0.0 -- | - Business opportunity is now assigned to this phonecall. -- - !assert {model: crm.phonecall, id: crm_case_phone04}: - - opportunity_id != False - Succeed phonecall, it will be convert into on opportunity. - @@ -20,15 +15,13 @@ self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_case_phone04")}) - | For business And I check that the phonecall and the newly created business - opportunity is linked to same partner. + opportunity is linked to same partner and also check with phonecall close or not. - !python {model: crm.phonecall}: | obj_phonecall = self.browse(cr, uid, ref('crm_case_phone04')) ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] assert obj_phonecall.partner_id == obj_opp.partner_id, "created business opportunity is not linked to same partner" -- - Completion of phonecall, Cheking for phonecall summary is close or not. -- - !assert {model: crm.phonecall, id: crm.crm_case_phone04, string: phonecall is held}: - - state == 'done' + assert obj_opp.stage_id.name == "New", "Converted opportunity is not in New stage" + assert obj_opp.stage_id.probability == 10.0, "Probability of opportunity is 10.0" + assert obj_phonecall.state == "done", "phonecall is held" From 371ad07f80ff9210a0f309c888392609029d312d Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 18:54:02 +0530 Subject: [PATCH 035/470] [REF] crm : 1) Renamed cancle_crm_lead.yml to cancel_lead.yml, 2)Renamed crm_lead_to_opportunity.yml to lead2opportunity.yml, 3)Renamed crm_lead_open.yml to lead_open.yml 4)Renamed crm_meeting.yml to meeting.yml 5)Renamed crm_phonecall.yml to phonecall2opportunity.yml bzr revid: ron@tinyerp.com-20111012132402-9xichtqjqdwo5g8i --- addons/crm/test/process/{cancle_crm_lead.yml => cancel_lead.yml} | 0 .../process/{crm_lead_to_opportunity.yml => lead2opportunity.yml} | 0 addons/crm/test/process/{crm_lead_open.yml => lead_open.yml} | 0 addons/crm/test/process/{crm_meeting.yml => meeting.yml} | 0 .../test/process/{crm_phonecall.yml => phonecall2opportunity.yml} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename addons/crm/test/process/{cancle_crm_lead.yml => cancel_lead.yml} (100%) rename addons/crm/test/process/{crm_lead_to_opportunity.yml => lead2opportunity.yml} (100%) rename addons/crm/test/process/{crm_lead_open.yml => lead_open.yml} (100%) rename addons/crm/test/process/{crm_meeting.yml => meeting.yml} (100%) rename addons/crm/test/process/{crm_phonecall.yml => phonecall2opportunity.yml} (100%) diff --git a/addons/crm/test/process/cancle_crm_lead.yml b/addons/crm/test/process/cancel_lead.yml similarity index 100% rename from addons/crm/test/process/cancle_crm_lead.yml rename to addons/crm/test/process/cancel_lead.yml diff --git a/addons/crm/test/process/crm_lead_to_opportunity.yml b/addons/crm/test/process/lead2opportunity.yml similarity index 100% rename from addons/crm/test/process/crm_lead_to_opportunity.yml rename to addons/crm/test/process/lead2opportunity.yml diff --git a/addons/crm/test/process/crm_lead_open.yml b/addons/crm/test/process/lead_open.yml similarity index 100% rename from addons/crm/test/process/crm_lead_open.yml rename to addons/crm/test/process/lead_open.yml diff --git a/addons/crm/test/process/crm_meeting.yml b/addons/crm/test/process/meeting.yml similarity index 100% rename from addons/crm/test/process/crm_meeting.yml rename to addons/crm/test/process/meeting.yml diff --git a/addons/crm/test/process/crm_phonecall.yml b/addons/crm/test/process/phonecall2opportunity.yml similarity index 100% rename from addons/crm/test/process/crm_phonecall.yml rename to addons/crm/test/process/phonecall2opportunity.yml From bb264832066b97c6f4ae97652aa4feaacf1f5bad Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 12 Oct 2011 16:48:58 +0200 Subject: [PATCH 036/470] [IMP] res.widget data: Do not try to instantiate twitter api if twitter lib was not successfully fetched. bzr revid: fme@openerp.com-20111012144858-keqaec4f3ru5jvml --- openerp/addons/base/res/res_widget_data.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openerp/addons/base/res/res_widget_data.xml b/openerp/addons/base/res/res_widget_data.xml index 8987e117396..48d53c7a021 100644 --- a/openerp/addons/base/res/res_widget_data.xml +++ b/openerp/addons/base/res/res_widget_data.xml @@ -6,6 +6,7 @@ ]]>
From 08a288eceabce77145d59d1775ef5e903912541c Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 10:42:32 +0530 Subject: [PATCH 037/470] [IMP]: crm: All changes done on lead2opportunity.yml 1) string improved from lead to opportunity when lead has been qualified 2) checked probability after opportunity had won bzr revid: ron@tinyerp.com-20111013051232-k9oih94g1fvmdhbh --- addons/crm/test/process/lead2opportunity.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index 2c1ccc65bfb..db85d634b21 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -15,22 +15,23 @@ !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead is not converted on opportunity}: - type == 'opportunity' - - Finally, i won this lead, so i will close this lead. + Finally, i won this opportunity, so i will close this lead. - !python {model: crm.lead}: | self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) - - In order to test lead, it is close or not. + In order to test opportunity, it is close or not. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: - state == "done" -- - After won this lead probability is 100. -- - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - - probability == 100.0 - In order to test stage of opportunity after win, i will test stage of opportunity. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: - stage_id.name == "Won" +- + After won the opportunity, i will test probability is 100. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: + - probability == 100.0 + \ No newline at end of file From 0d3652a60b657ad055634276c3de2519414d61e3 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 11:06:51 +0530 Subject: [PATCH 038/470] [IMP] crm : All renamed file name Updated on __opnerp.py file bzr revid: ron@tinyerp.com-20111013053651-yfoku3auqg1s730i --- addons/crm/__openerp__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index ff9030cc2e8..54cc33c1dd9 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -119,13 +119,13 @@ Creates a dashboard for CRM that includes: 'crm_phonecall_demo.xml', ], 'test': [ - 'test/process/crm_lead_open.yml', - 'test/process/crm_lead_to_opportunity.yml', - 'test/process/cancle_crm_lead.yml', - 'test/process/crm_meeting.yml', + 'test/process/lead_open.yml', + 'test/process/lead2opportunity.yml', + 'test/process/cancel_lead.yml', + 'test/process/meeting.yml', 'test/ui/lead_form.yml', 'test/test_crm_opportunity.yml', - 'test/process/crm_phonecall.yml', + 'test/process/phonecall2opportunity.yml', 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', From 5cdcd1bf45ac8dee47c8fcba4adc44934456ace7 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 11:22:09 +0530 Subject: [PATCH 039/470] [IMP]: crm: All changes done on phonecall2opportunity.yml 1) string improved because put more assert, 2) Removed code search by name Its done by id all bzr revid: ron@tinyerp.com-20111013055209-3e6741omkojcs9vm --- addons/crm/test/process/phonecall2opportunity.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/addons/crm/test/process/phonecall2opportunity.yml b/addons/crm/test/process/phonecall2opportunity.yml index 7f81a7d86fc..89b11a80f50 100644 --- a/addons/crm/test/process/phonecall2opportunity.yml +++ b/addons/crm/test/process/phonecall2opportunity.yml @@ -15,13 +15,11 @@ self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_case_phone04")}) - | For business And I check that the phonecall and the newly created business - opportunity is linked to same partner and also check with phonecall close or not. + opportunity is linked to same partner and also check with phonecall closed and opportunity + is on intial stage or not. - !python {model: crm.phonecall}: | - obj_phonecall = self.browse(cr, uid, ref('crm_case_phone04')) - ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) - obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] - assert obj_phonecall.partner_id == obj_opp.partner_id, "created business opportunity is not linked to same partner" - assert obj_opp.stage_id.name == "New", "Converted opportunity is not in New stage" - assert obj_opp.stage_id.probability == 10.0, "Probability of opportunity is 10.0" - assert obj_phonecall.state == "done", "phonecall is held" + phonecall = self.browse(cr, uid, ref('crm_case_phone04')) + assert phonecall.partner_id.id == phonecall.opportunity_id.partner_id.id, "created business opportunity is not linked to same partner" + assert phonecall.opportunity_id.stage_id.id == ref("stage_lead1"), "Converted opportunity is not in Initial stage" + assert phonecall.state == "done", "phonecall is held" From f7da9553df2138294d98d5744a88b3cd4d6cb72c Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 12:04:11 +0530 Subject: [PATCH 040/470] [REF, IMP]: crm: All changes done on cancel_lead.yml 1) Put more assert and done code more reliable, 2) checked all assert differently 3) Improved string bzr revid: ron@tinyerp.com-20111013063411-bestdccmzkqo8w4y --- addons/crm/test/process/cancel_lead.yml | 67 ++++++++++++++++++------- 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/addons/crm/test/process/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index c8d02c6414c..3a3366c05e4 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -1,22 +1,43 @@ - - Cheking for lead from any stage, It will be cancle or not. + Cheking for lead from draft to cancel, I will cancelling this lead. - !python {model: crm.lead}: | - lead_on_draft=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_on_draft.state == 'draft', "Lead is not in draft state" self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_on_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_on_cancel.state == 'cancel', "Lead is not in cancel state" +- + In order to test for cancel lead , i will test lead is on cancel state. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: + - state == "cancel" +- + Cheking for lead from cancel to reset, I will reseting this lead. +- + !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_on_reset=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_on_reset.state == 'draft', "Lead is not in draft state" +- + In order to test for reset lead , i will test lead is on draft state. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in draft state}: + - state == "draft" +- + Cheking for lead from reset to pending, I will pending this lead. +- + !python {model: crm.lead}: | self.case_pending(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_on_pending=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_on_pending.state == 'pending', "Lead is not in pending state" +- + In order to test for pending lead , i will test lead is on pending state. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in pending state}: + - state == "pending" +- + Cheking for lead from pending to cancel, I will cancelling this lead. +- + !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_pending_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_pending_cancel.state == 'cancel', "Lead is not in cancel state" - +- + In order to test for cancel lead , i will test lead is on cancel state. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: + - state == "cancel" - For working on parent child relationship, we are creating sales executive department that will be work under Sales Department. @@ -36,13 +57,21 @@ department or not. - !python {model: crm.lead}: | - lead_rec=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_cancle_reset=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_cancle_reset.state == 'draft', "Lead is not in draft state" self.case_escalate(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_on_escalate=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_on_escalate.section_id.name == 'Sales Department', "Do not Escalate lead to on sales team from Executive team" +- + In order to test for escalate lead , i will test lead Escalate from sales Department from Executive + department. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Escalate lead to on sales team from Executive teame}: + - section_id.name == "Sales Department" +- + Cheking for lead from escalate to cancel, I will cancelling this lead. +- + !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_escalate_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_escalate_cancel.state == 'cancel', "Lead is not in cancel state" +- + In order to test for cancel lead , i will test lead is on cancel state. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: + - state == "cancel" From 57cc6f533c3ec69285922f68c5261457cdd81807 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 12:40:53 +0530 Subject: [PATCH 041/470] [REF, IMP]: crm: default value removed from phonecall2opportunity.yml bzr revid: ron@tinyerp.com-20111013071053-nqzonf822815l3ey --- addons/crm/test/process/phonecall2opportunity.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/crm/test/process/phonecall2opportunity.yml b/addons/crm/test/process/phonecall2opportunity.yml index 89b11a80f50..2575daf8665 100644 --- a/addons/crm/test/process/phonecall2opportunity.yml +++ b/addons/crm/test/process/phonecall2opportunity.yml @@ -6,8 +6,6 @@ !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_disc_openerp}: name: Discuss Review Process partner_id: base.res_partner_tinyatwork - planned_revenue: 0.0 - probability: 0.0 - Succeed phonecall, it will be convert into on opportunity. - From 5fb61d943f311c81ed52572bbf60fa785c160035 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 14:41:23 +0530 Subject: [PATCH 042/470] [REF, IMP]: crm: All changes done on lead_form.yml 1) Added lead on form for copy and delete function 2) Checked code according to delete lead bzr revid: ron@tinyerp.com-20111013091123-refu3d0l1b7g7swl --- addons/crm/test/ui/lead_form.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/crm/test/ui/lead_form.yml b/addons/crm/test/ui/lead_form.yml index 5ad241ca104..2e73aa5766b 100644 --- a/addons/crm/test/ui/lead_form.yml +++ b/addons/crm/test/ui/lead_form.yml @@ -2,19 +2,20 @@ In order to check for changes on partner, data will be change automatically according to partner, - !python {model: crm.lead}: | - action = self.onchange_partner_address_id(cr, uid, ref("crm_case_initialdiscussion0"), ref("base.res_partner_address_notsotinysarl0"), email=False) + action = self.onchange_partner_address_id(cr, uid, ref("crm_case_qrecorp0"), ref("base.res_partner_address_notsotinysarl0"), email=False) assert action['value']['country_id'] == 20, "Country name not True" assert action['value']['phone'] == '(+32).81.81.37.00', "phone number is wrong" - I try to Unlink the Lead I create new record of lead. - - !record {model: crm.lead, id: crm_lead_intested_openerp}: - name: Interested in openerp + !record {model: crm.lead, id: crm_case_new_lead}: + name: Opnerp Trainning + state: cancel - In order to test unlink lead, i will do unlink this lead - !python {model: crm.lead}: | - from tools.translate import _ - self.unlink(cr, uid, [ref("crm_lead_intested_openerp")]) - id = self.search(cr, uid, [('id', '=', ref("crm_lead_intested_openerp"))]) - assert len(id) < 1, _('Lead is not deleted') + try: + self.unlink(cr, uid, [ref("crm_case_new_lead")]) + except: + pass From 213fa886f1603853779b17282caa77323f564c5c Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 14:59:24 +0530 Subject: [PATCH 043/470] [REF, IMP]: crm: Added copy of lead and checked on lead_form.yml bzr revid: ron@tinyerp.com-20111013092924-oowazupgpnajrqpb --- addons/crm/test/ui/lead_form.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/crm/test/ui/lead_form.yml b/addons/crm/test/ui/lead_form.yml index 2e73aa5766b..c6cbbb3fcb2 100644 --- a/addons/crm/test/ui/lead_form.yml +++ b/addons/crm/test/ui/lead_form.yml @@ -9,12 +9,15 @@ I try to Unlink the Lead I create new record of lead. - !record {model: crm.lead, id: crm_case_new_lead}: - name: Opnerp Trainning + name: Openerp Trainning state: cancel - In order to test unlink lead, i will do unlink this lead - !python {model: crm.lead}: | + self.copy(cr, uid, ref("crm_case_new_lead")) + sid = self.search(cr, uid, [('name', '=', 'Openerp Trainning')]) + assert len(sid) == 2, 'Lead is not copied Successfully' try: self.unlink(cr, uid, [ref("crm_case_new_lead")]) except: From 65304c97f773ad20c03105b5b6678cb84e856698 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 17:13:04 +0530 Subject: [PATCH 044/470] [REF]: crm: Added more checking after convert opportunity from lead and also added partner on existing record on lead2opportunity.yml bzr revid: ron@tinyerp.com-20111013114304-wuxvpnnmubtc9s8r --- addons/crm/test/process/lead2opportunity.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index db85d634b21..5a9668adfd3 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -2,18 +2,24 @@ As the lead seems to be a real business opportunity, I will convert it to a partner and a business opportunity. - - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: - action: 'exist' + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: + action: 'exist' + partner_id: base.res_partner_agrolait - Create opportunity based on exiting partner - - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) - In order to test lead, i will test to lead is converted to opportunity. - - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead is not converted on opportunity}: - - type == 'opportunity' + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) + assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' + assert lead.planned_revenue == 0.0, 'Planned revenue should be 0!' + assert lead.probability == 0.0, 'probability revenue should be 0!' + assert lead.partner_id.id == ref("base.res_partner_agrolait"), 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' - Finally, i won this opportunity, so i will close this lead. - @@ -34,4 +40,3 @@ - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - probability == 100.0 - \ No newline at end of file From c8b4c07d9b5bbf256249e9c51d6d5e83cf8b60cd Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 18:42:02 +0530 Subject: [PATCH 045/470] [ADD]: crm: Added new yml lead2_mass_convert_opportunity.yml 1) cheked convert two lead to opportunity. 2) Checked record according to lead bzr revid: ron@tinyerp.com-20111013131202-aku0tvzavpyz4efp --- addons/crm/__openerp__.py | 1 + .../lead2_mass_convert_opportunity.yml | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 addons/crm/test/process/lead2_mass_convert_opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 54cc33c1dd9..508c7dff370 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -123,6 +123,7 @@ Creates a dashboard for CRM that includes: 'test/process/lead2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', + 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', 'test/test_crm_opportunity.yml', 'test/process/phonecall2opportunity.yml', diff --git a/addons/crm/test/process/lead2_mass_convert_opportunity.yml b/addons/crm/test/process/lead2_mass_convert_opportunity.yml new file mode 100644 index 00000000000..22c22d7a376 --- /dev/null +++ b/addons/crm/test/process/lead2_mass_convert_opportunity.yml @@ -0,0 +1,32 @@ +- + Using mass wizard, convert two lead to opportunity. +- + !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}: + user_ids: + - base.user_root + section_id: crm.section_sales_department +- + Leads coverts to mass opportunity. +- + !python {model: crm.lead2opportunity.partner.mass}: | + self.mass_convert(cr, uid, [ref("crm_lead2opportunity_partner_mass0")],{'active_ids': [ref("crm_case_employee0"), ref("crm_case_electonicgoodsdealer0")], 'active_id': ref("crm_case_qrecorp0")}) +- + First lead converted on opportunity.i test it. +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_employee0')) + assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' + assert lead.planned_revenue == 0.0, 'Planned revenue should be 0!' + assert lead.probability == 0.0, 'probability revenue should be 0!' + assert lead.partner_id.name == "Agrolait", 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' +- + Second lead converted on opportunity.i test it. +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_electonicgoodsdealer0')) + assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' + assert lead.planned_revenue == 0.0, 'Planned revenue should be 0!' + assert lead.probability == 0.0, 'probability revenue should be 0!' + assert lead.partner_id.name == "Le Club SARL", 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' From a589f59ee9822e71020c4da02957852d5a223316 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 11:54:32 +0530 Subject: [PATCH 046/470] [ADD]: crm: Added new yml merge2opportunity.yml 1) Merged two opportunity. 2) Checked Merged opportunity succeed bzr revid: ron@tinyerp.com-20111014062432-gywyd1nevu33wfwy --- addons/crm/__openerp__.py | 1 + addons/crm/test/process/merge2opportunity.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 addons/crm/test/process/merge2opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 508c7dff370..7a30166b46d 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -122,6 +122,7 @@ Creates a dashboard for CRM that includes: 'test/process/lead_open.yml', 'test/process/lead2opportunity.yml', 'test/process/cancel_lead.yml', + 'test/process/merge2opportunity.yml', 'test/process/meeting.yml', 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', diff --git a/addons/crm/test/process/merge2opportunity.yml b/addons/crm/test/process/merge2opportunity.yml new file mode 100644 index 00000000000..2161e191a81 --- /dev/null +++ b/addons/crm/test/process/merge2opportunity.yml @@ -0,0 +1,17 @@ +- + I Merge two Opportunities. +- + !python {model: crm.merge.opportunity}: | + op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) + self.merge(cr, uid, op_ids) + +- + I will test merged two opportunity. +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) + merge = 'Merged opportunities' in lead.message_ids[0].subject + assert merge,'Fail to create Merge opportunity' + assert lead.type == 'opportunity', 'Merged opportunity type not change!' + assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' From 2e897842ff538499e679d424789772124154740f Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 12:50:00 +0530 Subject: [PATCH 047/470] [REM]: crm: 1)Removed test_crm_opportunity.yml, 2)Removed test_crm_lead_case2.yml, 3)Removed test_crm_opportunity_case2.yml bzr revid: ron@tinyerp.com-20111014072000-yl3q15mdimss6fri --- addons/crm/__openerp__.py | 3 - addons/crm/test/test_crm_lead_case2.yml | 151 ------------------ addons/crm/test/test_crm_opportunity.yml | 113 ------------- .../crm/test/test_crm_opportunity_case2.yml | 45 ------ 4 files changed, 312 deletions(-) delete mode 100644 addons/crm/test/test_crm_lead_case2.yml delete mode 100644 addons/crm/test/test_crm_opportunity.yml delete mode 100644 addons/crm/test/test_crm_opportunity_case2.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 7a30166b46d..e3bd172d4e1 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -126,13 +126,10 @@ Creates a dashboard for CRM that includes: 'test/process/meeting.yml', 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', - 'test/test_crm_opportunity.yml', 'test/process/phonecall2opportunity.yml', 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', - 'test/test_crm_lead_case2.yml', - 'test/test_crm_opportunity_case2.yml', 'test/test_crm_phonecall_case2.yml', 'test/test_crm_partner2opportunity.yml', 'test/test_crm_segmentation.yml', diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml deleted file mode 100644 index af1b7e7e07b..00000000000 --- a/addons/crm/test/test_crm_lead_case2.yml +++ /dev/null @@ -1,151 +0,0 @@ -- - In order to do complete test the CRM in OpenERP, - I will create new full configured record and carry test on it. -- | - I Start by creating "Test Sales Team" with No Unlink. - I create a crm.case.section record. -- - !record {model: crm.case.section, id: crm_case_section_demosalesteam}: - code: DEMO - complete_name: Test Sales Team - name: Test Sales Team - allow_unlink: False - member_ids: - - base.user_admin - stage_ids: - - crm.stage_lead1 - - crm.stage_lead2 - - crm.stage_lead3 - - crm.stage_lead4 - - crm.stage_lead5 - - crm.stage_lead6 - working_hours: 0.0 - resource_calendar_id: resource.timesheet_group1 - parent_id: crm.section_sales_department -- - I assign segmentation. -- - !record {model: res.users, id: base.user_root}: - context_section_id: crm_case_section_demosalesteam -- | - I create a new lead "Test Customer" and I provide an address to this - demo customer and email "info@democustomer.com" and Also "Test Sales Team". -- - !record {model: crm.lead, id: crm_lead_democustomer}: - email_from: info@democustomer.com - name: Test Customer - partner_name: NotSoTinySARL - phone: (+32).81.81.37.00 - mobile: (+32).81.81.37.00 - section_id: crm_case_section_demosalesteam - referred: False - type: lead -- - I check that the lead is in 'draft' state. -- - !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}: - - state == "draft" -- - I create categories. -- - !record {model: crm.case.categ, id: crm_case_categ0}: - name: crm_case_section_demosalesteam - section_id: crm_case_section_demosalesteam -- - I assigning contact detail to the Lead "Test Customer" without address. -- - !python {model: crm.lead}: | - self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), None, email=False) - -- - I assigning contact detail to the Lead "Test Customer" with address. -- - !python {model: crm.lead}: | - self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False) - -- - I selecting email "Opt-out" option for the "Test Customer" Lead. -- - !python {model: crm.lead}: | - self.on_change_optout(cr, uid, ref("crm_lead_democustomer"), True) - -- - I change the Opt-out to Opt-in to show email receive preference. -- - !python {model: crm.lead}: | - self.on_change_optin(cr, uid, ref("crm_lead_democustomer"), True) -- - I open lead by click on "Open" button. -- - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref("crm_lead_democustomer")]) -- - I check that lead "Test Customer" is now in 'open' state. -- - !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in open state}: - - state == "open" -- - I reset the lead "Test Customer". -- - !python {model: crm.lead}: | - self.case_reset(cr, uid, [ref("crm_lead_democustomer")]) -- - I again opening lead by click on "Open" button. -- - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref("crm_lead_democustomer")]) -- - I setting stage "New" for the lead "Test Customer". -- - !python {model: crm.lead}: | - self.stage_next(cr, uid, [ref("crm_lead_democustomer")], context={'stage_type': 'lead'}) -- - I try to Unlink the Lead "Test Customer" demo Lead. -- - !python {model: crm.lead}: | - try: - self.unlink(cr, uid, [ref("crm_lead_democustomer")]) - except: - pass -- - I setting Lead "Test Customer" to Pending State. -- - !python {model: crm.lead}: | - self.case_pending(cr, uid, [ref("crm_lead_democustomer")]) -- - I check that lead "Test Customer" is now in 'Pending' state. -- - !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Pending state}: - - state == "pending" -- - I Escalate the Lead "Test Customer" Parent "Sales Team". -- - !python {model: crm.lead}: | - self.case_escalate(cr, uid, [ref("crm_lead_democustomer")]) -- - I add Internal Note Saying Escalated Reason. -- - !record {model: crm.add.note, id: crm_add_note_0}: - body: Sales Lead Has Been Escalated Due to Some Technical reason to the parent 'Sales - Team' - state: unchanged -- - I click a note button to attach the record. -- - !python {model: crm.add.note}: | - context['active_model'] = "crm.lead" - context['active_ids'] = [ref("crm_lead_democustomer")] - self.action_add(cr, uid, [ref("crm_add_note_0")], context=context) - -- - I Copying this lead "Test Customer" to New Lead. -- - !python {model: crm.lead}: | - self.copy(cr, uid, ref("crm_lead_democustomer")) -- - I checking the Lead Copied or Not. -- - !python {model: crm.lead}: | - sid = self.search(cr, uid, [('name', '=', 'Test Customer'),('state', '=', 'draft')]) - if not sid: - raise AssertionError("Lead is not copied Successfully") diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml deleted file mode 100644 index 8f171311b4d..00000000000 --- a/addons/crm/test/test_crm_opportunity.yml +++ /dev/null @@ -1,113 +0,0 @@ -- | - I start by creating a new Opportunity. And I select partner for opportunity. - I can see that after selecting partner his contact and email is automatically filled. -- - !record {model: crm.lead, id: crm_opportunity_abcfuelcounits0}: - email_from: info@balmerinc.be - name: 'ABC FUEL CO 829264 - 10002 units' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - probability: 1.0 - stage_id: crm.stage_lead1 - categ_id: crm.categ_oppor2 - section_id: crm.section_sales_department -- | - I check that the opportunity is in 'New' state. -- - !assert {model: crm.lead, id: crm_opportunity_abcfuelcounits0}: - - state == "draft" - -- | - I check that phonecall record is created for that opportunity. -- - !python {model: crm.phonecall}: | - phone_obj = self.pool.get('crm.phonecall') -- | - I schedule Meeting on this current opportunity by clicking on "schedule - Meeting". -- - !python {model: crm.lead}: | - self.action_makeMeeting(cr, uid, [ref("crm_opportunity_abcfuelcounits0")]) - -- | - I can see that Meeting's calendar view is shown. - then I click on the date on which I want to schedule meeting. - I fill proper data for that meeting and save it. -- - !record {model: crm.meeting, id: crm_meeting_abcfuelcounits0}: - date: !eval time.strftime('%Y-%m-%d 00:00:00') - date_deadline: !eval time.strftime('%Y-%m-%d 08:00:00') - duration: 8.0 - email_from: info@balmerinc.be - name: 'ABC FUEL CO 829264 - 10002 units' - opportunity_id: 'crm_opportunity_abcfuelcounits0' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - section_id: crm.section_sales_department - state: open -- | - In order to schedule a phonecall to the partner - I click on "schedule call" button and select planned date for the call. -- - !record {model: crm.opportunity2phonecall, id: crm_opportunity2phonecall_abcfuelcounits0}: - date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')" - name: 'ABC FUEL CO 829264 - 10002 units' - section_id: crm.section_sales_department - user_id: base.user_demo - categ_id: crm.categ_phone1 -- | - schedule phonecall by opportunity2phoncall wizard. -- - !python {model: crm.opportunity2phonecall}: | - self.action_apply(cr, uid, [ref('crm_opportunity2phonecall_abcfuelcounits0')], {'active_ids': [ref("crm_opportunity_abcfuelcounits0")]}) -- | - I check that phonecall record is created for that opportunity. -- - !python {model: crm.phonecall}: | - phone_obj = self.pool.get('crm.phonecall') - ids = phone_obj.search(cr, uid, [('name', '=', 'ABC FUEL CO 829264 - 10002 units')]) - assert len(ids) -- | - I can see phonecall record after click on "Schedule call" wizard. -- - !record {model: crm.phonecall, id: crm_phonecall_abcfuelcounits0}: - date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')" - duration: 3.0 - name: 'ABC FUEL CO 829264 - 10002 units' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - section_id: crm.section_sales_department -- | - I Merge the opportunities. -- - for that create two opportunities first opportunity 'Test FUEL CO'. -- - !record {model: crm.lead, id: crm_opportunity_1}: - email_from: info@balmerinc.be - name: 'Test FUEL CO 829264 - 10002 units' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - probability: 1.0 - stage_id: crm.stage_lead1 - categ_id: crm.categ_oppor2 - section_id: crm.section_sales_department -- - I create the opportunity 'FUEL CO'. -- - !record {model: crm.lead, id: crm_opportunity_2}: - email_from: info@balmerinc.be - name: 'FUEL CO 829264 - 10002 units' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - probability: 1.0 - stage_id: crm.stage_lead1 - categ_id: crm.categ_oppor2 - section_id: crm.section_sales_department -- | - I Merge two Opportunities. -- - !python {model: crm.merge.opportunity}: | - op_list = [ref('crm_opportunity_1'),ref('crm_opportunity_2')] - op_ids=self.pool.get('crm.lead').browse(cr,uid,op_list) - lead_ids = [ref('crm_case_qrecorp0')] - self.merge(cr, uid, op_ids, {'lead_ids': lead_ids}) diff --git a/addons/crm/test/test_crm_opportunity_case2.yml b/addons/crm/test/test_crm_opportunity_case2.yml deleted file mode 100644 index dc0dbe517f1..00000000000 --- a/addons/crm/test/test_crm_opportunity_case2.yml +++ /dev/null @@ -1,45 +0,0 @@ -- | - I start by creating a new Opportunity. And I select partner for opportunity. - I can see that after selecting partner his contact and email is automatically filled. -- - !record {model: crm.lead, id: crm_opportunity_demotestopportunity}: - email_from: info@balmerinc.be - name: 'Demo Test Opportunity' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - probability: 1.0 - categ_id: crm.categ_oppor2 - section_id: crm.section_sales_department - type: opportunity -- - I check that the opportunity is in 'New' state. -- - !assert {model: crm.lead, id: crm_opportunity_demotestopportunity, string: Opportunity in Draft}: - - state == "draft" -- - I open opportunity by click on "Open" button. -- - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref("crm_opportunity_demotestopportunity")]) -- - I change partner of the opportunity. -- - !python {model: crm.lead}: | - self.onchange_partner_id(cr, uid, [ref("crm_opportunity_demotestopportunity")], ref("base.res_partner_agrolait")) - -- - I change Contact Detail of the opportunity. -- - !python {model: crm.lead}: | - self.onchange_partner_address_id(cr, uid,[ref("crm_opportunity_demotestopportunity")], ref("base.res_partner_address_8invoice")) - -- - I change Opportunity to Won State. -- - !python {model: crm.lead}: | - self.case_mark_won(cr, uid, [ref("crm_opportunity_demotestopportunity")]) -- - I check that the opportunity is in 'Done' state. -- - !assert {model: crm.lead, id: crm_opportunity_demotestopportunity, string: Opportunity is Won}: - - state == "done" From 7ed74f873e9caebbd0de77f099dfb95ba7df95f4 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 14:24:06 +0530 Subject: [PATCH 048/470] [REM, IMP]: crm: 1)Removed merge2opportunity.yml, 2)Merged two Opportunities code moved to lead2opportunity.yml bzr revid: ron@tinyerp.com-20111014085406-fg8javdjiohh6ojh --- addons/crm/__openerp__.py | 1 - addons/crm/test/process/lead2opportunity.yml | 18 ++++++++++++++++++ addons/crm/test/process/merge2opportunity.yml | 17 ----------------- 3 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 addons/crm/test/process/merge2opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index e3bd172d4e1..6d05d3edd3d 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -122,7 +122,6 @@ Creates a dashboard for CRM that includes: 'test/process/lead_open.yml', 'test/process/lead2opportunity.yml', 'test/process/cancel_lead.yml', - 'test/process/merge2opportunity.yml', 'test/process/meeting.yml', 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index 5a9668adfd3..75026ccfb3e 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -40,3 +40,21 @@ - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - probability == 100.0 +- + I have two opportunity ,so i will merge this two Opportunities. +- + !python {model: crm.merge.opportunity}: | + op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) + self.merge(cr, uid, op_ids) + +- + I will test which two opportunity merged . +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) + merge = 'Merged opportunities' in lead.message_ids[0].subject + assert merge,'Fail to create Merge opportunity' + assert lead.type == 'opportunity', 'Merged opportunity type not change!' + assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' + \ No newline at end of file diff --git a/addons/crm/test/process/merge2opportunity.yml b/addons/crm/test/process/merge2opportunity.yml deleted file mode 100644 index 2161e191a81..00000000000 --- a/addons/crm/test/process/merge2opportunity.yml +++ /dev/null @@ -1,17 +0,0 @@ -- - I Merge two Opportunities. -- - !python {model: crm.merge.opportunity}: | - op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) - self.merge(cr, uid, op_ids) - -- - I will test merged two opportunity. -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) - merge = 'Merged opportunities' in lead.message_ids[0].subject - assert merge,'Fail to create Merge opportunity' - assert lead.type == 'opportunity', 'Merged opportunity type not change!' - assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' - assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' From 86e0aa5cc26e643cf04d1c4b6b4b32aaa758bafc Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 14:29:03 +0530 Subject: [PATCH 049/470] [REM]: crm: 1)Removed test_crm_partner2opportunity.yml bzr revid: ron@tinyerp.com-20111014085903-b2i8gk93nuo5ckd5 --- addons/crm/__openerp__.py | 1 - .../crm/test/test_crm_partner2opportunity.yml | 25 ------------------- 2 files changed, 26 deletions(-) delete mode 100644 addons/crm/test/test_crm_partner2opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 6d05d3edd3d..58342283bbc 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -130,7 +130,6 @@ Creates a dashboard for CRM that includes: 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', 'test/test_crm_phonecall_case2.yml', - 'test/test_crm_partner2opportunity.yml', 'test/test_crm_segmentation.yml', ], 'installable': True, diff --git a/addons/crm/test/test_crm_partner2opportunity.yml b/addons/crm/test/test_crm_partner2opportunity.yml deleted file mode 100644 index fe026074f4f..00000000000 --- a/addons/crm/test/test_crm_partner2opportunity.yml +++ /dev/null @@ -1,25 +0,0 @@ -- | - I start by creating a new opportunity from partner. -- - !record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}: - name: test - planned_revenue: 0.0 - partner_id: base.res_partner_9 - probability: 0.0 -- - I click on "Create Opportunity" button of this wizard. -- - !python {model: crm.partner2opportunity}: | - fields = { - 'name': 'test', - 'planned_revenue': '0.0', - 'partner_id': ref('base.res_partner_9'), - 'probability': '0.0' - } - self.default_get(cr, uid, fields, {"active_ids": [ref("crm_partner2opportunity_id_0")]}) -- | - In order to check the opportunity is created or not, I check type. -- - !python {model: crm.partner2opportunity}: | - opportunity = self.make_opportunity(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]}) - assert True From daeeef945d05e9b7a60c22f9e127f53f9c1f6314 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 14:36:23 +0530 Subject: [PATCH 050/470] [REM]: crm: 1)Removed test_crm_phonecall_case2.yml 2) Updated __opeperp__.py bzr revid: ron@tinyerp.com-20111014090623-jf5atbxze6e9w8iv --- addons/crm/__openerp__.py | 1 - addons/crm/test/test_crm_phonecall_case2.yml | 26 -------------------- 2 files changed, 27 deletions(-) delete mode 100644 addons/crm/test/test_crm_phonecall_case2.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 58342283bbc..a4416ca8add 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -129,7 +129,6 @@ Creates a dashboard for CRM that includes: 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', - 'test/test_crm_phonecall_case2.yml', 'test/test_crm_segmentation.yml', ], 'installable': True, diff --git a/addons/crm/test/test_crm_phonecall_case2.yml b/addons/crm/test/test_crm_phonecall_case2.yml deleted file mode 100644 index 1b07121183c..00000000000 --- a/addons/crm/test/test_crm_phonecall_case2.yml +++ /dev/null @@ -1,26 +0,0 @@ -- | - I start by creating a new phonecall. -- - !record {model: crm.phonecall, id: crm_phonecall_dummycall}: - date: !eval time.strftime('%Y-%m-%d 08:00:00') - name: Dummy call - duration: 0.0 - section_id: crm.section_sales_department - partner_id: base.res_partner_agrolait - state: open -- - I change Contact Detail of the Partner. -- - !python {model: crm.phonecall}: | - self.onchange_partner_address_id(cr, uid,[ref("crm_phonecall_dummycall")], ref("base.res_partner_address_8invoice")) - -- - I setting Phone call to Held (Done). -- - !python {model: crm.phonecall}: | - self.case_close(cr, uid, [ref("crm_phonecall_dummycall")]) -- - I check that the hone call is in 'Held' state. -- - !assert {model: crm.phonecall, id: crm_phonecall_dummycall, string: Phone call Helded}: - - state == "done" From ff842dde4de206ac504120c59d6e9c3ae385b535 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 15:06:28 +0530 Subject: [PATCH 051/470] [IMP]: crm: 1)All changes done in lead2opportunity.yml 2) Added scenario of when opportunity has been lost bzr revid: ron@tinyerp.com-20111014093628-j3o0m4ji3javmapb --- addons/crm/test/process/lead2opportunity.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index 75026ccfb3e..108a0a74dbf 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -36,10 +36,24 @@ !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: - stage_id.name == "Won" - - After won the opportunity, i will test probability is 100. + After winning the opportunity, i will test probability is 100. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - probability == 100.0 +- + Suppose i have opportinity in initial stage, i will check after loss my `opportunity` , probability of that opportunity is 0 +- + !python {model: crm.lead}: | + self.case_open(cr, uid, [ref("crm_case_rdroundfundingunits0")]) + self.case_mark_lost(cr, uid, [ref("crm_case_rdroundfundingunits0")]) +- + I check after loss the opportunity, probability set to 0.0 and lost stage set accordingly. +- + !python {model: crm.lead}: | + opportunity = self.browse(cr, uid, ref('crm_case_rdroundfundingunits0')) + assert opportunity.stage_id.id == ref('crm.stage_lead6'), 'Stage is not changed!' + assert opportunity.probability == 0.0, 'Probability is wrong!' + - I have two opportunity ,so i will merge this two Opportunities. - From 81c8f80edc17b6a8f904d5124d42e5fb454defd1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 15:12:57 +0530 Subject: [PATCH 052/470] [REM]: crm: Removed test_crm_stage_changes.yml bzr revid: ron@tinyerp.com-20111014094257-qmch5458436ibis4 --- addons/crm/__openerp__.py | 1 - addons/crm/test/test_crm_stage_changes.yml | 96 ---------------------- 2 files changed, 97 deletions(-) delete mode 100644 addons/crm/test/test_crm_stage_changes.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index a4416ca8add..fdd841c2534 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -127,7 +127,6 @@ Creates a dashboard for CRM that includes: 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', 'test/test_crm_recurrent_meeting.yml', - 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', 'test/test_crm_segmentation.yml', ], diff --git a/addons/crm/test/test_crm_stage_changes.yml b/addons/crm/test/test_crm_stage_changes.yml deleted file mode 100644 index 391a328bffe..00000000000 --- a/addons/crm/test/test_crm_stage_changes.yml +++ /dev/null @@ -1,96 +0,0 @@ -- - In order to test the changes on stage of a lead or an opportunity with OpenERP, - I create some leads and test the stage changes. -- - I want to change the probability to 0.0 when the opportunity is marked as lost. - So I set its Change probability automatically true. -- - !record {model: crm.case.stage, id: crm.stage_lead6}: - name: Lost - on_change: true - probability: 0.0 - section_ids: - - crm.section_sales_department - sequence: 0 -- - I create a lead 'Test Lead1'. -- - !record {model: crm.lead, id: crm_lead_openerppresentation0}: - categ_id: crm.categ_oppor4 - day_close: 0.0 - day_open: 0.0 - name: Test Lead1 - planned_revenue: 0.0 - probability: 10.0 - section_id: crm.section_sales_department -- - I open the lead. -- - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref('crm_lead_openerppresentation0')]) -- - I assigning stage. -- - !python {model: crm.lead}: | - self.onchange_stage_id(cr, uid, [ref('crm_lead_openerppresentation0')], [], context) -- - I assigning percent. -- - !python {model: crm.lead}: | - self.stage_find_percent(cr, uid, 10.0, []) -- - I find that this lead can be converted to opportunity. -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner0}: - action: 'create' - name: 'convert' -- - So I convert the lead to opportunity. -- - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref('crm_lead2opportunity_partner0')], context={'active_ids': [ref('crm_lead_openerppresentation0')]}) -- - I check that lead is now converted to opportunity. -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_lead_openerppresentation0')) - assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' -- - I mark this opportunity as lost. -- - !python {model: crm.lead}: | - self.case_mark_lost(cr, uid, [ref('crm_lead_openerppresentation0')]) -- - I check whether the probability is set according to stage change or not. -- - !python {model: crm.lead}: | - opportunity = self.browse(cr, uid, ref('crm_lead_openerppresentation0')) - assert opportunity.stage_id.id == ref('crm.stage_lead6'), 'Stage is not changed!' - assert opportunity.probability == 0.0, 'Probability is wrong!' -- - I create one more opportunity. -- - !record {model: crm.lead, id: crm_lead_test2}: - name: Partner Demo - type: opportunity - categ_id: crm.categ_oppor3 - planned_revenue: 50000.0 - probability: 100.0 - section_id: crm.section_sales_department -- - I open this opportunity. -- - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref('crm_lead_test2')]) -- - I mark this opportunity as won. -- - !python {model: crm.lead}: | - self.case_mark_won(cr, uid, [ref('crm_lead_test2')]) -- - I check whether the stage is changed to 'Won' and probability is 100.0 or not. -- - !python {model: crm.lead}: | - opportunity = self.browse(cr, uid, ref('crm_lead_test2')) - assert opportunity.stage_id.id == ref('crm.stage_lead5'), 'Stage is not changed!' - assert opportunity.probability == 100.0, 'Probability is wrong!' From 7c8c006beb6fe137035edaa933b85a8903b02bca Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 16:17:29 +0530 Subject: [PATCH 053/470] [IMP]: crm: Added internal note after wining the opportunity in lead2opportunity.yml bzr revid: ron@tinyerp.com-20111014104729-1la21n3mxpzb0qz7 --- addons/crm/test/process/lead2opportunity.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index 108a0a74dbf..bb6ecef5327 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -35,6 +35,23 @@ - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: - stage_id.name == "Won" +- + I want to add internal note to this opportunity, so i create note. +- + !record {model: crm.add.note, id: crm_add_note_won_opportunity}: + body: 'I won this Opportunity' +- + Apply this note to opportunity. +- + !python {model: crm.add.note}: | + self.action_add(cr, uid, [ref("crm_add_note_won_opportunity")], {"active_model": "crm.lead","active_ids": [ref("crm_case_qrecorp0")]}) +- + I will test Internal note added on opportunity . +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) + message = 'I won this Opportunity' in lead.message_ids[-1].subject + assert message,'Fail to Added interal note on opportunity' - After winning the opportunity, i will test probability is 100. - From f1c236c3aed7732a685e03a7c042f72b6b839641 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 16:22:56 +0530 Subject: [PATCH 054/470] [REF]: crm: Removed code of cheking probability and planned_revenue in lead2opportunity.yml bzr revid: ron@tinyerp.com-20111014105256-anhbcrgqvtpgm1n6 --- addons/crm/test/process/lead2opportunity.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index bb6ecef5327..b09ed397fe0 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -16,8 +16,6 @@ !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' - assert lead.planned_revenue == 0.0, 'Planned revenue should be 0!' - assert lead.probability == 0.0, 'probability revenue should be 0!' assert lead.partner_id.id == ref("base.res_partner_agrolait"), 'Partner missmatch!' assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' - From 12c7d62a53f1b561f105900ff7cc810473eae0c7 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 16:45:44 +0530 Subject: [PATCH 055/470] [REM]: crm: Removed test_crm_recurrent_meeting.yml because its have only demo data created bzr revid: ron@tinyerp.com-20111014111544-shi3hshjja7yxpw5 --- addons/crm/__openerp__.py | 1 - .../crm/test/test_crm_recurrent_meeting.yml | 106 ------------------ 2 files changed, 107 deletions(-) delete mode 100644 addons/crm/test/test_crm_recurrent_meeting.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index fdd841c2534..2ad30af3c85 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -126,7 +126,6 @@ Creates a dashboard for CRM that includes: 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', - 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_recurrent_meeting_case2.yml', 'test/test_crm_segmentation.yml', ], diff --git a/addons/crm/test/test_crm_recurrent_meeting.yml b/addons/crm/test/test_crm_recurrent_meeting.yml deleted file mode 100644 index 297ca8d5e4e..00000000000 --- a/addons/crm/test/test_crm_recurrent_meeting.yml +++ /dev/null @@ -1,106 +0,0 @@ -- - In order to test recurrent meetings in OpenERP, I create meetings with different recurrency. -- - I create a customer meeting record with daily recurrency. -- - !record {model: crm.meeting, id: crm_meeting_pricelistdiscussion0}: - categ_id: crm.categ_meet1 - count: 0.0 - date: '2011-01-05 00:00:00' - date_deadline: '2011-01-05 01:00:00' - day: 0.0 - duration: 1.0 - end_date: '2011-01-12' - end_type: end_date - name: Pricelist Discussion - recurrency: true - recurrent_uid: 0.0 - rrule: FREQ=DAILY;INTERVAL=1;UNTIL=20110112T235959Z - rrule_type: daily - sequence: 0.0 -- - I create another meeting record with weekly recurrency. -- - !record {model: crm.meeting, id: crm_meeting_changesindesigning0}: - categ_id: crm.categ_meet2 - count: 15 - date: '2011-01-22 11:05:05' - date_deadline: '2011-01-22 16:05:05' - day: 0.0 - duration: 5.0 - email_from: info@opensides.be - end_type: count - fr: true - mo: true - name: Changes in Designing - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - recurrency: true - recurrent_uid: 0.0 - rrule: FREQ=WEEKLY;BYDAY=FR,TU,TH,WE,MO;INTERVAL=1;COUNT=15 - rrule_type: weekly - section_id: crm.section_sales_department - sequence: 0.0 - th: true - tu: true - user_id: base.user_demo - we: true -- - I create a meeting record with monthly recurrency. -- - !record {model: crm.meeting, id: crm_meeting_reviewneeds0}: - categ_id: crm.categ_meet3 - count: 0.0 - date: '2011-01-20 10:02:02' - date_deadline: '2011-01-20 16:02:02' - day: 15 - duration: 6.0 - end_date: '2011-05-31' - end_type: end_date - name: Review needs - partner_address_id: base.res_partner_address_15 - partner_id: base.res_partner_11 - recurrency: true - recurrent_uid: 0.0 - rrule: FREQ=MONTHLY;INTERVAL=1;UNTIL=20110531T235959Z;BYMONTHDAY=15 - rrule_type: monthly - section_id: crm.section_sales_department - sequence: 0.0 - user_id: base.user_demo -- - I create a record for daily scrum meeting. -- - !record {model: crm.meeting, id: crm_meeting_scrummeeting0}: - categ_id: crm.categ_meet2 - count: 0.0 - date: '2011-01-06 00:00:00' - date_deadline: '2011-01-06 01:00:00' - day: 0.0 - duration: 1.0 - name: Scrum meeting - recurrency: true - recurrent_uid: 0.0 - rrule: FREQ=DAILY;INTERVAL=1 - rrule_type: daily - sequence: 0.0 -- - I create a meeting record for yearly recurrency. -- - !record {model: crm.meeting, id: crm_meeting_updatethedata0}: - categ_id: crm.categ_meet2 - count: 0.0 - date: '2011-01-18 13:12:49' - date_deadline: '2011-01-19 02:30:49' - day: 0.0 - duration: 13.300000000000001 - end_date: '2015-01-06' - end_type: end_date - name: Update the data - partner_address_id: base.res_partner_address_7 - partner_id: base.res_partner_4 - recurrency: true - recurrent_uid: 0.0 - rrule: FREQ=YEARLY;INTERVAL=1;UNTIL=20150106T235959Z - rrule_type: yearly - section_id: crm.section_sales_department - sequence: 0.0 From 0625ab16fc4f46e70b226f908e1064a79e15804f Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 17:26:12 +0530 Subject: [PATCH 056/470] [REF, MV]: Todo code in lead2opportunity.yml and move test_crm_segmentation.yml to crm_profile bzr revid: ron@tinyerp.com-20111014115612-wze2p8dcnh6gvopg --- addons/crm/__openerp__.py | 1 - addons/crm/test/process/lead2opportunity.yml | 17 +++++++++-------- addons/crm_profiling/__openerp__.py | 3 ++- .../test/test_crm_segmentation.yml | 0 4 files changed, 11 insertions(+), 10 deletions(-) rename addons/{crm => crm_profiling}/test/test_crm_segmentation.yml (100%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 2ad30af3c85..9c45d9237b6 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -127,7 +127,6 @@ Creates a dashboard for CRM that includes: 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', 'test/test_crm_recurrent_meeting_case2.yml', - 'test/test_crm_segmentation.yml', ], 'installable': True, 'active': False, diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index b09ed397fe0..ef8d20fc602 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -34,7 +34,7 @@ !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: - stage_id.name == "Won" - - I want to add internal note to this opportunity, so i create note. + I add internal note to this opportunity, so i create note. - !record {model: crm.add.note, id: crm_add_note_won_opportunity}: body: 'I won this Opportunity' @@ -43,13 +43,14 @@ - !python {model: crm.add.note}: | self.action_add(cr, uid, [ref("crm_add_note_won_opportunity")], {"active_model": "crm.lead","active_ids": [ref("crm_case_qrecorp0")]}) -- - I will test Internal note added on opportunity . -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) - message = 'I won this Opportunity' in lead.message_ids[-1].subject - assert message,'Fail to Added interal note on opportunity' + +# TODO: cheked For ordering of history of message +#- +# I test Internal latest note added on opportunity . +#- +# !python {model: crm.lead}: | +# lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) +# assert lead.message_ids[0].subject == 'I won this Opportunity', 'Fail to Added interal note on opportunity' - After winning the opportunity, i will test probability is 100. - diff --git a/addons/crm_profiling/__openerp__.py b/addons/crm_profiling/__openerp__.py index 656f8360f0b..71b4e2f126e 100644 --- a/addons/crm_profiling/__openerp__.py +++ b/addons/crm_profiling/__openerp__.py @@ -41,7 +41,8 @@ It also has been merged with the earlier CRM & SRM segmentation tool because the 'init_xml': [], 'update_xml': ['security/ir.model.access.csv', 'crm_profiling_view.xml'], 'demo_xml': ['crm_profiling_demo.xml'], - 'test': ['test/test_crm_profiling.yml'], + 'test': ['test/test_crm_profiling.yml', + 'test/test_crm_segmentation.yml',], 'installable': True, 'active': False, 'certificate': '0033984979005', diff --git a/addons/crm/test/test_crm_segmentation.yml b/addons/crm_profiling/test/test_crm_segmentation.yml similarity index 100% rename from addons/crm/test/test_crm_segmentation.yml rename to addons/crm_profiling/test/test_crm_segmentation.yml From c656f53e81f7940bfd7cfc80d62d667ed5d57de0 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 15:16:17 +0530 Subject: [PATCH 057/470] [ADD] crm: 1) Added yml partner2opportunity.yml, 2) Covered partner to opportunity scenario bzr revid: ron@tinyerp.com-20111017094617-9ctr8c7liedjo2fh --- addons/crm/__openerp__.py | 1 + .../crm/test/process/partner2opportunity.yml | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 addons/crm/test/process/partner2opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 9c45d9237b6..b1fdfd3ff62 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -121,6 +121,7 @@ Creates a dashboard for CRM that includes: 'test': [ 'test/process/lead_open.yml', 'test/process/lead2opportunity.yml', + 'test/process/partner2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', 'test/process/lead2_mass_convert_opportunity.yml', diff --git a/addons/crm/test/process/partner2opportunity.yml b/addons/crm/test/process/partner2opportunity.yml new file mode 100644 index 00000000000..542056f0f9b --- /dev/null +++ b/addons/crm/test/process/partner2opportunity.yml @@ -0,0 +1,20 @@ +- | + I will create opportunity by partner. +- + !record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}: + name: BalmerInc S.A. + planned_revenue: 200.0 + partner_id: base.res_partner_9 + probability: 150.0 + +- + Convert partner to opportunity, i will test to convert opportunity is correct. +- + !python {model: crm.partner2opportunity}: | + opportunity = self.make_opportunity(cr, uid, [ref("crm_partner2opportunity_id_0")]) + opportunity_rec = self.pool.get('crm.lead').browse(cr, uid, opportunity['res_id']) + assert opportunity_rec.type == 'opportunity', 'Lead is not converted to opportunity!' + assert opportunity_rec.planned_revenue == 200.0, 'Planned revenue should be 200!' + assert opportunity_rec.probability == 150.0, 'probability revenue should be 150!' + assert opportunity_rec.partner_id.id == ref("base.res_partner_9"), 'Partner missmatch!' + assert opportunity_rec.state == 'draft', 'Opportunity stage not in draft state' From b147d8a4c113530430d1e8ae77d89209ec8a3952 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 15:19:55 +0530 Subject: [PATCH 058/470] [ADD] crm: Added phonecall2meeting.yml bzr revid: ron@tinyerp.com-20111017094955-dgeazzmitmq3jf4v --- addons/crm/__openerp__.py | 1 + addons/crm/test/process/phonecall2meeting.yml | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 addons/crm/test/process/phonecall2meeting.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index b1fdfd3ff62..853c9f85568 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -127,6 +127,7 @@ Creates a dashboard for CRM that includes: 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', + 'test/process/phonecall2meeting.yml', 'test/test_crm_recurrent_meeting_case2.yml', ], 'installable': True, diff --git a/addons/crm/test/process/phonecall2meeting.yml b/addons/crm/test/process/phonecall2meeting.yml new file mode 100644 index 00000000000..c0579157494 --- /dev/null +++ b/addons/crm/test/process/phonecall2meeting.yml @@ -0,0 +1,6 @@ +- + I test to arrage meeting from Phonecall, so i convert and check phonecall to meeting. +- + !python {model: crm.phonecall}: | + res = self.action_make_meeting(cr, uid, [ref('crm_case_phone06')]) + assert res, "No create Meeting from phonecall" From 1fa0e18c2b72f98d202307644338cccbe76ef6c5 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 15:26:01 +0530 Subject: [PATCH 059/470] [MOVE] crm, base_calander: Move test_crm_recurrent_meeting_case2.yml to base_calender bzr revid: ron@tinyerp.com-20111017095601-akmk2nmkn955inbi --- .../test/test_crm_recurrent_meeting_case2.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/{crm => base_calendar}/test/test_crm_recurrent_meeting_case2.yml (100%) diff --git a/addons/crm/test/test_crm_recurrent_meeting_case2.yml b/addons/base_calendar/test/test_crm_recurrent_meeting_case2.yml similarity index 100% rename from addons/crm/test/test_crm_recurrent_meeting_case2.yml rename to addons/base_calendar/test/test_crm_recurrent_meeting_case2.yml From 87727d9b541bd54fbd5bb87681a7d215d4764ea1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 15:28:12 +0530 Subject: [PATCH 060/470] [IMP] crm: delete from __openerp__.py, test_crm_recurrent_meeting_case2.yml bzr revid: ron@tinyerp.com-20111017095812-ybn537b37hap94sg --- addons/crm/__openerp__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 853c9f85568..49fc12f9747 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -128,7 +128,6 @@ Creates a dashboard for CRM that includes: 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', 'test/process/phonecall2meeting.yml', - 'test/test_crm_recurrent_meeting_case2.yml', ], 'installable': True, 'active': False, From dc95f95342cf360e74ae9332cc5b0b52dd045a83 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 16:55:25 +0530 Subject: [PATCH 061/470] [ADD] crm: 1) Added schedule_other_phonecall.yml, 2) checked schedule call created bzr revid: ron@tinyerp.com-20111017112525-8fhqb8iuclh9hdkp --- addons/crm/__openerp__.py | 1 + .../test/process/schedule_other_phonecall.yml | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 addons/crm/test/process/schedule_other_phonecall.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 49fc12f9747..cbcaa774c05 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -128,6 +128,7 @@ Creates a dashboard for CRM that includes: 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', 'test/process/phonecall2meeting.yml', + 'test/process/schedule_other_phonecall.yml' ], 'installable': True, 'active': False, diff --git a/addons/crm/test/process/schedule_other_phonecall.yml b/addons/crm/test/process/schedule_other_phonecall.yml new file mode 100644 index 00000000000..a92496dc265 --- /dev/null +++ b/addons/crm/test/process/schedule_other_phonecall.yml @@ -0,0 +1,23 @@ +- + I schedule phonecall to another phonecall, so first i create record of schedule call. +- + !record {model: crm.phonecall2phonecall, id: crm_schedule_phonecall}: + name: 'Test Discuss Review Process' + categ_id: crm.categ_phone1 + date: !eval time.strftime('%Y-%m-%d') +- + I Convert schedule phonecall. +- + !python {model: crm.phonecall2phonecall}: | + self.action_apply(cr, uid, [ref('crm_schedule_phonecall')], {'active_id': ref('crm_case_phone04')}) +- + I check for another schedule call. +- + !python {model: crm.phonecall}: | + phonecall = self.search(cr, uid, [('name', '=', 'Test Discuss Review Process')]) + assert phonecall, "Do not create another schedule call" + schedule_phonecall = self.browse(cr, uid, phonecall)[0] + assert schedule_phonecall.user_id.id == ref("base.user_root"), "Responsible person not assign" + assert schedule_phonecall.section_id.id == ref("crm.section_sales_department"), "Do not assign proper section" + assert schedule_phonecall.categ_id.id == ref("crm.categ_phone1"), "Category of phonecall is not apply" + assert schedule_phonecall.partner_id.id == ref("base.res_partner_tinyatwork"), "Partner missmatch" \ No newline at end of file From 3f26dce9f8ec2fc80adb1b9d424a734318140af1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 18:06:01 +0530 Subject: [PATCH 062/470] [IMP, REF] crm: 1) Renamed lead2opportunity.yml to lead2opportunity_win_lost.yml, 2) Removed code of Merge2opportunity 3)Improved string bzr revid: ron@tinyerp.com-20111017123601-vnyfiekpupjkxgf1 --- addons/crm/__openerp__.py | 2 +- ...nity.yml => lead2opportunity_win_lost.yml} | 32 ++++--------------- 2 files changed, 7 insertions(+), 27 deletions(-) rename addons/crm/test/process/{lead2opportunity.yml => lead2opportunity_win_lost.yml} (68%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index cbcaa774c05..7b11d12cede 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -120,7 +120,7 @@ Creates a dashboard for CRM that includes: ], 'test': [ 'test/process/lead_open.yml', - 'test/process/lead2opportunity.yml', + 'test/process/lead2opportunity_win_lost.yml', 'test/process/partner2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity_win_lost.yml similarity index 68% rename from addons/crm/test/process/lead2opportunity.yml rename to addons/crm/test/process/lead2opportunity_win_lost.yml index ef8d20fc602..e5103c48ef0 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity_win_lost.yml @@ -1,17 +1,16 @@ - - As the lead seems to be a real business opportunity, I will convert it to a partner - and a business opportunity. + I test to convert lead to real business opportunity, so first i create existing partner attached with lead. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: action: 'exist' partner_id: base.res_partner_agrolait - - Create opportunity based on exiting partner + Create opportunity based on exiting partner. - !python {model: crm.lead2opportunity.partner}: | self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) - - In order to test lead, i will test to lead is converted to opportunity. + After converted in opportunity, i test to lead is converted to opportunity. - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) @@ -19,12 +18,12 @@ assert lead.partner_id.id == ref("base.res_partner_agrolait"), 'Partner missmatch!' assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' - - Finally, i won this opportunity, so i will close this lead. + Finally, i won this opportunity, so i close this opportunity. - !python {model: crm.lead}: | self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) - - In order to test opportunity, it is close or not. + I check lead is close or not. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: - state == "done" @@ -52,7 +51,7 @@ # lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) # assert lead.message_ids[0].subject == 'I won this Opportunity', 'Fail to Added interal note on opportunity' - - After winning the opportunity, i will test probability is 100. + After winning the opportunity, i test probability is 100. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - probability == 100.0 @@ -69,22 +68,3 @@ opportunity = self.browse(cr, uid, ref('crm_case_rdroundfundingunits0')) assert opportunity.stage_id.id == ref('crm.stage_lead6'), 'Stage is not changed!' assert opportunity.probability == 0.0, 'Probability is wrong!' - -- - I have two opportunity ,so i will merge this two Opportunities. -- - !python {model: crm.merge.opportunity}: | - op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) - self.merge(cr, uid, op_ids) - -- - I will test which two opportunity merged . -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) - merge = 'Merged opportunities' in lead.message_ids[0].subject - assert merge,'Fail to create Merge opportunity' - assert lead.type == 'opportunity', 'Merged opportunity type not change!' - assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' - assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' - \ No newline at end of file From 4ffbf5fc8583e04852a69ab4f61b487f6e1e6848 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 18:14:33 +0530 Subject: [PATCH 063/470] [ADD] crm: Added new yml merge_opportunity.yml and also updated __openerp__.py bzr revid: ron@tinyerp.com-20111017124433-21wwyc3yvs4qs2ca --- addons/crm/__openerp__.py | 1 + addons/crm/test/process/merge_opportunity.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 addons/crm/test/process/merge_opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 7b11d12cede..965222976aa 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -121,6 +121,7 @@ Creates a dashboard for CRM that includes: 'test': [ 'test/process/lead_open.yml', 'test/process/lead2opportunity_win_lost.yml', + 'test/process/merge_opportunity.yml', 'test/process/partner2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', diff --git a/addons/crm/test/process/merge_opportunity.yml b/addons/crm/test/process/merge_opportunity.yml new file mode 100644 index 00000000000..2028c304276 --- /dev/null +++ b/addons/crm/test/process/merge_opportunity.yml @@ -0,0 +1,17 @@ +- + I have two opportunity ,so i merge this two Opportunities. +- + !python {model: crm.merge.opportunity}: | + op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) + self.merge(cr, uid, op_ids) + +- + I test which two opportunity has been merged . +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) + merge = 'Merged opportunities' in lead.message_ids[0].subject + assert merge,'Fail to create Merge opportunity' + assert lead.type == 'opportunity', 'Merged opportunity type not change!' + assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' From 845828efe96014453542819003a377882b7a38a5 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 18:22:34 +0530 Subject: [PATCH 064/470] [IMP, REF] crm: 1) Renamed lead2_mass_convert_opportunity.yml to mass_leads2opportunity.yml, 2) Improved string value, 3) Updated __openerp__.py bzr revid: ron@tinyerp.com-20111017125234-6clvbte3zc7l0ivf --- addons/crm/__openerp__.py | 2 +- ...ss_convert_opportunity.yml => mass_leads2opportunity.yml} | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) rename addons/crm/test/process/{lead2_mass_convert_opportunity.yml => mass_leads2opportunity.yml} (90%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 965222976aa..66115e97e30 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -125,7 +125,7 @@ Creates a dashboard for CRM that includes: 'test/process/partner2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', - 'test/process/lead2_mass_convert_opportunity.yml', + 'test/process/mass_leads2opportunity.yml', 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', 'test/process/phonecall2meeting.yml', diff --git a/addons/crm/test/process/lead2_mass_convert_opportunity.yml b/addons/crm/test/process/mass_leads2opportunity.yml similarity index 90% rename from addons/crm/test/process/lead2_mass_convert_opportunity.yml rename to addons/crm/test/process/mass_leads2opportunity.yml index 22c22d7a376..4286eac1848 100644 --- a/addons/crm/test/process/lead2_mass_convert_opportunity.yml +++ b/addons/crm/test/process/mass_leads2opportunity.yml @@ -1,12 +1,13 @@ - - Using mass wizard, convert two lead to opportunity. + Using mass wizard convert two lead to opportunity ,so first i create mass record for + converting in opportunity. - !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}: user_ids: - base.user_root section_id: crm.section_sales_department - - Leads coverts to mass opportunity. + Convert mass Leads to opportunity. - !python {model: crm.lead2opportunity.partner.mass}: | self.mass_convert(cr, uid, [ref("crm_lead2opportunity_partner_mass0")],{'active_ids': [ref("crm_case_employee0"), ref("crm_case_electonicgoodsdealer0")], 'active_id': ref("crm_case_qrecorp0")}) From d756ccfb55bf349096029c6b7bf2fed094f6f99f Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 18:36:51 +0530 Subject: [PATCH 065/470] [IMP, REF] crm: 1) Renamed lead_open.yml to draft2open_lead.yml, 2) Improved string value, 3) Updated __openerp__.py bzr revid: ron@tinyerp.com-20111017130651-kbsl9j33jui7at98 --- addons/crm/__openerp__.py | 2 +- .../crm/test/process/{lead_open.yml => draft2open_lead.yml} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename addons/crm/test/process/{lead_open.yml => draft2open_lead.yml} (54%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 66115e97e30..b7d4332d319 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -119,7 +119,7 @@ Creates a dashboard for CRM that includes: 'crm_phonecall_demo.xml', ], 'test': [ - 'test/process/lead_open.yml', + 'test/process/draft2open_lead.yml', 'test/process/lead2opportunity_win_lost.yml', 'test/process/merge_opportunity.yml', 'test/process/partner2opportunity.yml', diff --git a/addons/crm/test/process/lead_open.yml b/addons/crm/test/process/draft2open_lead.yml similarity index 54% rename from addons/crm/test/process/lead_open.yml rename to addons/crm/test/process/draft2open_lead.yml index d5c6bb2d101..97947b5846b 100644 --- a/addons/crm/test/process/lead_open.yml +++ b/addons/crm/test/process/draft2open_lead.yml @@ -1,10 +1,10 @@ - - Communication by phonecall or mail I got lead from Customer/partner, I test to created lead in initial stage. + I got lead from Customer, I open this lead. - !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_case_qrecorp0")]) - | - In order to test lead, i will test lead is in open stage. + In order to test lead, i test lead is in open stage. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}: - state == "open" From a5e50a5a272bcadd8b4d092152113cd8486b99c5 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 10:30:09 +0530 Subject: [PATCH 066/470] [IMP] crm: Improved string on cancel_lead.yml bzr revid: ron@tinyerp.com-20111018050009-drdg39ws1w9gnj5d --- addons/crm/test/process/cancel_lead.yml | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/crm/test/process/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index 3a3366c05e4..abd966b5e9d 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -1,45 +1,45 @@ - - Cheking for lead from draft to cancel, I will cancelling this lead. + Cheking for lead from draft to cancel, I cancel this lead. - !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for cancel lead , i will test lead is on cancel state. + I test lead is on cancel state. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: - state == "cancel" - - Cheking for lead from cancel to reset, I will reseting this lead. + Checking for lead from cancel to reset, I reset this lead. - !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for reset lead , i will test lead is on draft state. + I test lead is on draft state. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in draft state}: - state == "draft" - - Cheking for lead from reset to pending, I will pending this lead. + Cheking for lead from reset to pending, I pending this lead. - !python {model: crm.lead}: | self.case_pending(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for pending lead , i will test lead is on pending state. + I test lead is on pending state. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in pending state}: - state == "pending" - - Cheking for lead from pending to cancel, I will cancelling this lead. + Cheking for lead from pending to cancel, I cancel this lead. - !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for cancel lead , i will test lead is on cancel state. + I test lead is on cancel state. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: - state == "cancel" - - For working on parent child relationship, we are creating sales executive department that will be work under + For working on parent child relationship, I create sales executive department that will be work under Sales Department. - !record {model: crm.case.section, id: section_sales_exe_department}: @@ -47,31 +47,31 @@ parent_id: crm.section_sales_department - - If Lead not handle by executive team so its need to Escalate lead from sales executive department to sales department, - for that purpose i Assign sales executive department on lead, after we will be process to escalate lead to sales department + Escalate lead from sales executive department to sales department, + for that purpose i assign sales executive department on lead, + after i will be process to escalate lead to sales department - !record {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0}: section_id: section_sales_exe_department - - Processing on Lead escalate to sales Departemnt, we are checking for lead Escalate to sales Department from Executive + Processing on Lead escalate to sales departemnt, i check for lead escalate to sales Department from Executive department or not. - !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) self.case_escalate(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for escalate lead , i will test lead Escalate from sales Department from Executive - department. + I test lead escalate from sales department from Executive department. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Escalate lead to on sales team from Executive teame}: - section_id.name == "Sales Department" - - Cheking for lead from escalate to cancel, I will cancelling this lead. + Cheking for lead from escalate to cancel, I cancel this lead. - !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for cancel lead , i will test lead is on cancel state. + I test lead is on cancel state. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: - state == "cancel" From d61ea7b209e023681ae1a78cf818a15af8af31a1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 10:32:08 +0530 Subject: [PATCH 067/470] [IMP] crm: removed one string on cancel_lead.yml bzr revid: ron@tinyerp.com-20111018050208-jocyosbhswo08gw5 --- addons/crm/test/process/cancel_lead.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/crm/test/process/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index abd966b5e9d..75afa71c1d9 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -39,8 +39,7 @@ !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: - state == "cancel" - - For working on parent child relationship, I create sales executive department that will be work under - Sales Department. + I create sales executive department that will be work under Sales Department. - !record {model: crm.case.section, id: section_sales_exe_department}: name: "Sales Executive" From f43ab4b01e35945bccd04302d57a4113d76d3939 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 10:37:16 +0530 Subject: [PATCH 068/470] [IMP] crm: Improved string on lead_form.yml(onchange event, copy and unlink the record) bzr revid: ron@tinyerp.com-20111018050716-xn8015acnwwvitb4 --- addons/crm/test/ui/lead_form.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/crm/test/ui/lead_form.yml b/addons/crm/test/ui/lead_form.yml index c6cbbb3fcb2..8cfc96283b0 100644 --- a/addons/crm/test/ui/lead_form.yml +++ b/addons/crm/test/ui/lead_form.yml @@ -1,18 +1,18 @@ - - In order to check for changes on partner, data will be change automatically according to partner, + In order to check for changes on partner, country and phone number change automatically according to partner, - !python {model: crm.lead}: | action = self.onchange_partner_address_id(cr, uid, ref("crm_case_qrecorp0"), ref("base.res_partner_address_notsotinysarl0"), email=False) assert action['value']['country_id'] == 20, "Country name not True" assert action['value']['phone'] == '(+32).81.81.37.00', "phone number is wrong" - - I try to Unlink the Lead I create new record of lead. + I try to Unlink the lead, so I create new record of lead on cancel stage. - !record {model: crm.lead, id: crm_case_new_lead}: name: Openerp Trainning state: cancel - - In order to test unlink lead, i will do unlink this lead + I test copy and unlink this lead. - !python {model: crm.lead}: | self.copy(cr, uid, ref("crm_case_new_lead")) From faea3fa2130fa2cb7f178d986add1606fe580809 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 10:46:39 +0530 Subject: [PATCH 069/470] [IMP] crm: Improved string on lead2opportunity_win_lost.yml bzr revid: ron@tinyerp.com-20111018051639-kdy5pvaqeg3witvr --- addons/crm/test/process/lead2opportunity_win_lost.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/crm/test/process/lead2opportunity_win_lost.yml b/addons/crm/test/process/lead2opportunity_win_lost.yml index e5103c48ef0..eacb919c3eb 100644 --- a/addons/crm/test/process/lead2opportunity_win_lost.yml +++ b/addons/crm/test/process/lead2opportunity_win_lost.yml @@ -16,16 +16,16 @@ lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' assert lead.partner_id.id == ref("base.res_partner_agrolait"), 'Partner missmatch!' - assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' + assert lead.stage_id.id == ref("stage_lead1"), 'Stage of opportunity is incorrect!' - Finally, i won this opportunity, so i close this opportunity. - !python {model: crm.lead}: | self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) - - I check lead is close or not. + I check opportunity is close or not. - - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Opportunity in done state}: - state == "done" - In order to test stage of opportunity after win, i will test stage of opportunity. From a1ab9fdfe6aca1faba3a0919ca2014eb4eaf6fa1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 11:00:37 +0530 Subject: [PATCH 070/470] [IMP] crm: Improved string on phonecall2opportunity.yml bzr revid: ron@tinyerp.com-20111018053037-u9s24ffbjusg8cfj --- .../crm/test/process/phonecall2opportunity.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/crm/test/process/phonecall2opportunity.yml b/addons/crm/test/process/phonecall2opportunity.yml index 2575daf8665..03671d6df3b 100644 --- a/addons/crm/test/process/phonecall2opportunity.yml +++ b/addons/crm/test/process/phonecall2opportunity.yml @@ -1,19 +1,19 @@ -- | - For customer or partner purpose, I called to him/her for discussion about openerp. - As the success of phonecall seems to be a real business opportunity, It will convert - it to opportunity. +- + For customer purpose, I called to him/her for discussion about openerp. + As the success of phonecall seems to be a real business opportunity, so first i + create record of phonecall. - !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_disc_openerp}: name: Discuss Review Process partner_id: base.res_partner_tinyatwork - - Succeed phonecall, it will be convert into on opportunity. + Succeed phonecall, it's convert into on opportunity. - !python {model: crm.phonecall2opportunity}: | self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_case_phone04")}) -- | - For business And I check that the phonecall and the newly created business - opportunity is linked to same partner and also check with phonecall closed and opportunity +- + I check that the phonecall and the newly created business opportunity is + linked to same partner and also check with phonecall closed and opportunity is on intial stage or not. - !python {model: crm.phonecall}: | From 570c0fabc53191d7d7706dc75f70240def1885d7 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 11:15:30 +0530 Subject: [PATCH 071/470] [REN]: crm: 1) Renamed from phonecall2opportunity.yml to phone-call2meeting.yml, 2) Renamed from phonecall2opportunity.yml to phone-call2opportunity.yml, 3) Renamed from schedule_other_phonecall.yml to schedule_other_phone-call.yml, 4) Updated __openerp__.py bzr revid: ron@tinyerp.com-20111018054530-b06brnnspgalkjmb --- addons/crm/__openerp__.py | 6 +++--- .../{phonecall2meeting.yml => phone-call2meeting.yml} | 0 ...phonecall2opportunity.yml => phone-call2opportunity.yml} | 0 ...le_other_phonecall.yml => schedule_other_phone-call.yml} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename addons/crm/test/process/{phonecall2meeting.yml => phone-call2meeting.yml} (100%) rename addons/crm/test/process/{phonecall2opportunity.yml => phone-call2opportunity.yml} (100%) rename addons/crm/test/process/{schedule_other_phonecall.yml => schedule_other_phone-call.yml} (100%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index b7d4332d319..fb2aa8679d4 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -127,9 +127,9 @@ Creates a dashboard for CRM that includes: 'test/process/meeting.yml', 'test/process/mass_leads2opportunity.yml', 'test/ui/lead_form.yml', - 'test/process/phonecall2opportunity.yml', - 'test/process/phonecall2meeting.yml', - 'test/process/schedule_other_phonecall.yml' + 'test/process/phone-call2opportunity.yml', + 'test/process/phone-call2meeting.yml', + 'test/process/schedule_other_phone-call.yml' ], 'installable': True, 'active': False, diff --git a/addons/crm/test/process/phonecall2meeting.yml b/addons/crm/test/process/phone-call2meeting.yml similarity index 100% rename from addons/crm/test/process/phonecall2meeting.yml rename to addons/crm/test/process/phone-call2meeting.yml diff --git a/addons/crm/test/process/phonecall2opportunity.yml b/addons/crm/test/process/phone-call2opportunity.yml similarity index 100% rename from addons/crm/test/process/phonecall2opportunity.yml rename to addons/crm/test/process/phone-call2opportunity.yml diff --git a/addons/crm/test/process/schedule_other_phonecall.yml b/addons/crm/test/process/schedule_other_phone-call.yml similarity index 100% rename from addons/crm/test/process/schedule_other_phonecall.yml rename to addons/crm/test/process/schedule_other_phone-call.yml From cc262bbd1ea9384aa5904b0bd0fc43142c1619ee Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 12:00:30 +0530 Subject: [PATCH 072/470] [ADD, MOVE] crm_claim: 1)Added process directory: crm_claim/test/process, 2) Move and renamed file from crm_claim/test/test_crm_claim.yml => crm_claim/test/process/claim.yml bzr revid: ron@tinyerp.com-20111018063030-4dp0jkjbmpu0csml --- addons/crm_claim/test/{test_crm_claim.yml => process/claim.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/crm_claim/test/{test_crm_claim.yml => process/claim.yml} (100%) diff --git a/addons/crm_claim/test/test_crm_claim.yml b/addons/crm_claim/test/process/claim.yml similarity index 100% rename from addons/crm_claim/test/test_crm_claim.yml rename to addons/crm_claim/test/process/claim.yml From b7641ab3d213426e34cc2fdf7c423f4880aa415b Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 12:43:58 +0530 Subject: [PATCH 073/470] [IMP, REM] crm_claim: All changes done in claim.yml 1) Removed code of onchange_partner_id, onchange_partner_address_id, stage_change 2) Updated code only claim is open to close process 3) updated __openerp__.py bzr revid: ron@tinyerp.com-20111018071358-l5424dpckx7327n1 --- addons/crm_claim/__openerp__.py | 2 +- addons/crm_claim/test/process/claim.yml | 48 ++++++------------------- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/addons/crm_claim/__openerp__.py b/addons/crm_claim/__openerp__.py index ae493c5dac2..2fabcd4b100 100644 --- a/addons/crm_claim/__openerp__.py +++ b/addons/crm_claim/__openerp__.py @@ -48,7 +48,7 @@ automatically new claims based on incoming emails. 'demo_xml': [ 'crm_claim_demo.xml', ], - 'test': ['test/test_crm_claim.yml'], + 'test': ['test/process/claim.yml'], 'installable': True, 'active': False, 'certificate' : '00612027414703404749', diff --git a/addons/crm_claim/test/process/claim.yml b/addons/crm_claim/test/process/claim.yml index 9ee130329a7..b12698797cb 100644 --- a/addons/crm_claim/test/process/claim.yml +++ b/addons/crm_claim/test/process/claim.yml @@ -1,44 +1,18 @@ -- | - I check claims which contain customer claim information about document - related problem, product related problem. -- | - I start by creating new claims for Damaged product as Value Claims with priority High and specify - date of claim at which claim is created. - - !record {model: crm.claim, id: crm_claim_damagedproduct0}: - categ_id: crm_claim.categ_claim2 - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - email_from: info@balmerinc.be - name: 'Damaged product ' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - priority: '2' - section_id: crm.section_sales_department - -- | - I check that the claims is in 'draft' state. + I check claim which contain customer claim information about + product related problem. - - !assert {model: crm.claim, id: crm_claim_damagedproduct0}: - - state == 'draft' -- | - I can change that stage by next button right on it. -- - !python {model: crm.claim}: | - self.stage_next(cr, uid, [ref('crm_claim_damagedproduct0')]) -- | I make this claim as Open. - !python {model: crm.claim}: | - self.case_open(cr, uid, [ref('crm_claim_damagedproduct0')]) -- | - I am changing partner Assigned to the Claim. + self.case_open(cr, uid, [ref('crm_case_claim04')]) + claim = self.browse(cr, uid, ref('crm_case_claim04')) + assert claim.state == "open", "Claim is not in Open state" + assert claim.stage_id.id == ref("crm.stage_lead1"), "Claim is not in New stage" +- + After complete all service from our side i close this claim. - !python {model: crm.claim}: | - self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], []) - self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], ref('base.res_partner_10')) -- | - I am changing partner Address to the Claim. -- - !python {model: crm.claim}: | - self.onchange_partner_address_id(cr, uid, [ref('crm_claim_damagedproduct0')], [], email = False) - + self.case_close(cr, uid, [ref('crm_case_claim04')]) + claim = self.browse(cr, uid, ref('crm_case_claim04')) + assert claim.state == "done", "Claim is not in close state" From 83b5a42efce56ac25f007f476587d554736b49b4 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 15:26:22 +0530 Subject: [PATCH 074/470] [ADD] crm_claim: 1) Added directory =>crm_claim/test/ui, 1) Added file crm_claim/test/ui/claim_form.yml, 2) covered partner_onchange_id and checked data bzr revid: ron@tinyerp.com-20111018095622-ceg2nur0nlt93pjp --- addons/crm_claim/__openerp__.py | 3 ++- addons/crm_claim/test/ui/claim_form.yml | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 addons/crm_claim/test/ui/claim_form.yml diff --git a/addons/crm_claim/__openerp__.py b/addons/crm_claim/__openerp__.py index 2fabcd4b100..8f0aef1bf37 100644 --- a/addons/crm_claim/__openerp__.py +++ b/addons/crm_claim/__openerp__.py @@ -48,7 +48,8 @@ automatically new claims based on incoming emails. 'demo_xml': [ 'crm_claim_demo.xml', ], - 'test': ['test/process/claim.yml'], + 'test': ['test/process/claim.yml', + 'test/ui/claim_form.yml'], 'installable': True, 'active': False, 'certificate' : '00612027414703404749', diff --git a/addons/crm_claim/test/ui/claim_form.yml b/addons/crm_claim/test/ui/claim_form.yml new file mode 100644 index 00000000000..bbf37688ed6 --- /dev/null +++ b/addons/crm_claim/test/ui/claim_form.yml @@ -0,0 +1,8 @@ +- + In order to test for changes on partner, data change automatically according to partner. +- + !python {model: crm.claim}: | + partner_onchange = self.onchange_partner_id(cr, uid, [ref('crm_case_claim04')], ref('base.res_partner_10')) + assert partner_onchange['value']['partner_phone'] == "+33-658-256545" ,"Phone number is wrong" + assert partner_onchange['value']['partner_address_id'] == 20 ,"Address is wrong" + assert partner_onchange['value']['email_from'] == 'l.dupont@tecsas.fr' ,"Email address is wrong" From fe454d5d26707e527f3b2d42c259d62bb2c1e895 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 16:31:39 +0530 Subject: [PATCH 075/470] [ADD, MOVE] crm_helpdesk: 1) added directory =>crm_helpdesk/test/process, 2) renamed file crm_helpdesk/test/test_crm_helpdesk.yml => crm_helpdesk/test/process/help-desk.yml bzr revid: ron@tinyerp.com-20111018110139-i88q4i1nf17t1h4y --- .../test/{test_crm_helpdesk.yml => process/help-desk.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/crm_helpdesk/test/{test_crm_helpdesk.yml => process/help-desk.yml} (100%) diff --git a/addons/crm_helpdesk/test/test_crm_helpdesk.yml b/addons/crm_helpdesk/test/process/help-desk.yml similarity index 100% rename from addons/crm_helpdesk/test/test_crm_helpdesk.yml rename to addons/crm_helpdesk/test/process/help-desk.yml From 7724dda7bb570f5abccbcbf4eaa8bbf65c404eee Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 19 Oct 2011 11:50:35 +0530 Subject: [PATCH 076/470] [IMP] crm_helpdesk: Improved help-desk.yml, first create message manually regarding functional question for helpdesk and test it, open this helpdesk and update that message accordingly, after i complete this helpdesk then close it bzr revid: ron@tinyerp.com-20111019062035-mxa0kdia4tfhxf2w --- addons/crm_helpdesk/__openerp__.py | 2 +- .../crm_helpdesk/test/process/help-desk.yml | 68 ++++--------------- 2 files changed, 15 insertions(+), 55 deletions(-) diff --git a/addons/crm_helpdesk/__openerp__.py b/addons/crm_helpdesk/__openerp__.py index 5124c3c5817..2adf7d26dcc 100644 --- a/addons/crm_helpdesk/__openerp__.py +++ b/addons/crm_helpdesk/__openerp__.py @@ -49,7 +49,7 @@ and categorize your interventions with a channel and a priority level. 'demo_xml': [ 'crm_helpdesk_demo.xml', ], - 'test': ['test/test_crm_helpdesk.yml'], + 'test': ['test/process/help-desk.yml'], 'installable': True, 'active': False, 'certificate' : '00830691522781519309', diff --git a/addons/crm_helpdesk/test/process/help-desk.yml b/addons/crm_helpdesk/test/process/help-desk.yml index eb0a25d2110..687238ab269 100644 --- a/addons/crm_helpdesk/test/process/help-desk.yml +++ b/addons/crm_helpdesk/test/process/help-desk.yml @@ -1,57 +1,17 @@ - - | - I start by creating New helpdesk request regarding some functional questions. - I select Date at which helpdesk request is created. -- - !record {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - email_from: info@balmerinc.be - name: Some functional question. - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - section_id: crm.section_sales_department -- - I create the message. + I start by create helpdesk request regarding some functional questions, + so first create message manually regarding functional question for helpdesk + and test it, open this helpdesk and update that message accordingly, after + i complete this helpdesk then close it. - !python {model: crm.helpdesk}: | - msg = { - 'subject': 'test_email', - 'body_text': 'Testing', - 'from': 'Administrator ', - } - context = None - self.message_new(cr, uid,msg,context) - -- | - I check that the Helpdesk request is in 'Draft' state. -- - !assert {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}: - - state == 'draft' -- | - I make it "Open". -- - !python {model: crm.helpdesk}: | - self.case_open(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')]) -- - Update the created message. -- - !python {model: crm.helpdesk}: | - vals = {} - msg = { - 'subject': 'test_email', - 'body_text': 'Testing', - 'from': 'Administrator ', - 'priority': 'done' - } - context = None - default_act = 'pending' - try: - self.message_update(cr, uid,[ref('crm_helpdesk_somefunctionalquestion0')], msg,context) - except: - pass -- | - After a proper communication for the request via email I make sure that the request is fulfilled and - I close this HelpDesk Request by clicking on "Close" button. -- - !python {model: crm.helpdesk}: | - self.case_close(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')]) + msg = {'subject': 'Functional questions', 'body_text': 'How the CRM working?', 'from': 'admin@openerp.com'} + helpdesk_id = self.message_new(cr, uid, msg, context=None) + data = self.browse(cr, uid ,helpdesk_id) + assert data.name == "Functional questions", "Subject name is incorrect" + assert data.email_from == "admin@openerp.com","Email Id incorrect" + assert data.description == "How the CRM working?", "Description is incorrect" + self.case_open(cr, uid, [helpdesk_id]) + msg = {'subject': 'Email regarding to CRM', 'body_text': 'Details of CRM Documentation', 'from': 'admin@openerp.com'} + self.message_update(cr, uid,[helpdesk_id], msg, default_act = 'pending',context=None) + self.case_close(cr, uid, [helpdesk_id]) \ No newline at end of file From ba3e68b09243cf14006fe3c055e455463099a621 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 19 Oct 2011 12:43:25 +0530 Subject: [PATCH 077/470] [FIX]: crm_partner_assign: Cannot find field body in the following view parts composing the view of object model crm.lead.forward.to.partner bzr revid: ron@tinyerp.com-20111019071325-vwxdwdtmk42bia48 --- .../crm_partner_assign/wizard/crm_forward_to_partner_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml b/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml index 8bdb03cf962..aa2c45ea1c9 100644 --- a/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml +++ b/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml @@ -35,7 +35,7 @@ - +
diff --git a/addons/crm_profiling/test/process/segmentation.yml b/addons/crm_profiling/test/process/segmentation.yml new file mode 100644 index 00000000000..136bdf5e872 --- /dev/null +++ b/addons/crm_profiling/test/process/segmentation.yml @@ -0,0 +1,14 @@ +- + In order to test segmentation process which create specific partner categories criteria.so i start + the process. +- + !python {model: crm.segmentation}: | + self.process_start(cr, uid, [ref("crm_segmentation3")],context) + #Todo: Need to check after segmentation started +- + I continue the segmentation process. +- + !python {model: crm.segmentation}: | + context.update({'start': True}) + self.process_continue(cr, uid, [ref("crm_segmentation3")], context) + #Todo: Need to check After segmentation process completed \ No newline at end of file diff --git a/addons/crm_profiling/test/test_crm_segmentation.yml b/addons/crm_profiling/test/test_crm_segmentation.yml deleted file mode 100644 index 5563f1ce52f..00000000000 --- a/addons/crm_profiling/test/test_crm_segmentation.yml +++ /dev/null @@ -1,38 +0,0 @@ -- | - I will test segmentation which create specific partner categories criteria. -- - I create a new segmentation record. -- - !record {model: crm.segmentation, id: crm_segmentation_id_0}: - categ_id: base.res_partner_category_5 - exclusif: true - name: segment - som_interval: 0.0 - sales_purchase_active : True -- - I start the process. -- - !python {model: crm.segmentation}: | - self.process_start(cr, uid, [ref("crm_segmentation_id_0")],context) -- - I continue the segmentation process. -- - !python {model: crm.segmentation}: | - context.update({'start': True}) - self.process_continue(cr, uid, [ref("crm_segmentation_id_0")], context) -- - I create the segmentation line. -- - !record {model: crm.segmentation.line, id: crm_segmentation_line_id_0}: - expr_name: sale - expr_operator: '>' - expr_value: 1000.0 - name: Rule1 - operator: or - segmentation_id: crm_segmentation_id_0 - -- - I check the Segmentation line record. -- - !python {model: crm.segmentation.line}: | - self.test(cr, uid, [ref("crm_segmentation_line_id_0")],partner_id=0) From c6a71b8dbb7ce461868c45e6ede304893f43ae41 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Fri, 21 Oct 2011 12:31:11 +0530 Subject: [PATCH 087/470] [IMP] crm: clear apis bzr revid: hmo@tinyerp.com-20111021070111-tzgqm0jo3gor9jvm --- addons/crm/crm_lead.py | 326 +++++++++++++++++- addons/crm/crm_lead_view.xml | 2 +- addons/crm/res_partner.py | 23 ++ addons/crm/wizard/crm_lead_to_opportunity.py | 172 ++------- addons/crm/wizard/crm_lead_to_partner.py | 94 +---- addons/crm/wizard/crm_merge_opportunities.py | 204 +---------- .../crm/wizard/crm_partner_to_opportunity.py | 66 +--- 7 files changed, 392 insertions(+), 495 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index b53028c952a..a281ea66c07 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -334,7 +334,331 @@ class crm_lead(crm_case, osv.osv): """ return self.set_priority(cr, uid, ids, '3') - def convert_opportunity(self, cr, uid, ids, context=None): + + def _merge_data(self, cr, uid, ids, oldest, context=None): + # prepare opportunity data into dictionary for merging + opportunities = self.browse(cr, uid, ids, context=context) + def _get_first_not_null(attr): + if hasattr(oldest, attr): + return getattr(oldest, attr) + for opportunity in opportunities: + if hasattr(opportunity, attr): + return getattr(opportunity, attr) + return False + + def _get_first_not_null_id(attr): + res = _get_first_not_null(attr) + return res and res.id or False + + def _concat_all(attr): + return ', '.join([getattr(opportunity, attr) for opportunity in opportunities if hasattr(opportunity, attr)]) + + data = { + 'partner_id': _get_first_not_null_id('partner_id'), # !! + 'title': _get_first_not_null_id('title'), + 'name' : _get_first_not_null('name'), #not lost + 'categ_id' : _get_first_not_null_id('categ_id'), # !! + 'channel_id' : _get_first_not_null_id('channel_id'), # !! + 'city' : _get_first_not_null('city'), # !! + 'company_id' : _get_first_not_null_id('company_id'), #!! + 'contact_name' : _get_first_not_null('contact_name'), #not lost + 'country_id' : _get_first_not_null_id('country_id'), #!! + 'partner_address_id' : _get_first_not_null_id('partner_address_id'), #!! + 'type_id' : _get_first_not_null_id('type_id'), #!! + 'user_id' : _get_first_not_null_id('user_id'), #!! + 'section_id' : _get_first_not_null_id('section_id'), #!! + 'state_id' : _get_first_not_null_id('state_id'), + 'description' : _concat_all('description'), #not lost + 'email' : _get_first_not_null('email'), # !! + 'fax' : _get_first_not_null('fax'), + 'mobile' : _get_first_not_null('mobile'), + 'partner_name' : _get_first_not_null('partner_name'), + 'phone' : _get_first_not_null('phone'), + 'probability' : _get_first_not_null('probability'), + 'planned_revenue' : _get_first_not_null('planned_revenue'), + 'street' : _get_first_not_null('street'), + 'street2' : _get_first_not_null('street2'), + 'zip' : _get_first_not_null('zip'), + 'state' : 'open', + 'create_date' : _get_first_not_null('create_date'), + 'date_action_last': _get_first_not_null('date_action_last'), + 'date_action_next': _get_first_not_null('date_action_next'), + 'email_from' : _get_first_not_null('email_from'), + 'email_cc' : _get_first_not_null('email_cc'), + 'partner_name' : _get_first_not_null('partner_name'), + } + return data + + def _merge_find_oldest(self, cr, uid, ids, context=None): + if context is None: + context = {} + if context.get('convert'): + ids = list(set(ids) - set(context.get('lead_ids', False)) ) + + #search opportunities order by create date + opportunity_ids = lead_obj.search(cr, uid, [('id', 'in', ids)], order='create_date' , context=context) + oldest_id = opportunity_ids[0] + return self.browse(cr, uid, oldest_id, context=context) + + def _merge_notification(self, cr, uid, opportunity_id, opportunities, context=None): + #TOFIX: mail template should be used instead of fix body, subject text + details = [] + merge_message = _('Merged opportunities') + subject = [merge_message] + for opportunity in opportunities: + subject.append(opportunity.name) + details.append(_('%s : %s\n Partner: %s\n Stage: %s\n Section: %s\n Salesman: %s\n Category: %s\n Channel: %s\n Company: %s\n Contact name: %s\n Email: %s\n Phone number: %s\n Fax: %s\n Mobile: %s\n State: %s\n Description: %s\n Probability: %s\n Planned revennue: %s\n Country: %s\n City: %s\n Street: %s\n Street 2: %s\n Zip 2: %s') % (merge_message, opportunity.name, opportunity.partner_id.name or '', + opportunity.stage_id.name or '', + opportunity.section_id.name or '', + opportunity.user_id.name or '', + opportunity.categ_id.name or '', + opportunity.channel_id.name or '', + opportunity.company_id.name or '', + opportunity.contact_name or '', + opportunity.email_from or '', + opportunity.phone or '', + opportunity.fax or '', + opportunity.mobile or '', + opportunity.state_id.name or '', + opportunity.description or '', + opportunity.probability or '', + opportunity.planned_revenue or '', + opportunity.country_id.name or '', + opportunity.city or '', + opportunity.street or '', + opportunity.street2 or '', + opportunity.zip or '', + )) + subject = subject[0] + ", ".join(subject[1:]) + details = "\n\n".join(details) + return self.message_append(cr, uid, [opportunity_id], subject, body_text=details, context=context) + + def _merge_opportunity_history(self, cr, uid, opportunity_id, opportunities, context=None): + message = self.pool.get('mail.message') + for opportunity in opportunities: + for history in opportunity.message_ids: + message.write(cr, uid, history.id, { + 'res_id': opportunity_id, + 'subject' : _("From %s : %s") % (opportunity.name, history.subject) + }, context=context) + + return True + + def _merge_opportunity_attachments(self, cr, uid, opportunity_id, opportunities, context=None): + attachment = self.pool.get('ir.attachment') + + # return attachments of opportunity + def _get_attachments(opportunity_id): + attachment_ids = attachment.search(cr, uid, [('res_model', '=', self._name), ('res_id', '=', opportunity_id)], context=context) + return attachment.browse(cr, uid, attachment_ids, context=context) + + count = 1 + first_attachments = _get_attachments(opportunity_id) + for opportunity in opportunities: + attachments = _get_attachments(opportunity.id) + for first in first_attachments: + for attachment in attachments: + if attachment.name == first.name: + values = dict( + name = "%s (%s)" % (attachment.name, count,), + res_id = opportunity_id, + ) + attachment.write(values) + count+=1 + + return True + + def merge_opportunity(self, cr, uid, ids, context=None): + """ + To merge opportunities + :param ids: list of opportunities ids to merge + """ + if context is None: context = {} + + #TOCHECK: where pass lead_ids in context? + lead_ids = context and context.get('lead_ids', []) or [] + + if len(ids) <= 1: + raise osv.except_osv(_('Warning !'),_('Please select more than one opportunities.')) + + opportunities = self.browse(cr, uid, lead_ids, context=context) + opportunities_list = list(set(ids) - set(opportunities)) + oldest = self._find_oldest_opportunity(cr, uid, ids, context=context) + if opportunities : + first_opportunity = opportunities[0] + tail_opportunities = opportunities_list + else: + first_opportunity = opportunities_list[0] + tail_opportunities = opportunities_list[1:] + + data = self._merge_data(cr, uid, ids, oldest, context=context) + + # merge data into first opportunity + self.write(cr, uid, [first_opportunity.id], data, context=context) + + #copy message and attachements into the first opportunity + self._merge_opportunity_history(cr, uid, first_opportunity.id, tail_opportunities, context=context) + self._merge_opportunity_attachments(cr, uid, first_opportunity.id, tail_opportunities, context=context) + + #Notification about loss of information + self._merge_notification(cr, uid, first_opportunity, opportunities, context=context) + #delete tail opportunities + self.unlink(cr, uid, [x.id for x in tail_opportunities], context=context) + + return first_opportunity.id + + def _convert_opportunity_data(self, lead): + crm_stage = self.pool.get('crm.case.stage') + if lead.section_id: + stage_ids = crm_stage.search(cr, uid, [('sequence','>=',1), ('section_ids','=', lead.section_id.id)]) + else: + stage_ids = crm_stage.search(cr, uid, [('sequence','>=',1)]) + + return { + 'planned_revenue': lead.planned_revenue, + 'probability': lead.probability, + 'name': lead.name, + 'partner_id': customer.id, + 'user_id': (lead.user_id and lead.user_id.id), + 'type': 'opportunity', + 'stage_id': stage_ids and stage_ids[0] or False, + 'date_action': time.strftime('%Y-%m-%d %H:%M:%S'), + 'partner_address_id': len(customer.address_id) and customer.address_id[0] or False + } + def _convert_opportunity_notification(self, cr, uid, lead, context=context): + success_message = _("Lead '%s' has been converted to an opportunity.") % lead.name + self.message_append(cr, uid, [lead.id], success_message, body_text=success_message, context=context) + self.log(cr, uid, [lead.id], success_message) + self._send_mail_to_salesman(cr, uid, lead, context=context) + return True + + def convert_opportunity(self, cr, uid, ids, partner_id, mass_convert=False, merge=False, context=None): + partner = self.pool.get('res.partner') + mail_message = self.pool.get('mail.message') + customer = partner.browse(cr, uid, partner_id, context=context) + + for lead in self.browse(cr, uid, ids, context=context): + vals = self._convert_opportunity_data(lead) + self.write(cr, uid, [lead.id], vals, context=context) + self._convert_opportunity_notification(cr, uid, lead, context=context) + #TOCHECK: why need to change partner details in all messages of lead ? + if lead.partner_id: + msg_ids = [ x.id for x in lead.message_ids] + mail_message.write(cr, uid, msg_ids, { + 'partner_id': lead.partner_id.id + }, context=context) + return True + + def _lead_create_partner(self, cr, uid, lead, context=None): + partner = self.pool.get('res.partner') + partner_id = partner.create(cr, uid, { + 'name': lead.partner_name or lead.contact_name or lead.name, + 'user_id': lead.user_id.id, + 'comment': lead.description, + 'address': [] + }) + return partner_id + + def _lead_assign_partner(self, cr, uid, ids, partner_id, context=None): + return self.write(cr, uid, ids, {'partner_id' : partner_id}, context=context) + + def _lead_create_partner_address(self, cr, uid, lead, partner_id, context=None): + address = self.pool.get('res.partner.address') + return address.create(cr, uid, { + 'partner_id': partner_id, + 'name': lead.contact_name, + 'phone': lead.phone, + 'mobile': lead.mobile, + 'email': lead.email_from, + 'fax': lead.fax, + 'title': lead.title and lead.title.id or False, + 'function': lead.function, + 'street': lead.street, + 'street2': lead.street2, + 'zip': lead.zip, + 'city': lead.city, + 'country_id': lead.country_id and lead.country_id.id or False, + 'state_id': lead.state_id and lead.state_id.id or False, + }) + + def convert_partner(self, cr, uid, ids, action='new', partner_id=False, context=None): + """ + This function convert partner based on action. + if action is 'new', create new partner with contact and assign lead to new partner_id. + otherwise assign lead to specified partner_id + """ + if context is None: + context = {} + partner_ids = [] + for lead in self.browse(cr, uid, ids, context=context): + if action == 'create': + partner_id = self._lead_create_partner(cr, uid, lead, context=context) + self._lead_assign_partner(cr, uid, [lead.id], partner_id, context=context) + partner_ids.append(partner_id) + return partner_ids + + def _send_mail_to_salesman(self, cr, uid, lead, context=None): + """ + Send mail to salesman with updated Lead details. + @ lead: browse record of 'crm.lead' object. + """ + #TOFIX: mail template should be used here instead of fix subject, body text. + message = self.pool.get('mail.message') + email_to = lead.user_id and lead.user_id.user_email + if not email_to: + return False + + email_from = lead.section_id and lead.section_id.user_id and lead.section_id.user_id.user_email or email_to + partner = lead.partner_id and lead.partner_id.name or lead.partner_name + subject = "lead %s converted into opportunity" % lead.name + body = "Info \n Id : %s \n Subject: %s \n Partner: %s \n Description : %s " % (lead.id, lead.name, lead.partner_id.name, lead.description) + return message.schedule_with_attach(cr, uid, email_from, [email_to], subject, body) + + + def allocate_salesman(self, cr, uid, ids, user_ids, team_id=False, context=None): + index = 0 + for lead_id in ids: + value = {} + if team_id: + value['section_id'] = team_id + if index < len(user_ids): + value['user_id'] = user_ids[index] + index += 1 + if value: + self.write(cr, uid, [lead_id], value, context=context) + return True + + def redirect_opportunity_view(self, cr, uid, opportunity_id, context=None): + models_data = self.pool.get('ir.model.data') + + # Get Opportunity views + opportunity_view_form = models_data._get_id( + cr, uid, 'crm', 'crm_case_form_view_oppor') + opportunity_view_tree = models_data._get_id( + cr, uid, 'crm', 'crm_case_tree_view_oppor') + if opportunity_view_form: + opportunity_view_form = models_data.browse( + cr, uid, opportunity_view_form, context=context).res_id + if opportunity_view_tree: + opportunity_view_tree = models_data.browse( + cr, uid, opportunity_view_tree, context=context).res_id + + return { + 'name': _('Opportunity'), + 'view_type': 'form', + 'view_mode': 'tree, form', + 'res_model': 'crm.lead', + 'domain': [('type', '=', 'opportunity')], + 'res_id': int(opportunity_id), + 'view_id': False, + 'views': [(opportunity_view_form, 'form'), + (opportunity_view_tree, 'tree'), + (False, 'calendar'), (False, 'graph')], + 'type': 'ir.actions.act_window', + } + + + def button_convert_opportunity(self, cr, uid, ids, context=None): """ Precomputation for converting lead to opportunity """ if context is None: diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 42587eea2b0..2b0b862783c 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -59,7 +59,7 @@ widget="selection" domain="[('object_id.model','=','crm.lead')]"/> + From c565752d0000b6c9f9c8ae74719207a6d52c163a Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 22 Nov 2011 18:57:15 +0530 Subject: [PATCH 162/470] [FIX] crm: Clicked on forword button for lead forward to its partner, Its gave traceback bzr revid: ron@tinyerp.com-20111122132715-hiqd32vdckfxdqg1 --- addons/crm_partner_assign/wizard/crm_forward_to_partner.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py index 29a60ba71ba..c49115078cd 100644 --- a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py +++ b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py @@ -64,9 +64,10 @@ class crm_lead_forward_to_partner(osv.osv_memory): res = {} res_id = context.get('active_id') model = context.get('active_model') - body_text = self._get_body_text(cr, uid, model, res_id, history_type, context=context) + lead = self.pool.get(model).browse(cr, uid, res_id, context) + body_text = self._get_info_body_text(cr, uid, lead, context=context) context['mail.compose.message.body'] = history_type - if msg_val: + if body_text: res = {'value': {'body_text' : body_text}} return res From f97682aac2c1640d3855e1db33232082713291b0 Mon Sep 17 00:00:00 2001 From: Antoine Huvelle Date: Tue, 22 Nov 2011 15:08:59 +0100 Subject: [PATCH 163/470] [IMP] fonts bzr revid: ahu@openerp.com-20111122140859-z0vff9cyfod0ykoa --- addons/web/static/src/css/base.css | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index dfd92da0916..72788351576 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -5,6 +5,7 @@ body.openerp { min-width: 1000px; overflow-y: scroll; font-size: 80%; + font-family: Ubuntu, Helvetica, sans-serif; } body.openerp, .openerp textarea, .openerp input, .openerp select, .openerp option, .openerp button, .openerp .ui-widget { @@ -272,7 +273,7 @@ label.error { filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#BD5E54', endColorstr='#90322A',GradientType=0 ); /* IE6-9 */ background: linear-gradient(top, #bd5e54 0%,#90322a 60%); /* W3C */ - border: 1px solid #6E2A24; + border: 1px solid #5E1A14; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; @@ -283,7 +284,7 @@ label.error { text-transform: uppercase; line-height: 20px; font-weight: bold; - font-size: 85%; + font-size: 75%; white-space: nowrap; } @@ -442,6 +443,8 @@ label.error { margin: 0; padding: 4px 10px; text-shadow: 0 1px 0 #111111; + font-weight:600; + line-height:14px; } .openerp .header_title small { color: #ccc; @@ -509,6 +512,10 @@ label.error { font-weight: bold; } +.openerp .logout { + font-size:80%; +} + /* Footer */ .openerp div.oe_footer { background: none repeat scroll 0 0 #CCCCCC; @@ -552,6 +559,9 @@ label.error { .openerp .oe_vm_switch { float: right; } +.openerp .oe-view-manager-header .oe_view_title { + font-size:150%; +} /* SearchView */ .openerp .filter_label, .openerp .filter_icon { @@ -831,6 +841,7 @@ label.error { .openerp .oe-list-pager .oe-pager-state { cursor: pointer; font-size:90%; + color:#555; } .openerp .oe-listview .oe-group-name { @@ -925,6 +936,10 @@ label.error { } /* Form */ +.openerp .oe_form_frame_cell input[type="checkbox"] { + margin-top:5px; + vertical-align:center; +} .openerp table.oe_frame td { color: #4c4c4c; } @@ -1000,7 +1015,7 @@ label.error { } .openerp .oe_forms label.oe_label, .openerp .oe_forms label.oe_label_help { - margin: 3px 0 0 10px; + margin: 3px 0 0 3px; } .openerp label.oe_label_help span { font-size: 80%; @@ -1199,6 +1214,7 @@ label.error { .openerp .view-manager-main-content { width: 100%; + padding:0px 7px; } .openerp .oe-view-manager-header { overflow: auto; @@ -1515,6 +1531,7 @@ label.error { .oe-shortcut-toggle { height: 20px; padding: 0; + margin-top:4px; width: 24px; cursor: pointer; display: block; From b3366f526e042936cb24a756987b089e3a558ea9 Mon Sep 17 00:00:00 2001 From: Antoine Huvelle Date: Tue, 22 Nov 2011 15:50:11 +0100 Subject: [PATCH 164/470] [IMP] kanban view font size bzr revid: ahu@openerp.com-20111122145011-1x3siw26qrwc8j51 --- addons/web_kanban/static/src/css/kanban.css | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index 86818f6541c..57fedecfbad 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -1,3 +1,4 @@ + .openerp .oe_kanban_view .ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; @@ -18,9 +19,10 @@ } .openerp .oe_kanban_group_title { - color: #000000; - font-size: 130%; + font-size: 100%; font-weight: bold; + padding-left:2px; + color: #666666; } .openerp .oe_kanban_group_title_undefined { color: #666666; @@ -45,10 +47,10 @@ .openerp .oe_kanban_fold_icon { cursor: pointer; float: left; - padding: 2px 2px 0 0; + padding: 4px 2px 0 2px; width: 16px; height: 16px; - background: url(/web_kanban/static/src/img/minus-icon.png) no-repeat; + background: url(/web_kanban/static/src/img/minus-icon.png) no-repeat center center; } .openerp .oe_kanban_group_folded .oe_kanban_fold_icon { background: url(/web_kanban/static/src/img/plus-icon.png) no-repeat; @@ -64,6 +66,7 @@ } .openerp ul.oe_kanban_aggregates span { text-decoration: underline; + font-size:90%; } .openerp .oe_kanban_action_button { @@ -90,12 +93,13 @@ padding: 0 4px 0 4px; } .openerp .oe_kanban_title2 { - font-size: 110%; + font-size: 100%; font-weight: bold; + color:#3A3A3A; padding: 0 4px 0 4px; } .openerp .oe_kanban_title3 { - font-size: 100%; + font-size: 95%; font-weight: normal; padding: 0 4px 0 4px; } @@ -105,6 +109,7 @@ } .openerp .oe_kanban_table { width: 100%; + font-size:95%; border: none; border-collapse: collapse; margin: 0; @@ -116,7 +121,13 @@ } .openerp .oe_kanban_box_content { padding: 4px; + font-size:90%; } +.openerp .oe_kanban_box_content div:last-child { + padding-top:4px; + color:#555; +} + .openerp .oe_kanban_buttons_set { border-top: 1px dotted; white-space: nowrap; From ea92099e3df707677b7bf8721e872b834bbea2af Mon Sep 17 00:00:00 2001 From: Antoine Huvelle Date: Tue, 22 Nov 2011 17:14:37 +0100 Subject: [PATCH 165/470] [IMP] non-editable view changes bzr revid: ahu@openerp.com-20111122161437-3d8q3v27uofvpii4 --- addons/web/static/src/css/base.css | 13 +++++++++++++ addons/web_kanban/static/src/css/kanban.css | 3 +++ 2 files changed, 16 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 72788351576..3b9071bec23 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -934,6 +934,19 @@ label.error { .openerp .oe_form_notebook .ui-tabs-selected { background: #f9f9f9; } +/* Unedit Form */ +.openerp .field_char, .openerp .field_date, .openerp .field_float, .openerp .field_selection, .openerp .oe_form_field_many2one a { + vertical-align:middle; + padding-top:3px; + font-size:90%; + color:#222; +} +.openerp .oe_form_field_many2one a { + color:#9A0404; + line-height:12px; +} + + /* Form */ .openerp .oe_form_frame_cell input[type="checkbox"] { diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index 57fedecfbad..bc68c8068a0 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -102,6 +102,9 @@ font-size: 95%; font-weight: normal; padding: 0 4px 0 4px; + line-height:16px; +} +.openerp .oe_kanban_title3 img{ } .openerp .oe_kanban_small { font-size: 80%; From 25b36b599a25463fb9ca89ea2bca8fea4405e51f Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 22 Nov 2011 17:55:37 +0100 Subject: [PATCH 166/470] [IMP] account_voucher: multi currency handling bzr revid: qdp-launchpad@openerp.com-20111122165537-2c8a9ov2qjklq2wj --- addons/account_voucher/account_voucher.py | 140 ++++++++++++++---- .../account_voucher/test/account_voucher.yml | 1 - addons/account_voucher/test/sales_receipt.yml | 1 - .../voucher_payment_receipt_view.xml | 53 +++---- 4 files changed, 136 insertions(+), 59 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index fd6dac9f90d..4b099eedc66 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -90,6 +90,17 @@ class account_voucher(osv.osv): return tax_id return False + def _get_payment_rate_currency(self, cr, uid, context=None): + if context is None: context = {} + journal_pool = self.pool.get('account.journal') + journal_id = context.get('journal_id', False) + if journal_id: + journal = journal_pool.browse(cr, uid, journal_id, context=context) + if journal.currency: + return journal.currency.id + #no journal given in the context, use company currency as default + return self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id + def _get_currency(self, cr, uid, context=None): if context is None: context = {} journal_pool = self.pool.get('account.journal') @@ -143,11 +154,21 @@ class account_voucher(osv.osv): res = super(account_voucher, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) doc = etree.XML(res['arch']) - nodes = doc.xpath("//field[@name='partner_id']") + + # replace the label of the field payment_rate + currency_obj = self.pool.get('res.currency') + base_currency_id = currency_obj.search(cr, uid, [('rate','=',1.0),('rate_ids','=',1.0)], context=context) + symbol = base_currency_id and currency_obj.name_get(cr, uid, base_currency_id, context=context)[0][1] + string = _("Rate for this operation: 1 %s is") % symbol + payment_rate_field = doc.xpath("//field[@name='payment_rate']") + for field in payment_rate_field: + field.set('string', string) + if context.get('type', 'sale') in ('purchase', 'payment'): + nodes = doc.xpath("//field[@name='partner_id']") for node in nodes: node.set('domain', "[('supplier', '=', True)]") - res['arch'] = etree.tostring(doc) + res['arch'] = etree.tostring(doc) return res def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount): @@ -184,7 +205,10 @@ class account_voucher(osv.osv): res = {} debit = credit = 0.0 for voucher in self.browse(cr, uid, ids, context=context): - res[voucher.id] = voucher.amount / voucher.payment_rate + rate = voucher.currency_id.rate or voucher.company_id.currency_id.rate + if voucher.currency_id == voucher.payment_rate_currency_id: + rate = voucher.payment_rate + res[voucher.id] = voucher.amount / rate * voucher.company_id.currency_id.rate return res _name = 'account.voucher' @@ -247,8 +271,9 @@ class account_voucher(osv.osv): 'comment': fields.char('Counterpart Comment', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}), 'analytic_id': fields.many2one('account.analytic.account','Write-Off Analytic Account', readonly=True, states={'draft': [('readonly', False)]}), 'writeoff_amount': fields.function(_get_writeoff_amount, string='Reconcile Amount', type='float', readonly=True), + 'payment_rate_currency_id': fields.many2one('res.currency', 'Payment Rate Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'payment_rate': fields.float('Payment Rate', digits=(12,6), required=True, readonly=True, states={'draft': [('readonly', False)]}, - help='The rate between the journal currency and the company currency for this particular payment.'), + help='The specific rate that will be used for this voucher for the selected currency.'), 'paid_amount_in_company_currency': fields.function(_paid_amount_in_company_currency, string='Paid Amount in Company Currency', type='float', readonly=True), } _defaults = { @@ -269,6 +294,7 @@ class account_voucher(osv.osv): 'payment_option': 'without_writeoff', 'comment': _('Write-Off'), 'payment_rate': 1.0, + 'payment_rate_currency_id': _get_payment_rate_currency, } def compute_tax(self, cr, uid, ids, context=None): @@ -374,7 +400,7 @@ class account_voucher(osv.osv): }) return {'value':default} - def onchange_journal_voucher(self, cr, uid, ids, line_ids=False, tax_id=False, price=0.0, partner_id=False, journal_id=False, ttype=False, context=None): + def onchange_journal_voucher(self, cr, uid, ids, line_ids=False, tax_id=False, price=0.0, partner_id=False, journal_id=False, ttype=False, company_id=False, context=None): """price Returns a dict that contains new values and context @@ -413,20 +439,25 @@ class account_voucher(osv.osv): default['value']['account_id'] = account_id default['value']['type'] = ttype or tr_type - vals = self.onchange_journal(cr, uid, ids, journal_id, line_ids, tax_id, partner_id, context) + vals = self.onchange_journal(cr, uid, ids, journal_id, line_ids, tax_id, partner_id, company_id, context) default['value'].update(vals.get('value')) return default - def onchange_rate(self, cr, uid, ids, rate, amount, context=None): - res = {'value': {'paid_amount_in_company_currency': 0.0}} - if rate and amount: - res['value']['paid_amount_in_company_currency'] = amount / rate + def onchange_rate(self, cr, uid, ids, rate, amount, currency_id, payment_rate_currency_id, company_id, context=None): + res = {'value': {}} + if rate and amount and currency_id and currency_id == payment_rate_currency_id: + company_rate = self.pool.get('res.company').browse(cr, uid, company_id, context=context).currency_id.rate + res['value']['paid_amount_in_company_currency'] = amount / rate * company_rate return res - def onchange_amount(self, cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, context=None): + def onchange_amount(self, cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=None): + if context is None: + context = {} res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context=context) - vals = self.onchange_rate(cr, uid, ids, rate, amount, context=context) + ctx = context.copy() + ctx.update({'date': date}) + vals = self.onchange_rate(cr, uid, ids, rate, amount, currency_id, payment_rate_currency_id, company_id, context=ctx) for key in vals.keys(): res[key].update(vals[key]) return res @@ -582,7 +613,22 @@ class account_voucher(osv.osv): default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price) return default - def onchange_date(self, cr, uid, ids, date, currency_id, amount, context=None): + def onchange_payment_rate_currency(self, cr, uid, ids, currency_id, payment_rate_currency_id, date, amount, company_id, context=None): + if context is None: + context = {} + res = {'value': {}} + #set the default payment rate of the voucher and compute the paid amount in company currency + if currency_id and currency_id == payment_rate_currency_id: + ctx = context.copy() + ctx.update({'date': date}) + payment_rate = self.pool.get('res.currency').browse(cr, uid, currency_id, context=ctx).rate + res['value'].update({'payment_rate': payment_rate}) + vals = self.onchange_rate(cr, uid, ids, payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context=ctx) + for key in vals.keys(): + res[key].update(vals[key]) + return res + + def onchange_date(self, cr, uid, ids, date, currency_id, payment_rate_currency_id, amount, company_id, context=None): """ @param date: latest value from user input for field date @param args: other arguments @@ -590,22 +636,19 @@ class account_voucher(osv.osv): @return: Returns a dict which contains new values, and context """ res = {'value': {}} + #FIXME: use find() hereunder + #set the period of the voucher period_pool = self.pool.get('account.period') pids = period_pool.search(cr, uid, [('date_start', '<=', date), ('date_stop', '>=', date)]) if pids: res['value'].update({'period_id':pids[0]}) - #set the default payment rate of the voucher and compute the paid amount in company currency - payment_rate = 1.0 - if currency_id: - payment_rate = self.pool.get('res.currency').browse(cr, uid, currency_id, context={'date': date}).rate - res['value'].update({'payment_rate': payment_rate}) - vals = self.onchange_rate(cr, uid, ids, payment_rate, amount, context=context) + vals = self.onchange_payment_rate_currency(cr, uid, ids, currency_id, payment_rate_currency_id, date, amount, company_id, context=context) for key in vals.keys(): res[key].update(vals[key]) return res - def onchange_journal(self, cr, uid, ids, journal_id, line_ids, tax_id, partner_id, date, amount, ttype, context=None): + def onchange_journal(self, cr, uid, ids, journal_id, line_ids, tax_id, partner_id, date, amount, ttype, company_id, context=None): if not journal_id: return False journal_pool = self.pool.get('account.journal') @@ -620,12 +663,16 @@ class account_voucher(osv.osv): currency_id = False if journal.currency: currency_id = journal.currency.id - payment_rate = self.pool.get('res.currency').browse(cr, uid, currency_id, context={'date': date}).rate + ctx = context.copy() + ctx.update({'date': date}) + payment_rate = self.pool.get('res.currency').browse(cr, uid, currency_id, context=ctx).rate vals['value'].update({'payment_rate': payment_rate}) - res = self.onchange_rate(cr, uid, ids, payment_rate, amount, context=context) + res = self.onchange_rate(cr, uid, ids, payment_rate, amount, currency_id, currency_id, company_id, context=ctx) for key in res.keys(): vals[key].update(res[key]) - vals['value'].update({'currency_id': currency_id}) + if currency_id: + vals['value'].update({'currency_id': currency_id}) + vals['value'].update({'payment_rate_currency_id': currency_id}) res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context) for key in res.keys(): vals[key].update(res[key]) @@ -730,9 +777,9 @@ class account_voucher(osv.osv): # TODO: Make this logic available. # -for sale, purchase we have but for the payment and receipt we do not have as based on the bank/cash journal we can not know its payment or receipt if voucher_brw.type in ('purchase', 'payment'): - credit = voucher_brw.amount / voucher_brw.payment_rate + credit = voucher_brw.paid_amount_in_company_currency#voucher_brw.amount / voucher_brw.payment_rate * voucher_brw.company_id.currency_id.rate elif voucher_brw.type in ('sale', 'receipt'): - debit = voucher_brw.amount / voucher_brw.payment_rate + debit = voucher_brw.paid_amount_in_company_currency#amount / voucher_brw.payment_rate * voucher_brw.company_id.currency_id.rate if debit < 0: credit = -debit; debit = 0.0 if credit < 0: debit = -credit; credit = 0.0 sign = debit - credit < 0 and -1 or 1 @@ -831,6 +878,24 @@ class account_voucher(osv.osv): } return (move_line, move_line_counterpart) + def _convert_amount(self, cr, uid, amount, voucher_id, context=None): + #TODO: doccument me + currency_obj = self.pool.get('res.currency') + voucher = self.browse(cr, uid, voucher_id, context=context) + res = amount + if voucher.payment_rate_currency_id.id == voucher.company_id.currency_id.id: + rate_between_voucher_and_base = voucher.currency_id.rate or 1.0 + rate_between_base_and_company = voucher.payment_rate or 1.0 + res = amount / rate_between_voucher_and_base * rate_between_base_and_company + elif voucher.payment_rate_currency_id.id == voucher.currency_id.id: + rate_between_base_and_company = voucher.company_id.currency_id.rate or 1.0 + rate_between_voucher_and_base = voucher.payment_rate or 1.0 + res = amount / rate_between_voucher_and_base * rate_between_base_and_company + else: + res = currency_obj.compute(cr, uid, voucher.currency_id.id, voucher.company_id.currency_id.id, amount, context=ctx) + print 'res', res + return res + def voucher_move_line_create(self, cr, uid, voucher_id, line_total, move_id, company_currency, current_currency, context=None): ''' Create one account move line, on the given account move, per voucher line where amount is not 0.0. @@ -843,24 +908,32 @@ class account_voucher(osv.osv): :param company_currency: id of currency of the company to which the voucher belong :param current_currency: id of currency of the voucher :return: Tuple build as (remaining amount not allocated on voucher lines, list of account_move_line created in this method) - :rtype: tuple(int, list of int) + :rtype: tuple(float, list of int) ''' + if context is None: + context = {} move_line_obj = self.pool.get('account.move.line') currency_obj = self.pool.get('res.currency') tot_line = line_total rec_lst_ids = [] - voucher_brw = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context) + voucher_brw = self.pool.get('account.voucher').browse(cr, uid, voucher_id, context) + ctx = context.copy() + ctx.update({'date': voucher_brw.date}) for line in voucher_brw.line_ids: #create one move line per voucher line where amount is not 0.0 if not line.amount: continue - #we check if the voucher line is fully paid or not and create a move line to balance the payment and initial invoice if needed + #TODO: comment me + amount = self._convert_amount(cr, uid, line.untax_amount or line.amount, voucher_brw.id, context=ctx) + #residual amount in company currency + #amount_residual = line.move_line_id.amount_residual - amount + #TODO: remove me if line.amount == line.amount_unreconciled: - amount = (line.untax_amount or line.amount) / voucher_brw.payment_rate + # amount = (line.untax_amount or line.amount) / voucher_brw.payment_rate amount_residual = line.move_line_id.amount_residual - amount #residual amount in company currency else: - amount = (line.untax_amount or line.amount) / voucher_brw.payment_rate + # amount = (line.untax_amount or line.amount) / voucher_brw.payment_rate amount_residual = 0.0 move_line = { 'journal_id': voucher_brw.journal_id.id, @@ -997,6 +1070,9 @@ class account_voucher(osv.osv): for voucher in self.browse(cr, uid, ids, context=context): if voucher.move_id: continue + #TODO: -need to check- Can't we just use the context returned by _sel_context? + ctx = context.copy() + ctx.update({'date': voucher.date}) company_currency = self._get_company_currency(cr, uid, voucher.id, context) current_currency = self._get_current_currency(cr, uid, voucher.id, context) context = self._sel_context(cr, uid, voucher.id, context) @@ -1010,9 +1086,9 @@ class account_voucher(osv.osv): line_total = move_line_brw.debit - move_line_brw.credit rec_list_ids = [] if voucher.type == 'sale': - line_total = line_total - (voucher.tax_amount / voucher.payment_rate) + line_total = line_total - self._convert_amount(cr, uid, voucher.tax_amount, voucher.id, context=ctx) elif voucher.type == 'purchase': - line_total = line_total + (voucher.tax_amount / voucher.payment_rate) + line_total = line_total + self._convert_amount(cr, uid, voucher.tax_amount, voucher.id, context=ctx) #create one move line per voucher line where amount is not 0.0 line_total, rec_list_ids = self.voucher_move_line_create(cr, uid, voucher.id, line_total, move_id, company_currency, current_currency, context) diff --git a/addons/account_voucher/test/account_voucher.yml b/addons/account_voucher/test/account_voucher.yml index 33ae609e3f3..7e5482aa931 100644 --- a/addons/account_voucher/test/account_voucher.yml +++ b/addons/account_voucher/test/account_voucher.yml @@ -5,7 +5,6 @@ account_id: account.cash amount: 1000.0 company_id: base.main_company - currency_id: base.EUR journal_id: account.bank_journal name: Voucher for Axelor narration: Basic Pc diff --git a/addons/account_voucher/test/sales_receipt.yml b/addons/account_voucher/test/sales_receipt.yml index d3fd720ec6d..7ea4f7d1c55 100644 --- a/addons/account_voucher/test/sales_receipt.yml +++ b/addons/account_voucher/test/sales_receipt.yml @@ -5,7 +5,6 @@ account_id: account.a_recv amount: 30000.0 company_id: base.main_company - currency_id: base.EUR journal_id: account.sales_journal line_cr_ids: - account_id: account.a_sale diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 46720b2732c..4adebed8a1a 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -75,13 +75,13 @@
- + - + - - - - - - + + + + + + + @@ -140,14 +141,14 @@ - + - + @@ -188,12 +189,13 @@ - - + + - - + domain="[('type','=','other')]" colspan="4"/> + + + @@ -289,14 +291,14 @@ + on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/> - + @@ -337,12 +339,13 @@ - - + + - - + domain="[('type','=','other')]" colspan="4"/> + + + From 2e758fb463ba35c4820d93337ec577d3cdc451da Mon Sep 17 00:00:00 2001 From: "Amit (OpenERP)" Date: Wed, 23 Nov 2011 11:01:54 +0530 Subject: [PATCH 167/470] [IMP]:improved code bzr revid: apa@tinyerp.com-20111123053154-gsay5gufpz83vkns --- addons/hr_payroll/hr_payroll.py | 12 +++++------- addons/hr_payroll_account/hr_payroll_account.py | 17 ++++++++--------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 5b74e0b60b6..9363df8257e 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -299,14 +299,12 @@ class hr_payslip(osv.osv): } def _check_dates(self, cr, uid, ids, context=None): - for i in self.read(cr, uid, ids, ['date_from', 'date_to'], context=context): - if i['date_from'] > i['date_to']: - return False - return True + for i in self.read(cr, uid, ids, ['date_from', 'date_to'], context=context): + if i['date_from'] > i['date_to']: + return False + return True - _constraints = [ - (_check_dates, 'Error! Payslip from-date must be lower then contract to-date.', ['date_from', 'date_to']) - ] + _constraints = [(_check_dates, 'Error! Payslip from-date must be lower then contract to-date.', ['date_from', 'date_to'])] def copy(self, cr, uid, id, default=None, context=None): if not default: diff --git a/addons/hr_payroll_account/hr_payroll_account.py b/addons/hr_payroll_account/hr_payroll_account.py index 2ce8bc57e76..23d37ff0e56 100644 --- a/addons/hr_payroll_account/hr_payroll_account.py +++ b/addons/hr_payroll_account/hr_payroll_account.py @@ -34,21 +34,20 @@ class hr_payslip(osv.osv): _inherit = 'hr.payslip' _description = 'Pay Slip' - def _get_journal(self, cr, uid, context=None): - if context is None: - context = {} - journal_obj = self.pool.get('account.journal') - res = journal_obj.search(cr, uid, [('type', '=','sale')]) - return res and res[0] or False - + def _get_journal_id(self, cr, uid, *args): + model_data = self.pool.get('ir.model.data') + res = model_data.search(cr,uid, [('name', '=', 'expenses_journal')]) + if res:return model_data.browse(cr,uid,res[0]).res_id + return False + _columns = { 'period_id': fields.many2one('account.period', 'Force Period',states={'draft': [('readonly', False)]}, readonly=True, domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."), 'journal_id': fields.many2one('account.journal', 'Expense Journal',states={'draft': [('readonly', False)]}, readonly=True, required=True), 'move_id': fields.many2one('account.move', 'Accounting Entry', readonly=True), } - + _defaults = { - 'journal_id': _get_journal, + 'journal_id':_get_journal_id } def copy(self, cr, uid, id, default=None, context=None): From 993778ad2ddee84023bf5e442c3a97f3c42fa012 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Wed, 23 Nov 2011 11:03:02 +0530 Subject: [PATCH 168/470] [FIX] hr_holidays : cannot approve a leave request lp bug: https://launchpad.net/bugs/893491 fixed bzr revid: mdi@tinyerp.com-20111123053302-snauyvdzawjti414 --- addons/hr_holidays/hr_holidays_view.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index a43378b1c95..45a9fec1758 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -286,7 +286,7 @@ hr.holidays form {'search_default_approve':1,"search_default_department_id": department_id} - [('type','=','add')] + [('type','=','remove')] @@ -304,7 +304,6 @@ - From e2c80d7ca8bf0611fb5ea8c27e17f8d6a37dc6b0 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 23 Nov 2011 11:13:47 +0530 Subject: [PATCH 169/470] [FIX] crm: Click on Ge Assing button Traceback generate , put comments created demo data of crm_lead for onchange event bzr revid: ron@tinyerp.com-20111123054347-0mo8pkly1857beff --- addons/crm/__openerp__.py | 2 +- addons/crm_partner_assign/crm_lead_view.xml | 2 +- addons/crm_partner_assign/partner_geo_assign.py | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index ba073060456..f7d56ce373b 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -123,7 +123,7 @@ Creates a dashboard for CRM that includes: 'test/process/merge_opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/segmentation.yml', - 'test/ui/demo_data.yml', + #'test/ui/demo_data.yml', TODO : After installing crm_partner_assign view error 'test/ui/duplicate_lead.yml', 'test/ui/delete_lead.yml' ], diff --git a/addons/crm_partner_assign/crm_lead_view.xml b/addons/crm_partner_assign/crm_lead_view.xml index 2ec3c85353b..7cf47b95939 100644 --- a/addons/crm_partner_assign/crm_lead_view.xml +++ b/addons/crm_partner_assign/crm_lead_view.xml @@ -27,7 +27,7 @@ - + From 80dc65aeea74a1e5a0cf6b40bcfeaa73681a40d2 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier <> Date: Mon, 28 Nov 2011 10:39:38 +0530 Subject: [PATCH 239/470] [FIX] account : Create Monthly Periods : unique key violation on Opening Periods lp bug: https://launchpad.net/bugs/894707 fixed bzr revid: mdi@tinyerp.com-20111128050938-5e2vizusnvq8zbth --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 8aa1569520e..f766b5871a8 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -880,7 +880,7 @@ class account_fiscalyear(osv.osv): for fy in self.browse(cr, uid, ids, context=context): ds = datetime.strptime(fy.date_start, '%Y-%m-%d') period_obj.create(cr, uid, { - 'name': _('Opening Period'), + 'name': "%s %s" % (_('Opening Period'), ds.strftime('%Y')), 'code': ds.strftime('00/%Y'), 'date_start': ds, 'date_stop': ds, From 5e0a6fe7d762619af497aa7fdd0411aaf670bf2d Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 28 Nov 2011 12:27:18 +0530 Subject: [PATCH 240/470] [FIX] crm, crm_partner_assing: Fixed : [crm, crm_partner_assign installed] and i try to reinstall crm module and generate lead record from yml Its generated traceback: Error Cannot find field partner_assigned_id in the following view parts composing the view of object model crm.lead bzr revid: ron@tinyerp.com-20111128065718-qqtju7r8cxizdagq --- addons/crm/crm_lead_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index fad7859fee5..82be78a5728 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -444,7 +444,7 @@ Opportunities crm.lead form - 10 + 20 From 42a7b9f9a6e28352412817acd1fba728b7340d6d Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 28 Nov 2011 12:35:29 +0530 Subject: [PATCH 241/470] [IMP] crm, crm_claim: Removed commented lines from __openerp__.py bzr revid: ron@tinyerp.com-20111128070529-eizoo3f93d0qrfob --- addons/crm/__openerp__.py | 2 +- addons/crm_claim/__openerp__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index acba8d3c510..a98a0cbc6a4 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -123,7 +123,7 @@ Creates a dashboard for CRM that includes: 'test/process/merge_opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/segmentation.yml', - 'test/ui/crm_demo.yml', #TODO : After installing crm_partner_assign view error + 'test/ui/crm_demo.yml', 'test/ui/duplicate_lead.yml', 'test/ui/delete_lead.yml' ], diff --git a/addons/crm_claim/__openerp__.py b/addons/crm_claim/__openerp__.py index 217bec232c1..8c3854ffd2e 100644 --- a/addons/crm_claim/__openerp__.py +++ b/addons/crm_claim/__openerp__.py @@ -49,7 +49,7 @@ automatically new claims based on incoming emails. 'crm_claim_demo.xml', ], 'test': ['test/process/claim.yml', - 'test/ui/claim_demo.yml'#TODO : After installing crm_partner_assign view error + 'test/ui/claim_demo.yml' ], 'installable': True, 'active': False, From 073244191af89ae8fc7e2be38067af064b48a7a1 Mon Sep 17 00:00:00 2001 From: "Kirti Savalia (OpenERP)" Date: Mon, 28 Nov 2011 17:49:40 +0530 Subject: [PATCH 242/470] [FIX]:wrong check for browse record to integer lp bug: https://launchpad.net/bugs/894434 fixed bzr revid: ksa@tinyerp.com-20111128121940-7rhez036lhgd090y --- addons/product/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index ecf1761318e..c67b1f6c029 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -171,7 +171,7 @@ class product_uom(osv.osv): def write(self, cr, uid, ids, vals, context=None): if 'category_id' in vals: for uom in self.browse(cr, uid, ids, context=context): - if uom.category_id != vals['category_id']: + if uom.category_id.id != vals['category_id']: raise osv.except_osv(_('Warning'),_("Cannot change the category of existing UoM '%s'.") % (uom.name,)) return super(product_uom, self).write(cr, uid, ids, vals, context=context) From 25f83943e19904a9358ad15fb59e6f26f2baffcf Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Mon, 28 Nov 2011 15:43:48 +0100 Subject: [PATCH 243/470] =?UTF-8?q?[IMP]=20extensive=20module=20descriptio?= =?UTF-8?q?n=20[IMP]=20assign=20(c)=20back=20to=20Num=C3=A9rigraphe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lp bug: https://launchpad.net/bugs/387958 fixed bzr revid: ls@numerigraphe.fr-20111128144348-ccl8ays59rc2hvj2 --- addons/l10n_fr_rib/__init__.py | 2 +- addons/l10n_fr_rib/__openerp__.py | 17 ++++++++++++++--- addons/l10n_fr_rib/bank.py | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/addons/l10n_fr_rib/__init__.py b/addons/l10n_fr_rib/__init__.py index bdaab364c54..a061d3f40a2 100644 --- a/addons/l10n_fr_rib/__init__.py +++ b/addons/l10n_fr_rib/__init__.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2011 OpenERP SA (). +# Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/addons/l10n_fr_rib/__openerp__.py b/addons/l10n_fr_rib/__openerp__.py index 16ae81fb431..87614dfa01e 100644 --- a/addons/l10n_fr_rib/__openerp__.py +++ b/addons/l10n_fr_rib/__openerp__.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2011 OpenERP SA (). +# Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -24,8 +24,19 @@ 'version': '1.0', 'category': 'Hidden', 'description': ''' -This module installs the base for RIB bank accounts (French standard for bank accounts). -To make it easier to enter RIB data, it will also allow to search for banks by code.''', +This module lets users enter the banking details of Partners in the RIB format (French standard for bank accounts details). +RIB Bank Accounts can be entered in the "Accounting" tab of the Partner form by specifying the account type "RIB". The four standard RIB fields will then become mandatory: +- Bank Code +- Office Code +- Account number +- RIB key +As a safety measure, OpenERP will check the RIB key whenever a RIB is saved, and will refuse to record the data if the key is incorrect. Please bear in mind that this can only happen when the user presses the "save" button, for example on the Partner Form. +Since each bank account may relate to a Bank, users may enter the RIB Bank Code in the Bank form - it will the pre-fill the Bank Code on the RIB when they select the Bank. +To make this easier, this module will also let users find Banks using their RIB code. + +The module base_iban can be a useful addition to this module, because French banks are now progressively adopting the international IBAN format instead of the RIB format. +The RIB and IBAN codes for a single account can be entered by recording two Bank Accounts in OpenERP: the first with the type "RIB", the second with the type "IBAN". +''', 'author' : u'Numérigraphe SARL', 'depends': ['base', 'account'], 'init_xml': ['bank_data.xml', ], diff --git a/addons/l10n_fr_rib/bank.py b/addons/l10n_fr_rib/bank.py index b1a285ef743..22b1bad01e1 100644 --- a/addons/l10n_fr_rib/bank.py +++ b/addons/l10n_fr_rib/bank.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2011 OpenERP SA (). +# Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as From 6710f39da0f85b43984d718be31ef201744ce729 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Mon, 28 Nov 2011 16:10:16 +0100 Subject: [PATCH 244/470] [DEL] l10n_fr_rib: drop useless Bank Account search() overload bzr revid: ls@numerigraphe.fr-20111128151016-0z48km039apfq3q5 --- addons/l10n_fr_rib/bank.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/addons/l10n_fr_rib/bank.py b/addons/l10n_fr_rib/bank.py index 22b1bad01e1..ea32bca4467 100644 --- a/addons/l10n_fr_rib/bank.py +++ b/addons/l10n_fr_rib/bank.py @@ -54,23 +54,6 @@ class res_partner_bank(osv.osv): return False return True - def search(self, cr, uid, args, offset=0, limit=None, order=None, - context=None, count=False): - """Search on type == rib""" - res = super(res_partner_bank, self).search(cr, uid, args, offset, - limit=limit, order=order, context=context, count=count) - if filter(lambda x:x[0] == 'acc_number' , args): - #get the value of the search - rib_value = filter(lambda x:x[0] == 'acc_number' , args)[0][2] - #get the other arguments of the search - args1 = filter(lambda x:x[0] != 'acc_number' , args) - #add the new criterion - args1 += [('rib', 'ilike', rib_value)] - #append the results to the older search - res += super(res_partner_bank, self).search(cr, uid, args1, offset, - limit, order, context=context, count=count) - return res - def onchange_bank_id(self, cr, uid, ids, bank_id, context=None): """Change the bank code""" result = super(res_partner_bank, self).onchange_bank_id(cr, uid, ids, bank_id, From a3229487ec6ef480158263e07b8595c7bbdd0c9f Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Mon, 28 Nov 2011 17:00:01 +0100 Subject: [PATCH 245/470] [REF] l10n_fr_rib: refactored bank name_search as suggested by Olivier Dony (OpenERP) [IMP] l10n_fr_rib: don't re-check error condition when constructing the message for key mismatch [FIx] l10n_fr_rib: wrong field name for bank code bzr revid: ls@numerigraphe.fr-20111128160001-q7re8fxr9lv2ad9g --- addons/l10n_fr_rib/bank.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/addons/l10n_fr_rib/bank.py b/addons/l10n_fr_rib/bank.py index ea32bca4467..4875dc33512 100644 --- a/addons/l10n_fr_rib/bank.py +++ b/addons/l10n_fr_rib/bank.py @@ -61,7 +61,7 @@ class res_partner_bank(osv.osv): if bank_id: bank = self.pool.get('res.bank').browse(cr, uid, bank_id, context=context) - result['bank_code'] = bank.code + result['bank_code'] = bank.rib_code return {'value': result} _columns = { @@ -74,8 +74,6 @@ class res_partner_bank(osv.osv): def _construct_constraint_msg(self, cr, uid, ids, context=None): """Quote the data in the warning message""" - if self._check_key(cr, uid, ids): - return # Only process the first id if type(ids) not in (int, long): id = ids[0] @@ -100,17 +98,17 @@ class res_bank(osv.osv): def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): - """Search by bank code""" - if args is None: - args = [] - ids = [] - if name: - ids = self.search(cr, user, [('name', operator, name)] + args, + """Search by bank code in addition to the standard search""" + # Get the standard results + results = super(res_bank, self).name_search(cr, user, + name, args=args ,operator=operator, context=context, limit=limit) + # Get additional results using the RIB code + ids = self.search(cr, user, [('rib_code', operator, name)], limit=limit, context=context) - if not ids: - ids = self.search(cr, user, [('code', operator, name)] + args, - limit=limit, context=context) - return self.name_get(cr, user, ids, context) + # Merge the results + results = list(set(results + self.name_get(cr, user, ids, context))) + print results + return results _columns = { 'rib_code': fields.char('RIB Bank Code', size=64), From 64c50d804ca677c87bc35a61be113d5d56b0cef9 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Mon, 28 Nov 2011 17:05:29 +0100 Subject: [PATCH 246/470] [IMP] remove print statement bzr revid: ls@numerigraphe.fr-20111128160529-f7nz0d3n0vqber8h --- addons/l10n_fr_rib/bank.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/l10n_fr_rib/bank.py b/addons/l10n_fr_rib/bank.py index 4875dc33512..6f7fe819d13 100644 --- a/addons/l10n_fr_rib/bank.py +++ b/addons/l10n_fr_rib/bank.py @@ -107,7 +107,6 @@ class res_bank(osv.osv): limit=limit, context=context) # Merge the results results = list(set(results + self.name_get(cr, user, ids, context))) - print results return results _columns = { From 342b0a1ac8b37d6bfb2a0ff3cf7dfdd6cb37b504 Mon Sep 17 00:00:00 2001 From: "Jiten (OpenERP)" Date: Tue, 29 Nov 2011 12:00:29 +0530 Subject: [PATCH 247/470] [IMP] To show many2many field on form view. bzr revid: jra@tinyerp.com-20111129063029-6pvqwh4uvts1pcft --- addons/web_mobile/static/src/xml/web_mobile.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/addons/web_mobile/static/src/xml/web_mobile.xml b/addons/web_mobile/static/src/xml/web_mobile.xml index 1d6f81404d2..1deb752cab6 100644 --- a/addons/web_mobile/static/src/xml/web_mobile.xml +++ b/addons/web_mobile/static/src/xml/web_mobile.xml @@ -298,13 +298,22 @@
    -
  • +
  • -
-
+ + + + + From 42f388bfa979db3a674fb6b01f2cd197a5409daf Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Tue, 29 Nov 2011 12:20:32 +0100 Subject: [PATCH 248/470] [IMP] openerp.wizard: added deprecation warning as wizards must be implemented using the TransientModel class. bzr revid: vmt@openerp.com-20111129112032-urq2qno8yu1hfan8 --- openerp/wizard/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openerp/wizard/__init__.py b/openerp/wizard/__init__.py index 2ed01921afa..55bf68292e6 100644 --- a/openerp/wizard/__init__.py +++ b/openerp/wizard/__init__.py @@ -31,6 +31,7 @@ from openerp.osv.osv import except_osv from openerp.osv.orm import except_orm from openerp.netsvc import Logger, LOG_ERROR import sys +import warnings class except_wizard(Exception): def __init__(self, name, value): @@ -43,6 +44,10 @@ class interface(netsvc.Service): def __init__(self, name): assert not self.exists('wizard.'+name), 'The wizard "%s" already exists!' % (name,) + warnings.warn( + "The wizard %s uses the deprecated openerp.wizard.interface class.\n" + "It must use the openerp.osv.TransientModel class instead." % \ + self._name, DeprecationWarning, stacklevel=3) super(interface, self).__init__('wizard.'+name) self.wiz_name = name From 6d71f44b414046c261ee879f62752a06bce9196b Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Tue, 29 Nov 2011 17:23:32 +0530 Subject: [PATCH 249/470] [FIX] account : account-invoice - paid checkbox and state field should have improved tooltips lp bug: https://launchpad.net/bugs/889222 fixed bzr revid: mdi@tinyerp.com-20111129115332-2myibaa6lixai83z --- addons/account/account_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 4da3a447e38..f7ce8e2d271 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -207,7 +207,7 @@ class account_invoice(osv.osv): help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed Invoice. \ \n* The \'Pro-forma\' when invoice is in Pro-forma state,invoice does not have an invoice number. \ \n* The \'Open\' state is used when user create invoice,a invoice number is generated.Its in open state till user does not pay invoice. \ - \n* The \'Paid\' state is set automatically when invoice is paid.\ + \n* The \'Paid\' state is set automatically when an invoice is paid. It\'s related journal entries may or may not be totally reconciled. \ \n* The \'Cancelled\' state is used when user cancel invoice.'), 'date_invoice': fields.date('Invoice Date', readonly=True, states={'draft':[('readonly',False)]}, select=True, help="Keep empty to use the current date"), 'date_due': fields.date('Due Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, select=True, @@ -257,7 +257,7 @@ class account_invoice(osv.osv): 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 50), # Check if we can remove ? 'account.move.line': (_get_invoice_from_line, None, 50), 'account.move.reconcile': (_get_invoice_from_reconcile, None, 50), - }, help="The Journal Entry of the invoice have been totally reconciled with one or several Journal Entries of payment."), + }, help="It indicates that an invoice has been paid and the journal entry of the invoice has been totally reconciled with one or several journal entries of payment."), 'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account', help='Bank Account Number, Company bank account if Invoice is customer or supplier refund, otherwise Partner bank account number.', readonly=True, states={'draft':[('readonly',False)]}), 'move_lines':fields.function(_get_lines, type='many2many', relation='account.move.line', string='Entry Lines'), From 940500782a1358f4b449a00e308d48528a662407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Tue, 29 Nov 2011 15:04:09 +0100 Subject: [PATCH 250/470] [ADD] new view definition for page bzr revid: rlo@openerp.com-20111129140409-mzelxhp40w5y093k --- addons/web/controllers/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 7dbd696cfb4..cbb73477c6a 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -605,6 +605,14 @@ def fix_view_modes(action): if 'views' not in action: generate_views(action) + id_form = None + for index, (id, mode) in enumerate(action['views']): + if mode == 'form': + id_form = id + break + if id_form is not None: + action['views'].insert(index + 1, (id_form, 'page')) + if action.pop('view_type', 'form') != 'form': return action From 5b0783dd7aa044b1b1cd3c742cb4a1c267cc4ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Tue, 29 Nov 2011 15:39:11 +0100 Subject: [PATCH 251/470] [ADD] page view split out from form view bzr revid: rlo@openerp.com-20111129143911-ac4ptj0nh2nsbdqo --- addons/web/__openerp__.py | 1 + addons/web/static/src/js/boot.js | 2 +- addons/web/static/src/js/view_form.js | 155 +------------------------- addons/web/static/src/js/view_page.js | 152 +++++++++++++++++++++++++ 4 files changed, 155 insertions(+), 155 deletions(-) create mode 100644 addons/web/static/src/js/view_page.js diff --git a/addons/web/__openerp__.py b/addons/web/__openerp__.py index a6eaa32b3cd..433bebb5429 100644 --- a/addons/web/__openerp__.py +++ b/addons/web/__openerp__.py @@ -42,6 +42,7 @@ "static/src/js/data_import.js", "static/src/js/search.js", "static/src/js/view_form.js", + "static/src/js/view_page.js", "static/src/js/view_list.js", "static/src/js/view_list_editable.js", "static/src/js/view_tree.js", diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js index 58dcd922ea9..c2aea24276b 100644 --- a/addons/web/static/src/js/boot.js +++ b/addons/web/static/src/js/boot.js @@ -59,7 +59,7 @@ openerp.web = function(instance) { openerp.web.formats(instance); openerp.web.chrome(instance); openerp.web.data(instance); - var files = ["views","search","list","form","list_editable","web_mobile","view_tree","data_export","data_import","view_editor"]; + var files = ["views","search","list","form", "page","list_editable","web_mobile","view_tree","data_export","data_import","view_editor"]; for(var i=0; i Date: Tue, 29 Nov 2011 15:43:05 +0100 Subject: [PATCH 252/470] ci before merge bzr revid: ahu@openerp.com-20111129144305-98tbd9ur7ksk37n9 --- addons/web/static/src/css/base.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 4bd920eb3ab..44d7ac89c8b 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1113,12 +1113,17 @@ label.error { } /* Uneditable Form View */ +.openerp .oe_form_readonly { + +} .openerp .oe_form_readonly .field_char, .openerp .oe_form_readonly .oe_form_field_email { - padding-top:4px; + padding-top:4px; + background-color:white; } .openerp .oe_form_readonly .field_selection { padding-top:2px; + background-color:white; } From a9a4f65dd3f17ef916b597ca163a226208e71c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Tue, 29 Nov 2011 15:58:10 +0100 Subject: [PATCH 253/470] [ADD] page view template split out from form template bzr revid: rlo@openerp.com-20111129145810-5l47j142zrn1ki50 --- addons/web/static/src/js/view_page.js | 1 + addons/web/static/src/xml/base.xml | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/view_page.js b/addons/web/static/src/js/view_page.js index cfa6f41e7ba..325f2bf7444 100644 --- a/addons/web/static/src/js/view_page.js +++ b/addons/web/static/src/js/view_page.js @@ -2,6 +2,7 @@ openerp.web.page = function (openerp) { openerp.web.views.add('page', 'openerp.web.PageView'); openerp.web.PageView = openerp.web.FormView.extend({ + form_template: "PageView", init: function () { this._super.apply(this, arguments); this.registry = openerp.web.form.readonly; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 1fe4d028db4..577c6b52368 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -656,11 +656,7 @@ - - -
@@ -674,6 +670,16 @@
+ + + + + + + +
From b98a370ca6fb4f4f1fbfd2052abf95e73374c2ee Mon Sep 17 00:00:00 2001 From: "Kirti Savalia (OpenERP)" Date: Wed, 30 Nov 2011 11:00:24 +0530 Subject: [PATCH 254/470] [FIX]:bad layout of dashboard lp bug: https://launchpad.net/bugs/897227 fixed bzr revid: ksa@tinyerp.com-20111130053024-tudikew3uo8zx14q --- addons/hr/hr_board.xml | 2 +- addons/hr_timesheet_sheet/board_hr_timesheet_view.xml | 2 ++ addons/mrp/board_manufacturing_view.xml | 2 +- addons/project/board_project_view.xml | 2 +- addons/project_scrum/board_project_scrum_view.xml | 2 +- addons/stock/board_warehouse_view.xml | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/hr/hr_board.xml b/addons/hr/hr_board.xml index 620f1f51c88..07fa76bba16 100644 --- a/addons/hr/hr_board.xml +++ b/addons/hr/hr_board.xml @@ -8,7 +8,7 @@ form - + diff --git a/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml b/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml index 39ab5fe3482..88e56ec6639 100644 --- a/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml +++ b/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml @@ -41,7 +41,9 @@ form + + diff --git a/addons/mrp/board_manufacturing_view.xml b/addons/mrp/board_manufacturing_view.xml index 427780f344c..55deb48a83d 100644 --- a/addons/mrp/board_manufacturing_view.xml +++ b/addons/mrp/board_manufacturing_view.xml @@ -7,7 +7,7 @@ form - + diff --git a/addons/project/board_project_view.xml b/addons/project/board_project_view.xml index a58557c94ba..50fa1b4f613 100644 --- a/addons/project/board_project_view.xml +++ b/addons/project/board_project_view.xml @@ -81,7 +81,7 @@ form - + diff --git a/addons/project_scrum/board_project_scrum_view.xml b/addons/project_scrum/board_project_scrum_view.xml index 2a9d3532b2d..dd01832b575 100644 --- a/addons/project_scrum/board_project_scrum_view.xml +++ b/addons/project_scrum/board_project_scrum_view.xml @@ -76,7 +76,7 @@ form - + diff --git a/addons/stock/board_warehouse_view.xml b/addons/stock/board_warehouse_view.xml index 3c645aecb5b..43600c1201d 100644 --- a/addons/stock/board_warehouse_view.xml +++ b/addons/stock/board_warehouse_view.xml @@ -45,7 +45,7 @@ form - + From a65a26d178ba59f5ea0cc5f41a858f6417939ac1 Mon Sep 17 00:00:00 2001 From: "Amit Bhavsar (Open ERP)" Date: Wed, 30 Nov 2011 11:04:26 +0530 Subject: [PATCH 255/470] [polish3],rename the string and remove col bzr revid: amb@tinyerp.com-20111130053426-3wjau1hcgmagq6hm --- addons/survey/survey_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index 0188d9555e8..26b19eeccd9 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -37,7 +37,7 @@ - + From a7c5f12504209b6f2b022dcbd525253e4cd13172 Mon Sep 17 00:00:00 2001 From: "Bharat (OpenERP)" Date: Wed, 30 Nov 2011 12:57:59 +0530 Subject: [PATCH 256/470] [FIX] account : Account voucher: Analytic account associated with write off entries while payment does not consider lp bug: https://launchpad.net/bugs/893977 fixed bzr revid: bde@tinyerp.com-20111130072759-n1oqq2dg2l3j313k --- addons/account_voucher/account_voucher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index fd6dac9f90d..a0d2b4660cb 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -935,6 +935,7 @@ class account_voucher(osv.osv): move_line = {} voucher_brw = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context) + analytic_id = voucher_brw.analytic_id.id or False current_currency_obj = voucher_brw.currency_id or voucher_brw.journal_id.company_id.currency_id if not currency_obj.is_zero(cr, uid, current_currency_obj, line_total): @@ -958,6 +959,7 @@ class account_voucher(osv.osv): 'debit': diff < 0 and -diff or 0.0, 'amount_currency': company_currency <> current_currency and voucher_brw.writeoff_amount or False, 'currency_id': company_currency <> current_currency and current_currency or False, + 'analytic_account_id': analytic_id } return move_line From d41bdb5ef6c78684d0f61949cdb0e3b4b18af5bb Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 30 Nov 2011 09:27:49 +0100 Subject: [PATCH 257/470] [IMP] Kanban: convert date string to js Date object for raw_value of date From 5f9c91621bb43f26a5a68f90a805bc2b55e69411 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 30 Nov 2011 11:03:47 +0100 Subject: [PATCH 263/470] [IMP] add some tests to format's intersperse (from corresponding server tests) bzr revid: xmo@openerp.com-20111130100347-8jd8nugnjgtj12oj --- addons/web/static/test/formats.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/web/static/test/formats.js b/addons/web/static/test/formats.js index f9f34dd44c0..cde11a188c0 100644 --- a/addons/web/static/test/formats.js +++ b/addons/web/static/test/formats.js @@ -113,6 +113,8 @@ $(document).ready(function () { equal(g("12345678", [2, 0, 1], '.'), '12.34.56.78'); equal(g("12345678", [2, 0, 0], '.'), '12.34.56.78'); equal(g("12345678", [2, 0, -1], '.'), '12.34.56.78'); + equal(g("12345678", [3,3,3,3], '.'), '12.345.678'); + equal(g("12345678", [3,0], '.'), '12.345.678'); }); test('format_integer', function () { openerp.web._t.database.parameters.grouping = [3, 3, 3, 3]; From bb67abe9140d73f6c8ad4c25eefc9d38be777485 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 30 Nov 2011 11:11:10 +0100 Subject: [PATCH 264/470] [IMP] account_voucher: improvements inj usability + changed the semantic of the payment_rate, which now depicts the rate of the payment_rate_currency_id against the voucher currency (instead of the main currency) bzr revid: qdp-launchpad@openerp.com-20111130101110-p19ujgsaqgfnuv1r --- addons/account_voucher/account_voucher.py | 100 +++++++++++------- .../test/account_voucher_report.yml | 4 +- addons/account_voucher/test/case4_cad_chf.yml | 2 + .../voucher_payment_receipt_view.xml | 18 ++-- 4 files changed, 76 insertions(+), 48 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 6860665f71d..22824cb8db0 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -159,15 +159,6 @@ class account_voucher(osv.osv): res = super(account_voucher, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) doc = etree.XML(res['arch']) - # replace the label of the field payment_rate - currency_obj = self.pool.get('res.currency') - base_currency_id = currency_obj.search(cr, uid, [('rate','=',1.0),('rate_ids','=',1.0)], context=context) - symbol = base_currency_id and currency_obj.name_get(cr, uid, base_currency_id, context=context)[0][1] - string = _("Rate for this operation: 1 %s is") % symbol - payment_rate_field = doc.xpath("//field[@name='payment_rate']") - for field in payment_rate_field: - field.set('string', string) - if context.get('type', 'sale') in ('purchase', 'payment'): nodes = doc.xpath("//field[@name='partner_id']") for node in nodes: @@ -183,17 +174,25 @@ class account_voucher(osv.osv): credit += l['amount'] return abs(amount - abs(credit - debit)) - def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, context=None): + def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_currency, context=None): context = context or {} if not line_dr_ids and not line_cr_ids: return {'value':{}} line_osv = self.pool.get("account.voucher.line") line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context) line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context) - return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount)}} + + #loop into the lines to see if there is an amount allocated on a voucher line with a currency different than the voucher currency + is_multi_currency = False + for voucher_line in line_dr_ids+line_cr_ids: + if voucher_line.get('currency_id',False) != voucher_currency: + is_multi_currency = True + break + return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount), 'is_multi_currency': is_multi_currency}} def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): if not ids: return {} + currency_obj = self.pool.get('res.currency') res = {} debit = credit = 0.0 for voucher in self.browse(cr, uid, ids, context=context): @@ -201,18 +200,24 @@ class account_voucher(osv.osv): debit += l.amount for l in voucher.line_cr_ids: credit += l.amount - res[voucher.id] = abs(voucher.amount - abs(credit - debit)) + currency = voucher.currency_id or voucher.company_id.currency_id + res[voucher.id] = currency_obj.round(cr, uid, currency, abs(voucher.amount - abs(credit - debit))) return res def _paid_amount_in_company_currency(self, cr, uid, ids, name, args, context=None): if not ids: return {} res = {} - debit = credit = 0.0 + voucher_rate = company_currency_rate = 1.0 for voucher in self.browse(cr, uid, ids, context=context): - rate = voucher.currency_id.rate or voucher.company_id.currency_id.rate - if voucher.currency_id == voucher.payment_rate_currency_id: - rate = voucher.payment_rate - res[voucher.id] = voucher.amount / rate * voucher.company_id.currency_id.rate + if voucher.currency_id: + ctx = context.copy() + ctx.update({'date': voucher.date}) + voucher_rate = self.browse(cr, uid, voucher.id, context=ctx).currency_id.rate + if voucher.company_id.currency_id.id == voucher.payment_rate_currency_id.id: + company_currency_rate = voucher.payment_rate + else: + company_currency_rate = voucher.company_id.currency_id.rate + res[voucher.id] = voucher.amount / voucher_rate * company_currency_rate return res _name = 'account.voucher' @@ -275,9 +280,10 @@ class account_voucher(osv.osv): 'analytic_id': fields.many2one('account.analytic.account','Write-Off Analytic Account', readonly=True, states={'draft': [('readonly', False)]}), 'writeoff_amount': fields.function(_get_writeoff_amount, string='Reconcile Amount', type='float', readonly=True), 'payment_rate_currency_id': fields.many2one('res.currency', 'Payment Rate Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}), - 'payment_rate': fields.float('Payment Rate', digits=(12,6), required=True, readonly=True, states={'draft': [('readonly', False)]}, - help='The specific rate that will be used for this voucher for the selected currency.'), + 'payment_rate': fields.float('Exchange Rate', digits=(12,6), required=True, readonly=True, states={'draft': [('readonly', False)]}, + help='The specific rate that will be used, in this voucher, between the selected currency (in \'Payment Rate Currency\' field) and the voucher currency.'), 'paid_amount_in_company_currency': fields.function(_paid_amount_in_company_currency, string='Paid Amount in Company Currency', type='float', readonly=True), + 'is_multi_currency': fields.boolean('Multi Currency Voucher', help='Fields with internal purpose only that depicts if the voucher is a multi currency one or not'), } _defaults = { 'period_id': _get_period, @@ -448,10 +454,15 @@ class account_voucher(osv.osv): return default def onchange_rate(self, cr, uid, ids, rate, amount, currency_id, payment_rate_currency_id, company_id, context=None): - res = {'value': {}} - if rate and amount and currency_id and currency_id == payment_rate_currency_id: - company_rate = self.pool.get('res.company').browse(cr, uid, company_id, context=context).currency_id.rate - res['value']['paid_amount_in_company_currency'] = amount / rate * company_rate + res = {'value': {'paid_amount_in_company_currency': amount}} + company_currency = self.pool.get('res.company').browse(cr, uid, company_id, context=context).currency_id + if rate and amount and currency_id:# and currency_id == payment_rate_currency_id: + voucher_rate = self.pool.get('res.currency').browse(cr, uid, currency_id, context).rate + if company_currency.id == payment_rate_currency_id: + company_rate = rate + else: + company_rate = self.pool.get('res.company').browse(cr, uid, company_id, context=context).currency_id.rate + res['value']['paid_amount_in_company_currency'] = amount / voucher_rate * company_rate return res def onchange_amount(self, cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=None): @@ -578,6 +589,7 @@ class account_voucher(osv.osv): else: amount_original = currency_pool.compute(cr, uid, company_currency, currency_id, line.credit or line.debit or 0.0) amount_unreconciled = currency_pool.compute(cr, uid, company_currency, currency_id, abs(line.amount_residual)) + currency_id = line.currency_id and line.currency_id.id or line.company_id.currency_id.id rs = { 'name':line.move_id.name, 'type': line.credit and 'dr' or 'cr', @@ -588,6 +600,7 @@ class account_voucher(osv.osv): 'date_original':line.date, 'date_due':line.date_maturity, 'amount_unreconciled': amount_unreconciled, + 'currency_id': currency_id, } #split voucher amount by most old first, but only for lines in the same currency @@ -650,7 +663,9 @@ class account_voucher(osv.osv): res['value'].update({'period_id':pids[0]}) if payment_rate_currency_id: ctx.update({'date': date}) - payment_rate = self.pool.get('res.currency').browse(cr, uid, payment_rate_currency_id, context=ctx).rate + payment_rate = 1.0 + if payment_rate_currency_id != currency_id: + payment_rate = self.pool.get('res.currency').browse(cr, uid, payment_rate_currency_id, context=ctx).rate vals = self.onchange_payment_rate_currency(cr, uid, ids, currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context=context) vals['value'].update({'payment_rate': payment_rate}) for key in vals.keys(): @@ -674,12 +689,13 @@ class account_voucher(osv.osv): currency_id = journal.currency.id ctx = context.copy() ctx.update({'date': date}) - payment_rate = self.pool.get('res.currency').browse(cr, uid, currency_id, context=ctx).rate - vals['value'].update({'payment_rate': payment_rate}) + #on change of the journal, we need to TODO coment me + payment_rate = 1.0 + res = self.onchange_rate(cr, uid, ids, payment_rate, amount, currency_id, currency_id, company_id, context=ctx) for key in res.keys(): vals[key].update(res[key]) - if currency_id: + vals['value'].update({'payment_rate': payment_rate}) vals['value'].update({'currency_id': currency_id}) vals['value'].update({'payment_rate_currency_id': currency_id}) res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context) @@ -912,12 +928,7 @@ class account_voucher(osv.osv): # the rate specified on the voucher is for the company currency rate_between_voucher_and_base = voucher.currency_id.rate or 1.0 rate_between_base_and_company = voucher.payment_rate or 1.0 - res = amount / rate_between_voucher_and_base * rate_between_base_and_company - elif voucher.payment_rate_currency_id.id == voucher.currency_id.id: - # the rate specified on the voucher is for the voucher currency - rate_between_base_and_company = voucher.company_id.currency_id.rate or 1.0 - rate_between_voucher_and_base = voucher.payment_rate or 1.0 - res = amount / rate_between_voucher_and_base * rate_between_base_and_company + res = currency_obj.round(cr, uid, voucher.company_id.currency_id, (amount / rate_between_voucher_and_base * rate_between_base_and_company)) else: # the rate specified on the voucher is not relevant, we use all the rates in the system res = currency_obj.compute(cr, uid, voucher.currency_id.id, voucher.company_id.currency_id.id, amount, context=context) @@ -997,7 +1008,7 @@ class account_voucher(osv.osv): if not (tax_data.base_code_id and tax_data.tax_code_id): raise osv.except_osv(_('No Account Base Code and Account Tax Code!'),_("You have to configure account base code and account tax code on the '%s' tax!") % (tax_data.name)) - # compute the amount in foreign currency. + # compute the amount in foreign currency amount_currency = False if line.move_line_id: # We want to set it on the account move line as soon as the original line had a foreign currency @@ -1200,6 +1211,20 @@ class account_voucher_line(osv.osv): rs_data[line.id] = res return rs_data + def _currency_id(self, cr, uid, ids, name, args, context=None): + ''' + This function returns the currency id of a voucher line. It's either the currency of the + associated move line (if any) or the currency of the voucher or the company currency. + ''' + res = {} + for line in self.browse(cr, uid, ids, context=context): + move_line = line.move_line_id + if move_line: + res[line.id] = move_line.currency_id and move_line.currency_id.id or move_line.company_id.currency_id.id + else: + res[line.id] = line.voucher_id.currency_id and line.voucher_id.currency_id.id or line.voucher_id.company_id.currency_id.id + return res + _columns = { 'voucher_id':fields.many2one('account.voucher', 'Voucher', required=1, ondelete='cascade'), 'name':fields.char('Description', size=256), @@ -1216,6 +1241,7 @@ class account_voucher_line(osv.osv): 'amount_original': fields.function(_compute_balance, multi='dc', type='float', string='Original Amount', store=True), 'amount_unreconciled': fields.function(_compute_balance, multi='dc', type='float', string='Open Balance', store=True), 'company_id': fields.related('voucher_id','company_id', relation='res.company', type='many2one', string='Company', store=True, readonly=True), + 'currency_id': fields.function(_currency_id, string='Currency', type='many2one', relation='res.currency', readonly=True), } _defaults = { 'name': '', @@ -1252,10 +1278,10 @@ class account_voucher_line(osv.osv): ttype = 'dr' else: ttype = 'cr' - account_id = move_line.account_id.id res.update({ - 'account_id':account_id, - 'type': ttype + 'account_id': move_line.account_id.id, + 'type': ttype, + 'currency_id': move_line.currency_id and move_line.currency_id.id or move_line.company_id.currency_id.id, }) return { 'value':res, diff --git a/addons/account_voucher/test/account_voucher_report.yml b/addons/account_voucher/test/account_voucher_report.yml index b41c33e4470..85432f747aa 100644 --- a/addons/account_voucher/test/account_voucher_report.yml +++ b/addons/account_voucher/test/account_voucher_report.yml @@ -1,7 +1,7 @@ - Demo for Account Voucher - - !record {model: account.voucher, id: account_voucher_voucheraxelor0}: + !record {model: account.voucher, id: account_voucher_voucheraxelor0again}: account_id: account.cash company_id: base.main_company journal_id: account.bank_journal @@ -19,6 +19,6 @@ - !python {model: account.voucher}: | import netsvc, tools, os - (data, format) = netsvc.LocalService('report.voucher.cash_receipt.drcr').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {}) + (data, format) = netsvc.LocalService('report.voucher.cash_receipt.drcr').create(cr, uid, [ref("account_voucher_voucheraxelor0again")], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account_voucher-report.'+format), 'wb+').write(data) diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml index 7c0f9274ff8..f31a7393a8e 100644 --- a/addons/account_voucher/test/case4_cad_chf.yml +++ b/addons/account_voucher/test/case4_cad_chf.yml @@ -128,6 +128,8 @@ for item in voucher_id.line_cr_ids: if item.amount_unreconciled == 186.74: data += [(item.id, 186.74)] + else: + data += [(item.id, 0.0)] for line_id, amount in data: self.pool.get('account.voucher.line').write(cr, uid, [line_id], {'amount': amount}) assert (voucher_id.state=='draft'), "Voucher is not in draft state" diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index db7c9d9ec54..6ed7ab0fe7c 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -92,7 +92,7 @@ - + - + - + @@ -203,11 +203,11 @@ - + - + @@ -318,7 +318,7 @@ - + - + - + - + From 4cb6d48f1ff5fa21244396768ed82860f7ceb4a6 Mon Sep 17 00:00:00 2001 From: "Jiten (OpenERP)" Date: Wed, 30 Nov 2011 16:56:14 +0530 Subject: [PATCH 265/470] [IMP] Improve m2m and o2m to show selected record in formview. bzr revid: jra@tinyerp.com-20111130112614-qrkmra8rzok7nksn --- .../web_mobile/static/src/js/form_mobile.js | 136 ++++++------------ .../web_mobile/static/src/xml/web_mobile.xml | 19 +-- 2 files changed, 47 insertions(+), 108 deletions(-) diff --git a/addons/web_mobile/static/src/js/form_mobile.js b/addons/web_mobile/static/src/js/form_mobile.js index cc816b75a21..13ff38bca5c 100644 --- a/addons/web_mobile/static/src/js/form_mobile.js +++ b/addons/web_mobile/static/src/js/form_mobile.js @@ -41,13 +41,13 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ var fields = result.fields; var view_fields = result.arch.children; var get_fields = this.get_fields(view_fields); + var values = self.datarecord; for (var j = 0; j < view_fields.length; j++) { if (view_fields[j].tag == 'notebook') { var notebooks = view_fields[j]; } } - self.$element.html(self.render({'get_fields': get_fields, 'notebooks': notebooks || false, 'fields' : fields, 'values' : self.datarecord ,'temp_flag':'1'})); - self.formatdata(get_fields, fields, result, self.datarecord,self.element_id,'element'); + self.$element.html(self.render({'get_fields': get_fields, 'notebooks': notebooks || false, 'fields' : fields, 'values' : values ,'temp_flag':'1'})); self.$element.find("[data-role=header]").find('h1').html(self.head_title); self.$element.find("[data-role=header]").find('#home').click(function(){ $.mobile.changePage("#oe_menu", "slide", false, true); @@ -55,110 +55,56 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').each(function(i){ for (var k = 0; k < notebooks.children.length; k++) { if (notebooks.children[k].attrs.string == $(this).attr('id')) { - get_fields = self.get_fields(notebooks.children[k].children); - for (var i = 0; i < get_fields.length; i++) { - if (fields[get_fields[i].attrs.name].type == 'one2many'){ - self.relational_fields = get_fields[i].attrs.name; - if(fields[get_fields[i].attrs.name].views.form){ - var get_fields_test = self.get_fields(fields[get_fields[i].attrs.name].views.form.arch.children); - var fields_test = fields[get_fields[i].attrs.name]['views'].form.fields; - var notebook=fields[get_fields[i].attrs.name].views.form.arch; - } - } - } - $(this).find('div#page_content').html(self.render({'get_fields': get_fields,'fields' : result.fields, 'values' : self.datarecord})); + get_fields_notebook = self.get_fields(notebooks.children[k].children); + $(this).find('div#page_content').html(self.render({'get_fields': get_fields_notebook,'fields' : fields, 'values' : values})); } - self.formatdata(get_fields, fields, result, self.datarecord,'page_content','element'); } }); - self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').find('div#page_content').find('[data-role=content]').find('ul').find('li').click(function(ev){ + self.$element.find('#o2m_m2m').click(function(ev) { ev.preventDefault(); ev.stopPropagation(); - var latid,lastid; - $(this).parents().each(function(){ - latid = $(this).attr('id'); - self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').each(function(){ - if(latid==$(this).attr('id')){ - lastid = $(this).attr('id'); - } - }); - }); var relational = $(this).attr('for'); - if(result.fields[relational]){ - var head = $.trim($(this).text()); - var dataset = new openerp.web.DataSetSearch(self, result.fields[relational].relation, result.fields[relational].context); - dataset.domain=[['id', 'in', self.datarecord[relational]]]; - dataset.read_slice([], {limit:80}, function(result1,ids){ + var rel_field = fields[relational]; + var head = rel_field.string; + var rel_model = rel_field.relation; + var rel_ids = values[relational]; + if (rel_ids) { + var datasearch = new openerp.web.DataSetSearch(self, rel_field.relation, rel_field.context); + datasearch.domain=[['id', 'in', rel_ids]]; + datasearch.read_slice([], {limit:80}, function(listrec){ _.extend(self.action.context,{"html_name_get" : true}); - var dataset1 = new openerp.web.DataSet(self, result.fields[relational].relation,result.fields[relational].context); - dataset1.name_get(result1,function(res){ - var additional = ""; - if(res['html_name_get']){ - additional = res['display']; - } - if(!$('[id^="oe_list_'+relational+'_'+self.element_id+'"]').html()){ - $('
').appendTo('#moe'); - $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').html(openerp.web.qweb.render("ListView", {'records' : res,'data': additional})); - $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=header]").find('h1').html(head); - $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=header]").find('#home').click(function(){ - $.mobile.changePage("#oe_menu", "slide", false, true); - }); - $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("a#list-id").click(function(ev){ - ev.preventDefault(); - ev.stopPropagation(); - var head_title = $(this).text(); - var listid = $(ev.currentTarget).data('id'); - dataset = new openerp.web.DataSetSearch(self, dataset.model, null, null); - dataset.read_slice([],{}, function (result_relational) { - for (var i = 0; i < result_relational.length; i++) { - if (result_relational[i].id == listid) { - var data_relational = result_relational[i]; - } - } - if(!$('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').html()){ - $('
').appendTo('#moe'); - for (var k = 0; k < notebooks.children.length; k++) { - if (notebooks.children[k].attrs.string == lastid) { - get_fields = self.get_fields(notebooks.children[k].children); - for (var i = 0; i < get_fields.length; i++) { - if (fields[get_fields[i].attrs.name].type == 'one2many'){ - self.relational_fields = get_fields[i].attrs.name; - if(fields[get_fields[i].attrs.name].views.form){ - var get_fields_test = self.get_fields(fields[get_fields[i].attrs.name].views.form.arch.children); - var fields_test = fields[get_fields[i].attrs.name]['views'].form.fields; - var notebook=fields[get_fields[i].attrs.name].views.form.arch; - } - } - } - } - } - if(notebook){ - $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').html(self.render({'get_fields': get_fields_test, 'notebooks': false, 'fields' : fields_test, 'values' : data_relational, 'temp_flag':'1' })); - }else{ - $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').html(self.render({'get_fields': get_fields_test, 'notebooks': false, 'fields' : fields, 'values' : data_relational, 'temp_flag':'1' })); - } - $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=header]").find('h1').html(head_title); - $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=header]").find('#home').click(function(){ - $.mobile.changePage("#oe_menu", "slide", false, true); - }); - if(notebook){ - self.formatdata(get_fields_test, fields_test, result, data_relational,'oe_form_'+listid+result.fields[relational].relation,'element'); - }else{ - self.formatdata(get_fields_test, fields, result, data_relational,'oe_form_'+listid+result.fields[relational].relation,'element'); - } - $.mobile.changePage('#oe_form_'+listid+result.fields[relational].relation, "slide", false, true); - self.formatdata('', '', '', '','oe_form_'+listid+result.fields[relational].relation,'slider'); + var dataset = new openerp.web.DataSet(self, rel_field.relation,rel_field.context); + dataset.name_get(listrec,function(res){ + var additional = ""; + if(res['html_name_get']){ + additional = res['display']; + } + if(!$('[id^="oe_list_'+relational+'_'+self.element_id+'"]').html()){ + $('
').appendTo('#moe'); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').html(openerp.web.qweb.render("ListView", {'records' : res,'data': additional})); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=header]").find('h1').html(head); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=header]").find('#home').click(function(){ + $.mobile.changePage("#oe_menu", "slide", false, true); + }); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("a#list-id").click(function(ev){ + ev.preventDefault(); + ev.stopPropagation(); + var head_title = $(this).text(); + var listid = $(ev.currentTarget).data('id'); + if(!$('[id^="oe_form_'+listid+rel_field.relation+'"]').html()){ + $('
').appendTo('#moe'); + this.formview = new openerp.web_mobile.FormView(self, "oe_form_"+listid+rel_field.relation, listid, '', head, rel_field.relation, false); + this.formview.start(); }else{ - $.mobile.changePage('#oe_form_'+listid+result.fields[relational].relation, "slide", false, true); + $.mobile.changePage('#oe_form_'+listid+rel_field.relation, "slide", false, true); } }); - }); - $.mobile.changePage("#oe_list_"+relational+"_"+self.element_id, "slide", false, true); - }else{ - $.mobile.changePage("#oe_list_"+relational+"_"+self.element_id, "slide", false, true); - } + $.mobile.changePage("#oe_list_"+relational+"_"+self.element_id, "slide", false, true); + }else{ + $.mobile.changePage("#oe_list_"+relational+"_"+self.element_id, "slide", false, true); + } }); - }); + }); } }); self.$element.find('#m2o_btn').click(this.open_m2o_form); diff --git a/addons/web_mobile/static/src/xml/web_mobile.xml b/addons/web_mobile/static/src/xml/web_mobile.xml index 1deb752cab6..f94117e6e0e 100644 --- a/addons/web_mobile/static/src/xml/web_mobile.xml +++ b/addons/web_mobile/static/src/xml/web_mobile.xml @@ -279,7 +279,9 @@ @@ -296,24 +298,15 @@ - + - - -
From c5c88c43c07dfb2ef2f3def2bd9441a3cbd1fba0 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 30 Nov 2011 13:02:39 +0100 Subject: [PATCH 266/470] [FIX] document: removed dangerous and useless commits These commits were introduce mostly at revision 1849.1.1 revid:hmo@tinyerp.com-20081111052750-zqzvr6oaihvt103t in an attempt to fix an issue with transactions originating from FTP connections. This was wrong: the virtual FTP filesystem should perform its own transaction management for each operation, just like the RPC layer does it for each request. Forcing a commit in the business code during the course of a normal transaction is totally *forbidden*! In addition, the FTP layer now properly manages its transactions, so the commit calls were useless anyway. bzr revid: odo@openerp.com-20111130120239-5fcavvpd14w056zb --- addons/document/document.py | 2 -- addons/document/test/document_test2.yml | 1 - 2 files changed, 3 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 1bf177f50e6..36b10b34e4b 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -254,7 +254,6 @@ class document_file(osv.osv): del vals['file_size'] if ids and vals: result = super(document_file,self).write(cr, uid, ids, vals, context=context) - cr.commit() # ? return result def create(self, cr, uid, vals, context=None): @@ -299,7 +298,6 @@ class document_file(osv.osv): else: #raise osv.except_osv(_('ValidateError'), _('File name must be unique!')) result = super(document_file, self).create(cr, uid, vals, context) - cr.commit() # ? return result def __get_partner_id(self, cr, uid, res_model, res_id, context=None): diff --git a/addons/document/test/document_test2.yml b/addons/document/test/document_test2.yml index 65312eaf10d..be91bfb3644 100644 --- a/addons/document/test/document_test2.yml +++ b/addons/document/test/document_test2.yml @@ -80,4 +80,3 @@ - !python {model: document.directory}: | self.unlink(cr, uid, [ref('dir_tests')]) - cr.commit() From 313897186c307afec4b5211f7db9df42c5f83844 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 30 Nov 2011 13:02:44 +0100 Subject: [PATCH 267/470] [IMP] document_ftp: improve/sanitize transaction management during tests Now that spurious commits were removed in document module, the test would not run properly anymore. We do need special care with transactions when we test the FTP layer because operations on the virtual FS are done in their own transaction, and immediately committed. In order for test code and FTP operations to be able to see each other, the transactions need to be synchronized. The current test transaction needs to be rolled back or committed after reach FTP operation so it can "see" the latest changes in the database. Similarly, we must force a commit of the test transaction whenever we want the FTP layer to be able to see its effects. bzr revid: odo@openerp.com-20111130120244-3m15sxdx1x5x1q1x --- addons/document_ftp/test/document_ftp_test2.yml | 6 +++--- addons/document_ftp/test/document_ftp_test4.yml | 16 +++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/addons/document_ftp/test/document_ftp_test2.yml b/addons/document_ftp/test/document_ftp_test2.yml index 33ce1416ec8..eb86a99407d 100644 --- a/addons/document_ftp/test/document_ftp_test2.yml +++ b/addons/document_ftp/test/document_ftp_test2.yml @@ -100,11 +100,11 @@ fdata = StringIO('abcd') ftp.storbinary('STOR test2.txt', fdata) ftp.close() - cr.commit() - I look for the "test2.txt" file at the server - !python {model: ir.attachment }: | + cr.rollback() # restart transaction to see changes (FTP-FS uses its own cursor) ids = self.search(cr, uid, [('name', '=', 'test2.txt')]) assert ids, "No test2.txt file found." - @@ -116,11 +116,11 @@ ftp = te.get_ftp_folder(cr, uid, self, 'Documents') ftp.delete('test2.txt') ftp.close() - cr.commit() - I check at the server that test2.txt is deleted - !python {model: ir.attachment }: | + cr.rollback() # restart transaction to see changes (FTP-FS uses its own cursor) ids = self.search(cr, uid, [('name', '=', 'test2.txt')]) assert not ids, "test2.txt file can still be found." - @@ -133,7 +133,7 @@ fdata = StringIO('abcd') ftp.storbinary('STOR test2.txt', fdata) ftp.close() - cr.commit() + cr.rollback() # restart transaction to see changes (FTP-FS uses its own cursor) - I delete the test2.txt from the server (RPC). - diff --git a/addons/document_ftp/test/document_ftp_test4.yml b/addons/document_ftp/test/document_ftp_test4.yml index 0a3ff33333e..9b311f64605 100644 --- a/addons/document_ftp/test/document_ftp_test4.yml +++ b/addons/document_ftp/test/document_ftp_test4.yml @@ -4,7 +4,6 @@ !python {model: ir.attachment}: | from document_ftp import test_easyftp as te ftp = te.get_plain_ftp(timeout=1.0) - cr.commit() - | I create two partners 'Partner1' and 'Partner2'. I create three partner categories: 'none', 'pat1' and 'all' @@ -54,7 +53,6 @@ dirs = ftp.nlst() for dir in [ 'All Partner1+2', 'No partners', 'Pat 1' ]: assert dir in dirs, "Dir %s not in folder" % dir - cr.commit() - I create a 'partners' folder by the first resource one. - @@ -65,6 +63,8 @@ ressource_type_id: base.model_res_partner domain: "[('category_id','in',[active_id])]" ressource_parent_type_id : base.model_res_partner_category +- + I commit (because FTP operations are on different transaction) - !python {model: document.directory, id: }: | cr.commit() @@ -81,7 +81,6 @@ for dir in correct: res = ftp.nlst(dir+'/Partners of Test') assert res == correct[dir], "Dir %s falsely contains %s" %(dir, res) - cr.commit() - I create an ir.attachment, attached (not related) to Partner1 - @@ -89,6 +88,11 @@ name: File of pat1 res_model: res.partner res_id: !eval ref("tpartner1") +- + I commit (because FTP operations are on different transaction) +- + !python {model: document.directory, id: }: | + cr.commit() - I check that pat1/Partner1 folder has the file. I check that all/Partner1 folder has the file @@ -109,6 +113,7 @@ ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Partners Testing/Pat 1/Partners of Test/Partner 1') fdata = StringIO('abcd') ftp.storbinary('STOR pat1-dynamic.txt', fdata) + cr.rollback() # restart transaction to see changes (FTP-FS uses its own cursor) - I check at the server that the file is attached to Partner1 - @@ -159,7 +164,8 @@ from cStringIO import StringIO ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Partners Testing/Pat 1/Partners of Test/Partner 1') ftp.delete('pat1-dynamic.txt') - ftp.close() + ftp.close() + cr.rollback() # restart transaction to see changes (FTP-FS uses its own cursor) - I delete the Partners Testing folder, "File of pat1" file, Partner and Partner category. @@ -177,5 +183,5 @@ partner_categ_pool.unlink(cr, uid, [ref('tpat_categ_all')]) partner_pool.unlink(cr, uid, [ref('tpartner1')]) partner_pool.unlink(cr, uid, [ref('tpartner_2')]) - cr.commit() + cr.commit() #required because all the operations via FTP were committed From f56cc312e46d3f63fcd6c5e57f3fb3293855ae6e Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 30 Nov 2011 17:36:40 +0530 Subject: [PATCH 268/470] [IMP] crm_parner_assign, crm: Corrected history[whole, laetst, case info] for lead forword to its nearest partner email wizard bzr revid: ron@tinyerp.com-20111130120640-t6l8pec0fb6pehjq --- addons/crm/crm_lead.py | 2 +- addons/crm_partner_assign/wizard/crm_forward_to_partner.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 9510041d37f..cbaa917eb88 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -422,7 +422,7 @@ class crm_lead(crm_case, osv.osv): else: value = lead[field_name] - body.append("%s: %s\n" % (field.string, value or '')) + body.append("%s: %s" % (field.string, value or '')) return "\n".join(body + ['---']) def _merge_notification(self, cr, uid, opportunity_id, opportunities, context=None): diff --git a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py index 4286de91ed1..565f99b9db1 100644 --- a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py +++ b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py @@ -66,8 +66,7 @@ class crm_lead_forward_to_partner(osv.osv_memory): res_id = context.get('active_id') model = context.get('active_model') lead = self.pool.get(model).browse(cr, uid, res_id, context) - body_text = self._get_info_body_text(cr, uid, lead, context=context) - context['mail.compose.message.body'] = history_type + body_text = self._get_message_body_text(cr, uid, lead, history_type, context=context) if body_text: res = {'value': {'body_text' : body_text}} return res @@ -171,7 +170,7 @@ class crm_lead_forward_to_partner(osv.osv_memory): to = 'To: %s' % (message.email_to or '') sentdate = 'Date: %s' % (message.date or '') desc = '\n%s'%(message.body_text) - original = [header, sender, to, sentdate, desc] + original = [header, sender, to, sentdate, desc, '\n'] original = '\n'.join(original) body += original return body or '' From a7a4f50aefed52c706c8073e8248eccf98d815de Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 30 Nov 2011 13:31:54 +0100 Subject: [PATCH 269/470] [FIX] Preserve kanban views whitespaces bzr revid: fme@openerp.com-20111130123154-nhh6sj21s38ejsb5 --- addons/web/common/xml2json.py | 2 +- addons/web/controllers/main.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/web/common/xml2json.py b/addons/web/common/xml2json.py index 16022624fe7..14de0794b4d 100644 --- a/addons/web/common/xml2json.py +++ b/addons/web/common/xml2json.py @@ -31,7 +31,7 @@ class Xml2Json(object): if el.text and (not skip_whitespaces or el.text.strip() != ''): kids.append(el.text) for kid in el: - kids.append(Xml2Json.convert_element(kid)) + kids.append(Xml2Json.convert_element(kid, skip_whitespaces)) if kid.tail and (not skip_whitespaces or kid.tail.strip() != ''): kids.append(kid.tail) res["children"] = kids diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 7dbd696cfb4..d337fc240b5 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -841,12 +841,12 @@ class View(openerpweb.Controller): context = req.session.eval_context(req.context) fvg = Model.fields_view_get(view_id, view_type, context, toolbar, submenu) # todo fme?: check that we should pass the evaluated context here - self.process_view(req.session, fvg, context, transform) + self.process_view(req.session, fvg, context, transform, (view_type != 'kanban')) if toolbar and transform: self.process_toolbar(req, fvg['toolbar']) return fvg - def process_view(self, session, fvg, context, transform): + def process_view(self, session, fvg, context, transform, skip_whitespaces=True): # depending on how it feels, xmlrpclib.ServerProxy can translate # XML-RPC strings to ``str`` or ``unicode``. ElementTree does not # enjoy unicode strings which can not be trivially converted to @@ -864,7 +864,7 @@ class View(openerpweb.Controller): xml = self.transform_view(arch, session, evaluation_context) else: xml = ElementTree.fromstring(arch) - fvg['arch'] = web.common.xml2json.Xml2Json.convert_element(xml) + fvg['arch'] = web.common.xml2json.Xml2Json.convert_element(xml, skip_whitespaces) for field in fvg['fields'].itervalues(): if field.get('views'): From e3c9d0f3f4a9329bb35e0ae25947ba8c4264217e Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 30 Nov 2011 13:32:45 +0100 Subject: [PATCH 270/470] [ADD] Added oe_kanban_highlight css class bzr revid: fme@openerp.com-20111130123245-2lg9o2y87mnzg5bl --- addons/web_kanban/static/src/css/kanban.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index 1a45155058e..2fc78ba87d0 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -203,6 +203,16 @@ margin: 5px 0 0 15px; list-style: circle; } +.openerp .oe_kanban_highlight { + border-radius: 2px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + padding: 1px 5px; + margin: 1px 4px; + white-space: nowrap; + display: inline-block; + line-height: 1em; +} /* Custom colors are also present in kanban.js */ /* Custom color#0 */ From 31880bd354ff4fef552b131916869a8324c061fb Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 30 Nov 2011 13:56:02 +0100 Subject: [PATCH 271/470] [REM] buggy webneko bzr revid: xmo@openerp.com-20111130125602-yyiymjkyg062fus7 --- addons/web/static/src/css/base.css | 8 -------- addons/web/static/src/xml/base.xml | 4 ---- 2 files changed, 12 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index cad536c0f1f..d8f31af1d35 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1310,14 +1310,6 @@ label.error { background: 1px 3px url(/web/static/src/img/icons/gtk-print.png) no-repeat; } -.openerp .oe-running-kitten { - display: none; -} - -.openerp.kitten-mode-activated .oe-running-kitten { - display: inherit; -} - .openerp.kitten-mode-activated .main_table { background: url(http://placekitten.com/g/1500/800) repeat; } diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 1fe4d028db4..4264ca8dd38 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -360,10 +360,6 @@
  • -
  • - - -
  • LOGOUT From 379ab719eec090c3dc83775c9856a564948d074f Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 30 Nov 2011 18:36:14 +0530 Subject: [PATCH 272/470] [IMP] crm: After Merged oppportunity, correct value of merge_description, and Email_cc[It means Text field value have filtered] bzr revid: ron@tinyerp.com-20111130130614-s9e1a8v6hra0kmxr --- addons/crm/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index cbaa917eb88..49272c97576 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -369,7 +369,7 @@ class crm_lead(crm_case, osv.osv): return res and res.id or False def _concat_all(attr): - return ', '.join([getattr(opportunity, attr) or '' for opportunity in opportunities if hasattr(opportunity, attr)]) + return ', '.join(filter(lambda x: x, [getattr(opportunity, attr) or '' for opportunity in opportunities if hasattr(opportunity, attr)])) data = {} for field_name in fields: From b552ff1991575bf167e2fe889521aa9268ecd7fc Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 30 Nov 2011 14:11:54 +0100 Subject: [PATCH 273/470] [IMP] Seperate menu tips from action view manager's content bzr revid: fme@openerp.com-20111130131154-cu9hrcxyjvw15wnc --- addons/web/static/src/js/views.js | 6 +++--- addons/web/static/src/xml/base.xml | 28 ++++++++++++++++++---------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 582a526e57a..b19cf7a7626 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -426,8 +426,8 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner }); if (this.action.help && !this.flags.low_profile) { var Users = new session.web.DataSet(self, 'res.users'), - header = this.$element.find('.oe-view-manager-header'); - header.delegate('blockquote button', 'click', function() { + $tips = this.$element.find('.oe_view_manager_menu_tips'); + $tips.delegate('blockquote button', 'click', function() { var $this = $(this); //noinspection FallthroughInSwitchStatementJS switch ($this.attr('name')) { @@ -444,7 +444,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner if (!(user && user.id === self.session.uid)) { return; } - header.find('blockquote').toggle(user.menu_tips); + $tips.find('blockquote').toggle(user.menu_tips); }); } } diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 23fa97ce7f5..754364c6c8d 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -418,6 +418,7 @@ + +
    @@ -443,21 +444,28 @@
    + + + +
    +

    +
    + + +
    +
    + + +
    -
    -

    -
    - - -
    -
    - + From 9e965230f6b06c90931915836c12b8e01cbda905 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 30 Nov 2011 14:25:43 +0100 Subject: [PATCH 274/470] [IMP] Include star shortcut in the view title h2 element bzr revid: fme@openerp.com-20111130132543-fcl4avnrmpryaryt --- addons/web/static/src/js/views.js | 6 +++--- addons/web/static/src/xml/base.xml | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index b19cf7a7626..e8af1290e48 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -280,7 +280,7 @@ session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.View } } $.when(view_promise).then(function () { - self.$element.find('.oe_view_title:first').text( + self.$element.find('.oe_view_title_text:first').text( self.display_title()); }); return view_promise; @@ -472,10 +472,10 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner view_id = (fvg && fvg.view_id) || '--'; self.$element.find('.oe_get_xml_view span').text(view_id); if (!self.action.name && fvg) { - self.$element.find('.oe_view_title').text(fvg.arch.attrs.string || fvg.name); + self.$element.find('.oe_view_title_text').text(fvg.arch.attrs.string || fvg.name); } - var $title = self.$element.find('.oe_view_title'), + var $title = self.$element.find('.oe_view_title_text'), $search_prefix = $title.find('span.oe_searchable_view'); if (controller.searchable !== false) { if (!$search_prefix.length) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 754364c6c8d..e097c4cd771 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -423,7 +423,7 @@

    - +

    @@ -463,9 +463,11 @@ - + + + From 832436c1487ca6accf074da8e73ce5cccda51c48 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 30 Nov 2011 14:30:08 +0100 Subject: [PATCH 275/470] [IMP] account_voucher: usability changes bzr revid: qdp-launchpad@openerp.com-20111130133008-lki16nzzlz78s0h8 --- addons/account_voucher/account_voucher.py | 6 ++--- .../voucher_payment_receipt_view.xml | 24 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 22824cb8db0..999de8dfbf4 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -274,11 +274,11 @@ class account_voucher(osv.osv): 'payment_option':fields.selection([ ('without_writeoff', 'Keep Open'), ('with_writeoff', 'Reconcile Payment Balance'), - ], 'Payment Difference', required=True, readonly=True, states={'draft': [('readonly', False)]}), + ], 'Payment Difference', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="This field helps you to choose what you want to do with the eventual difference between the paid amount and the sum of allocated amounts. You can either choose to keep open this difference on the partner's account, or reconcile it with the payment(s)"), 'writeoff_acc_id': fields.many2one('account.account', 'Counterpart Account', readonly=True, states={'draft': [('readonly', False)]}), 'comment': fields.char('Counterpart Comment', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}), 'analytic_id': fields.many2one('account.analytic.account','Write-Off Analytic Account', readonly=True, states={'draft': [('readonly', False)]}), - 'writeoff_amount': fields.function(_get_writeoff_amount, string='Reconcile Amount', type='float', readonly=True), + 'writeoff_amount': fields.function(_get_writeoff_amount, string='Difference Amount', type='float', readonly=True, help="Computed as the difference between the amount stated in the voucher and the sum of allocation on the voucher lines."), 'payment_rate_currency_id': fields.many2one('res.currency', 'Payment Rate Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'payment_rate': fields.float('Exchange Rate', digits=(12,6), required=True, readonly=True, states={'draft': [('readonly', False)]}, help='The specific rate that will be used, in this voucher, between the selected currency (in \'Payment Rate Currency\' field) and the voucher currency.'), @@ -1231,7 +1231,7 @@ class account_voucher_line(osv.osv): 'account_id':fields.many2one('account.account','Account', required=True), 'partner_id':fields.related('voucher_id', 'partner_id', type='many2one', relation='res.partner', string='Partner'), 'untax_amount':fields.float('Untax Amount'), - 'amount':fields.float('Amount', digits_compute=dp.get_precision('Account')), + 'amount':fields.float('Allocation', digits_compute=dp.get_precision('Account')), 'reconcile': fields.boolean('Full Reconcile'), 'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Dr/Cr'), 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'), diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 6ed7ab0fe7c..e2060a04533 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -102,8 +102,8 @@ - - + + @@ -116,8 +116,8 @@ - - + + @@ -177,9 +177,9 @@ - + - + @@ -193,9 +193,9 @@ - + - + @@ -329,9 +329,9 @@ - + - + @@ -345,9 +345,9 @@ - + - + From 8dcc7aac7ae32007795cf9c44f4a725a2c248404 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 30 Nov 2011 14:33:11 +0100 Subject: [PATCH 276/470] [IMP] account_voucher: usability changes bzr revid: qdp-launchpad@openerp.com-20111130133311-8t4sxrikywrkkkhh --- addons/account_voucher/voucher_payment_receipt_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index e2060a04533..13cbaa74688 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -252,7 +252,7 @@