From 813e10402a4f62d0a5a63fde39ec7a7cc6a988c0 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Mon, 7 Dec 2009 22:39:22 +0100 Subject: [PATCH 01/21] [IMP] PEP8 complaint and add docstring bzr revid: christophe.chauvet@syleam.fr-20091207213922-zx3mfh9tfdkg4zj2 --- addons/multi_company/__init__.py | 2 - addons/multi_company/multi_company.py | 56 +++++++++++++++++---------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/addons/multi_company/__init__.py b/addons/multi_company/__init__.py index e96ecdf56e6..5856adc9616 100644 --- a/addons/multi_company/__init__.py +++ b/addons/multi_company/__init__.py @@ -21,7 +21,5 @@ import multi_company - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/multi_company/multi_company.py b/addons/multi_company/multi_company.py index a55e28f51a2..8a4af4f9499 100644 --- a/addons/multi_company/multi_company.py +++ b/addons/multi_company/multi_company.py @@ -18,35 +18,51 @@ # along with this program. If not, see . # ############################################################################## -from mx import DateTime -import time -import netsvc -from osv import fields, osv -from tools import config -from tools.translate import _ -import tools + +""" +The multicompany module add management to easily custom value by default +for each company +""" + +from osv import osv +from osv import fields class multi_company_default(osv.osv): + """ + Manage multi company default value + """ _name = 'multi_company.default' + _description = 'Default multi company' _order = 'sequence,id' + _columns = { - 'sequence': fields.integer('Sequence'), - 'name': fields.char('Name', size=32, required=True), - 'company_id': fields.many2one('res.company', 'Main Company', required=True), - 'company_dest_id': fields.many2one('res.company', 'Default Company', required=True), - 'object_id': fields.many2one('ir.model', 'Object', required=True), - 'expression': fields.char('Expression', size=32, required=True), - } + 'sequence': fields.integer('Sequence'), + 'name': fields.char('Name', size=32, required=True), + 'company_id': fields.many2one('res.company', 'Main Company', required=True), + 'company_dest_id': fields.many2one('res.company', 'Default Company', required=True), + 'object_id': fields.many2one('ir.model', 'Object', required=True), + 'expression': fields.char('Expression', size=32, required=True), + } + _defaults = { - 'expression': lambda *a: 'True', - 'sequence': lambda *a: 1 - } + 'expression': lambda *a: 'True', + 'sequence': lambda *a: 1 + } + multi_company_default() class res_company(osv.osv): + """ + Change method to retrieve the company by default + """ _inherit = 'res.company' - - def _company_default_get(self, cr, uid, object=False, context={}): + + def _company_default_get(self, cr, uid, object=False, context=None): + """ + Check if the object for this company have a default value + """ + if not context: + context = {} proxy = self.pool.get('multi_company.default') ids = proxy.search(cr, uid, [('object_id.model', '=', object)]) for rule in proxy.browse(cr, uid, ids, context): @@ -54,7 +70,7 @@ class res_company(osv.osv): if eval(rule.expression, {'context': context, 'user': user}): return rule.company_dest_id.id return super(res_company, self)._company_default_get(cr, uid, object, context) - + res_company() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 50bdc196101589e722043c4b3abcd632a016956c Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Mon, 7 Dec 2009 22:42:13 +0100 Subject: [PATCH 02/21] [IMP] Add priority field [IMP] Cut the menuitem line too long bzr revid: christophe.chauvet@syleam.fr-20091207214213-x81audj8xwv4rl12 --- addons/multi_company/multi_company_view.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/multi_company/multi_company_view.xml b/addons/multi_company/multi_company_view.xml index baac5b322d4..49594a3df8a 100644 --- a/addons/multi_company/multi_company_view.xml +++ b/addons/multi_company/multi_company_view.xml @@ -5,6 +5,7 @@ multi_company.default.tree multi_company.default tree + @@ -20,6 +21,7 @@ multi_company.default.form multi_company.default form +
@@ -31,15 +33,17 @@
- + Multi Company ir.actions.act_window multi_company.default form - - - + + + From a5aa5ca822befa9264ede0f7763e18531f22e0f0 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Mon, 7 Dec 2009 22:46:33 +0100 Subject: [PATCH 03/21] [IMP]Complete to pass test for module quality successfully bzr revid: christophe.chauvet@syleam.fr-20091207214633-xnjuvmei5p0qiul4 --- addons/multi_company/__terp__.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/addons/multi_company/__terp__.py b/addons/multi_company/__terp__.py index c2728db3a61..378b9d7c951 100644 --- a/addons/multi_company/__terp__.py +++ b/addons/multi_company/__terp__.py @@ -24,13 +24,23 @@ 'name': 'Multi Company', 'version': '1.0', 'category': 'Custom', - 'description': " ", + 'description': """This module add the possibility to easily manage + the default value for each object + """, 'author': 'Tiny', - 'depends': ['base','sale','project'], + 'website': 'http://www.openerp.com/', + 'depends': [ + 'base', + 'sale', + 'project' + ], + 'init_xml': [], 'update_xml': [ 'multi_company_view.xml', ], - 'demo_xml': ['multi_company_demo.xml'], + 'demo_xml': [ + 'multi_company_demo.xml' + ], 'installable': True, 'active': False, } From c7667674f964e7a9b6b195988a4f0c5add385786 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Mon, 7 Dec 2009 22:50:11 +0100 Subject: [PATCH 04/21] [ADD] Security rules on multicompany bzr revid: christophe.chauvet@syleam.fr-20091207215011-ucd3aqlsnfoumjfv --- addons/multi_company/__terp__.py | 1 + addons/multi_company/security/ir.model.access.csv | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 addons/multi_company/security/ir.model.access.csv diff --git a/addons/multi_company/__terp__.py b/addons/multi_company/__terp__.py index 378b9d7c951..d54acabd3b7 100644 --- a/addons/multi_company/__terp__.py +++ b/addons/multi_company/__terp__.py @@ -36,6 +36,7 @@ ], 'init_xml': [], 'update_xml': [ + 'security/ir.model.access.csv', 'multi_company_view.xml', ], 'demo_xml': [ diff --git a/addons/multi_company/security/ir.model.access.csv b/addons/multi_company/security/ir.model.access.csv new file mode 100644 index 00000000000..3ea1d07dcad --- /dev/null +++ b/addons/multi_company/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_multi_company_default user","multi_company_default User","multi_company.model_multi_company_default","base.group_user",1,0,0,0 From 4dfab1ce7d602ca5fcf7ab803f6ea1433196a277 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Mon, 7 Dec 2009 22:57:07 +0100 Subject: [PATCH 05/21] [ADD] Add translation on multi company module bzr revid: christophe.chauvet@syleam.fr-20091207215707-2v806tpkc9s7eq0g --- addons/multi_company/i18n/fr.po | 134 ++++++++++++++++++++ addons/multi_company/i18n/multi_company.pot | 131 +++++++++++++++++++ 2 files changed, 265 insertions(+) create mode 100644 addons/multi_company/i18n/fr.po create mode 100644 addons/multi_company/i18n/multi_company.pot diff --git a/addons/multi_company/i18n/fr.po b/addons/multi_company/i18n/fr.po new file mode 100644 index 00000000000..324dc0494a8 --- /dev/null +++ b/addons/multi_company/i18n/fr.po @@ -0,0 +1,134 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * multi_company +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-12-07 21:51:04+0000\n" +"PO-Revision-Date: 2009-12-07 22:56+0100\n" +"Last-Translator: Christophe Chauvet \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Translate Toolkit 1.3.0\n" + +#. module: multi_company +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invalide pour cette vue!" + +#. module: multi_company +#: field:multi_company.default,object_id:0 +msgid "Object" +msgstr "Objet" + +#. module: multi_company +#: constraint:ir.model:0 +msgid "The Object name must start with x_ and not contain any special character !" +msgstr "" + +#. module: multi_company +#: field:multi_company.default,company_dest_id:0 +msgid "Default Company" +msgstr "Société par défaut" + +#. module: multi_company +#: constraint:product.template:0 +msgid "Error: UOS must be in a different category than the UOM" +msgstr "" + +#. module: multi_company +#: model:product.category,name:multi_company.Odoo1 +msgid "Odoo Offers" +msgstr "Offres Odoo" + +#. module: multi_company +#: constraint:res.company:0 +msgid "Error! You can not create recursive companies." +msgstr "Erreur! Vous ne pouvez pas créer de sociétés récursives." + +#. module: multi_company +#: model:ir.model,name:multi_company.model_multi_company_default +msgid "multi_company.default" +msgstr "multi_company.default" + +#. module: multi_company +#: constraint:product.category:0 +msgid "Error ! You can not create recursive categories." +msgstr "" + +#. module: multi_company +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" + +#. module: multi_company +#: field:multi_company.default,company_id:0 +msgid "Main Company" +msgstr "Société principale" + +#. module: multi_company +#: model:ir.actions.act_window,name:multi_company.action_inventory_form +#: model:ir.module.module,shortdesc:multi_company.module_meta_information +#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form +#: view:multi_company.default:0 +msgid "Multi Company" +msgstr "Multi société" + +#. module: multi_company +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "Erreur: code EAN invalide" + +#. module: multi_company +#: model:ir.module.module,description:multi_company.module_meta_information +msgid "" +"This module add the possibility to easily manage \n" +" the default value for each object\n" +" " +msgstr "" +"Ce module ajoute la possibilité de gérer facilement \n" +" les valeurs par défaut de chaques objets\n" +" " + +#. module: multi_company +#: constraint:res.partner:0 +msgid "The VAT doesn't seem to be correct." +msgstr "" + +#. module: multi_company +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "" + +#. module: multi_company +#: field:multi_company.default,sequence:0 +msgid "Sequence" +msgstr "Séquence" + +#. module: multi_company +#: model:res.company,overdue_msg:multi_company.res_company_odoo +#: model:res.company,overdue_msg:multi_company.res_company_oerp_be +#: model:res.company,overdue_msg:multi_company.res_company_oerp_editor +#: model:res.company,overdue_msg:multi_company.res_company_oerp_in +#: model:res.company,overdue_msg:multi_company.res_company_oerp_us +msgid "Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting department" +msgstr "" + +#. module: multi_company +#: model:product.template,name:multi_company.product_product_odoo1_product_template +msgid "Odoo Offer" +msgstr "Offre Odoo" + +#. module: multi_company +#: field:multi_company.default,expression:0 +msgid "Expression" +msgstr "Expression" + +#. module: multi_company +#: field:multi_company.default,name:0 +msgid "Name" +msgstr "Nom" + diff --git a/addons/multi_company/i18n/multi_company.pot b/addons/multi_company/i18n/multi_company.pot new file mode 100644 index 00000000000..bd6e985b710 --- /dev/null +++ b/addons/multi_company/i18n/multi_company.pot @@ -0,0 +1,131 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * multi_company +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.6\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-12-07 21:51:04+0000\n" +"PO-Revision-Date: 2009-12-07 21:51:04+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: multi_company +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: multi_company +#: field:multi_company.default,object_id:0 +msgid "Object" +msgstr "" + +#. module: multi_company +#: constraint:ir.model:0 +msgid "The Object name must start with x_ and not contain any special character !" +msgstr "" + +#. module: multi_company +#: field:multi_company.default,company_dest_id:0 +msgid "Default Company" +msgstr "" + +#. module: multi_company +#: constraint:product.template:0 +msgid "Error: UOS must be in a different category than the UOM" +msgstr "" + +#. module: multi_company +#: model:product.category,name:multi_company.Odoo1 +msgid "Odoo Offers" +msgstr "" + +#. module: multi_company +#: constraint:res.company:0 +msgid "Error! You can not create recursive companies." +msgstr "" + +#. module: multi_company +#: model:ir.model,name:multi_company.model_multi_company_default +msgid "multi_company.default" +msgstr "" + +#. module: multi_company +#: constraint:product.category:0 +msgid "Error ! You can not create recursive categories." +msgstr "" + +#. module: multi_company +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" + +#. module: multi_company +#: field:multi_company.default,company_id:0 +msgid "Main Company" +msgstr "" + +#. module: multi_company +#: model:ir.actions.act_window,name:multi_company.action_inventory_form +#: model:ir.module.module,shortdesc:multi_company.module_meta_information +#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form +#: view:multi_company.default:0 +msgid "Multi Company" +msgstr "" + +#. module: multi_company +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "" + +#. module: multi_company +#: model:ir.module.module,description:multi_company.module_meta_information +msgid "This module add the possibility to easily manage \n" +" the default value for each object\n" +" " +msgstr "" + +#. module: multi_company +#: constraint:res.partner:0 +msgid "The VAT doesn't seem to be correct." +msgstr "" + +#. module: multi_company +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "" + +#. module: multi_company +#: field:multi_company.default,sequence:0 +msgid "Sequence" +msgstr "" + +#. module: multi_company +#: model:res.company,overdue_msg:multi_company.res_company_odoo +#: model:res.company,overdue_msg:multi_company.res_company_oerp_be +#: model:res.company,overdue_msg:multi_company.res_company_oerp_editor +#: model:res.company,overdue_msg:multi_company.res_company_oerp_in +#: model:res.company,overdue_msg:multi_company.res_company_oerp_us +msgid "Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting department" +msgstr "" + +#. module: multi_company +#: model:product.template,name:multi_company.product_product_odoo1_product_template +msgid "Odoo Offer" +msgstr "" + +#. module: multi_company +#: field:multi_company.default,expression:0 +msgid "Expression" +msgstr "" + +#. module: multi_company +#: field:multi_company.default,name:0 +msgid "Name" +msgstr "" + From 0c3ad8a1c05fff6ffc78635882de6b4bce6e0d32 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Mon, 7 Dec 2009 23:13:09 +0100 Subject: [PATCH 06/21] [ADD] Add help on each field [IMP] Update template and french translation bzr revid: christophe.chauvet@syleam.fr-20091207221309-06rr0d1srkakelyq --- addons/multi_company/i18n/fr.po | 183 +++++++++++--------- addons/multi_company/i18n/multi_company.pot | 169 ++++++++++-------- addons/multi_company/multi_company.py | 14 +- 3 files changed, 210 insertions(+), 156 deletions(-) diff --git a/addons/multi_company/i18n/fr.po b/addons/multi_company/i18n/fr.po index 324dc0494a8..5d68473837f 100644 --- a/addons/multi_company/i18n/fr.po +++ b/addons/multi_company/i18n/fr.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-12-07 21:51:04+0000\n" -"PO-Revision-Date: 2009-12-07 22:56+0100\n" +"POT-Creation-Date: 2009-12-07 22:08:12+0000\n" +"PO-Revision-Date: 2009-12-07 23:12+0100\n" "Last-Translator: Christophe Chauvet \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -15,25 +15,88 @@ msgstr "" "X-Generator: Translate Toolkit 1.3.0\n" #. module: multi_company -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "XML invalide pour cette vue!" - -#. module: multi_company -#: field:multi_company.default,object_id:0 -msgid "Object" -msgstr "Objet" +#: help:multi_company.default,object_id:0 +msgid "Object affect by this rules" +msgstr "" #. module: multi_company #: constraint:ir.model:0 msgid "The Object name must start with x_ and not contain any special character !" msgstr "" +#. module: multi_company +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" + +#. module: multi_company +#: constraint:res.partner:0 +msgid "The VAT doesn't seem to be correct." +msgstr "" + +#. module: multi_company +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "" + +#. module: multi_company +#: model:res.company,overdue_msg:multi_company.res_company_odoo +#: model:res.company,overdue_msg:multi_company.res_company_oerp_be +#: model:res.company,overdue_msg:multi_company.res_company_oerp_editor +#: model:res.company,overdue_msg:multi_company.res_company_oerp_in +#: model:res.company,overdue_msg:multi_company.res_company_oerp_us +msgid "Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting department" +msgstr "" + #. module: multi_company #: field:multi_company.default,company_dest_id:0 msgid "Default Company" msgstr "Société par défaut" +#. module: multi_company +#: field:multi_company.default,object_id:0 +msgid "Object" +msgstr "Objet" + +#. module: multi_company +#: model:ir.actions.act_window,name:multi_company.action_inventory_form +#: model:ir.module.module,shortdesc:multi_company.module_meta_information +#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form +#: view:multi_company.default:0 +msgid "Multi Company" +msgstr "Multi société" + +#. module: multi_company +#: model:ir.module.module,description:multi_company.module_meta_information +msgid "" +"This module add the possibility to easily manage \n" +" the default value for each object\n" +" " +msgstr "" +"Ce module ajoute la possibilité de gérer facilement \n" +" les valeurs par défaut de chaques objets\n" +" " + +#. module: multi_company +#: field:multi_company.default,company_id:0 +msgid "Main Company" +msgstr "Société principale" + +#. module: multi_company +#: help:multi_company.default,company_dest_id:0 +msgid "Company to store the current record" +msgstr "Société dans lequel l'enregistrement courant sera stocké" + +#. module: multi_company +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invalide pour cette vue!" + +#. module: multi_company +#: field:multi_company.default,name:0 +msgid "Name" +msgstr "Nom" + #. module: multi_company #: constraint:product.template:0 msgid "Error: UOS must be in a different category than the UOM" @@ -49,78 +112,20 @@ msgstr "Offres Odoo" msgid "Error! You can not create recursive companies." msgstr "Erreur! Vous ne pouvez pas créer de sociétés récursives." +#. module: multi_company +#: help:multi_company.default,name:0 +msgid "Name it to easily find a record" +msgstr "La nommer facilement de façon a trouver l'enregistrement" + #. module: multi_company #: model:ir.model,name:multi_company.model_multi_company_default msgid "multi_company.default" msgstr "multi_company.default" #. module: multi_company -#: constraint:product.category:0 -msgid "Error ! You can not create recursive categories." -msgstr "" - -#. module: multi_company -#: constraint:product.template:0 -msgid "Error: The default UOM and the purchase UOM must be in the same category." -msgstr "" - -#. module: multi_company -#: field:multi_company.default,company_id:0 -msgid "Main Company" -msgstr "Société principale" - -#. module: multi_company -#: model:ir.actions.act_window,name:multi_company.action_inventory_form -#: model:ir.module.module,shortdesc:multi_company.module_meta_information -#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form -#: view:multi_company.default:0 -msgid "Multi Company" -msgstr "Multi société" - -#. module: multi_company -#: constraint:product.product:0 -msgid "Error: Invalid ean code" -msgstr "Erreur: code EAN invalide" - -#. module: multi_company -#: model:ir.module.module,description:multi_company.module_meta_information -msgid "" -"This module add the possibility to easily manage \n" -" the default value for each object\n" -" " -msgstr "" -"Ce module ajoute la possibilité de gérer facilement \n" -" les valeurs par défaut de chaques objets\n" -" " - -#. module: multi_company -#: constraint:res.partner:0 -msgid "The VAT doesn't seem to be correct." -msgstr "" - -#. module: multi_company -#: constraint:ir.actions.act_window:0 -msgid "Invalid model name in the action definition." -msgstr "" - -#. module: multi_company -#: field:multi_company.default,sequence:0 -msgid "Sequence" -msgstr "Séquence" - -#. module: multi_company -#: model:res.company,overdue_msg:multi_company.res_company_odoo -#: model:res.company,overdue_msg:multi_company.res_company_oerp_be -#: model:res.company,overdue_msg:multi_company.res_company_oerp_editor -#: model:res.company,overdue_msg:multi_company.res_company_oerp_in -#: model:res.company,overdue_msg:multi_company.res_company_oerp_us -msgid "Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting department" -msgstr "" - -#. module: multi_company -#: model:product.template,name:multi_company.product_product_odoo1_product_template -msgid "Odoo Offer" -msgstr "Offre Odoo" +#: help:multi_company.default,company_id:0 +msgid "Company where the user is connected" +msgstr "Société dans laquelle l'utilisateur est connectée" #. module: multi_company #: field:multi_company.default,expression:0 @@ -128,7 +133,27 @@ msgid "Expression" msgstr "Expression" #. module: multi_company -#: field:multi_company.default,name:0 -msgid "Name" -msgstr "Nom" +#: model:product.template,name:multi_company.product_product_odoo1_product_template +msgid "Odoo Offer" +msgstr "Offre Odoo" + +#. module: multi_company +#: field:multi_company.default,sequence:0 +msgid "Sequence" +msgstr "Séquence" + +#. module: multi_company +#: constraint:product.category:0 +msgid "Error ! You can not create recursive categories." +msgstr "" + +#. module: multi_company +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "Erreur: code EAN invalide" + +#. module: multi_company +#: help:multi_company.default,expression:0 +msgid "Expression, must be True to match" +msgstr "L'expression doit être à True pour correspondre" diff --git a/addons/multi_company/i18n/multi_company.pot b/addons/multi_company/i18n/multi_company.pot index bd6e985b710..008821e0ea5 100644 --- a/addons/multi_company/i18n/multi_company.pot +++ b/addons/multi_company/i18n/multi_company.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 5.0.6\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-12-07 21:51:04+0000\n" -"PO-Revision-Date: 2009-12-07 21:51:04+0000\n" +"POT-Creation-Date: 2009-12-07 22:08:12+0000\n" +"PO-Revision-Date: 2009-12-07 22:08:12+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,13 +16,8 @@ msgstr "" "Plural-Forms: \n" #. module: multi_company -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "" - -#. module: multi_company -#: field:multi_company.default,object_id:0 -msgid "Object" +#: help:multi_company.default,object_id:0 +msgid "Object affect by this rules" msgstr "" #. module: multi_company @@ -30,11 +25,75 @@ msgstr "" msgid "The Object name must start with x_ and not contain any special character !" msgstr "" +#. module: multi_company +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" + +#. module: multi_company +#: constraint:res.partner:0 +msgid "The VAT doesn't seem to be correct." +msgstr "" + +#. module: multi_company +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "" + +#. module: multi_company +#: model:res.company,overdue_msg:multi_company.res_company_odoo +#: model:res.company,overdue_msg:multi_company.res_company_oerp_be +#: model:res.company,overdue_msg:multi_company.res_company_oerp_editor +#: model:res.company,overdue_msg:multi_company.res_company_oerp_in +#: model:res.company,overdue_msg:multi_company.res_company_oerp_us +msgid "Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting department" +msgstr "" + #. module: multi_company #: field:multi_company.default,company_dest_id:0 msgid "Default Company" msgstr "" +#. module: multi_company +#: field:multi_company.default,object_id:0 +msgid "Object" +msgstr "" + +#. module: multi_company +#: model:ir.actions.act_window,name:multi_company.action_inventory_form +#: model:ir.module.module,shortdesc:multi_company.module_meta_information +#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form +#: view:multi_company.default:0 +msgid "Multi Company" +msgstr "" + +#. module: multi_company +#: model:ir.module.module,description:multi_company.module_meta_information +msgid "This module add the possibility to easily manage \n" +" the default value for each object\n" +" " +msgstr "" + +#. module: multi_company +#: field:multi_company.default,company_id:0 +msgid "Main Company" +msgstr "" + +#. module: multi_company +#: help:multi_company.default,company_dest_id:0 +msgid "Company to store the current record" +msgstr "" + +#. module: multi_company +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: multi_company +#: field:multi_company.default,name:0 +msgid "Name" +msgstr "" + #. module: multi_company #: constraint:product.template:0 msgid "Error: UOS must be in a different category than the UOM" @@ -50,73 +109,19 @@ msgstr "" msgid "Error! You can not create recursive companies." msgstr "" +#. module: multi_company +#: help:multi_company.default,name:0 +msgid "Name it to easily find a record" +msgstr "" + #. module: multi_company #: model:ir.model,name:multi_company.model_multi_company_default msgid "multi_company.default" msgstr "" #. module: multi_company -#: constraint:product.category:0 -msgid "Error ! You can not create recursive categories." -msgstr "" - -#. module: multi_company -#: constraint:product.template:0 -msgid "Error: The default UOM and the purchase UOM must be in the same category." -msgstr "" - -#. module: multi_company -#: field:multi_company.default,company_id:0 -msgid "Main Company" -msgstr "" - -#. module: multi_company -#: model:ir.actions.act_window,name:multi_company.action_inventory_form -#: model:ir.module.module,shortdesc:multi_company.module_meta_information -#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form -#: view:multi_company.default:0 -msgid "Multi Company" -msgstr "" - -#. module: multi_company -#: constraint:product.product:0 -msgid "Error: Invalid ean code" -msgstr "" - -#. module: multi_company -#: model:ir.module.module,description:multi_company.module_meta_information -msgid "This module add the possibility to easily manage \n" -" the default value for each object\n" -" " -msgstr "" - -#. module: multi_company -#: constraint:res.partner:0 -msgid "The VAT doesn't seem to be correct." -msgstr "" - -#. module: multi_company -#: constraint:ir.actions.act_window:0 -msgid "Invalid model name in the action definition." -msgstr "" - -#. module: multi_company -#: field:multi_company.default,sequence:0 -msgid "Sequence" -msgstr "" - -#. module: multi_company -#: model:res.company,overdue_msg:multi_company.res_company_odoo -#: model:res.company,overdue_msg:multi_company.res_company_oerp_be -#: model:res.company,overdue_msg:multi_company.res_company_oerp_editor -#: model:res.company,overdue_msg:multi_company.res_company_oerp_in -#: model:res.company,overdue_msg:multi_company.res_company_oerp_us -msgid "Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting department" -msgstr "" - -#. module: multi_company -#: model:product.template,name:multi_company.product_product_odoo1_product_template -msgid "Odoo Offer" +#: help:multi_company.default,company_id:0 +msgid "Company where the user is connected" msgstr "" #. module: multi_company @@ -125,7 +130,27 @@ msgid "Expression" msgstr "" #. module: multi_company -#: field:multi_company.default,name:0 -msgid "Name" +#: model:product.template,name:multi_company.product_product_odoo1_product_template +msgid "Odoo Offer" +msgstr "" + +#. module: multi_company +#: field:multi_company.default,sequence:0 +msgid "Sequence" +msgstr "" + +#. module: multi_company +#: constraint:product.category:0 +msgid "Error ! You can not create recursive categories." +msgstr "" + +#. module: multi_company +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "" + +#. module: multi_company +#: help:multi_company.default,expression:0 +msgid "Expression, must be True to match" msgstr "" diff --git a/addons/multi_company/multi_company.py b/addons/multi_company/multi_company.py index 8a4af4f9499..e7e29cfc021 100644 --- a/addons/multi_company/multi_company.py +++ b/addons/multi_company/multi_company.py @@ -37,11 +37,15 @@ class multi_company_default(osv.osv): _columns = { 'sequence': fields.integer('Sequence'), - 'name': fields.char('Name', size=32, required=True), - 'company_id': fields.many2one('res.company', 'Main Company', required=True), - 'company_dest_id': fields.many2one('res.company', 'Default Company', required=True), - 'object_id': fields.many2one('ir.model', 'Object', required=True), - 'expression': fields.char('Expression', size=32, required=True), + 'name': fields.char('Name', size=32, required=True, help='Name it to easily find a record'), + 'company_id': fields.many2one('res.company', 'Main Company', required=True, + help='Company where the user is connected'), + 'company_dest_id': fields.many2one('res.company', 'Default Company', required=True, + help='Company to store the current record'), + 'object_id': fields.many2one('ir.model', 'Object', required=True, + help='Object affect by this rules'), + 'expression': fields.char('Expression', size=32, required=True, + help='Expression, must be True to match'), } _defaults = { From cfa910540d74afc3c5a27e0f4a94b81e7e4bde03 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Mon, 7 Dec 2009 23:15:14 +0100 Subject: [PATCH 07/21] [ADD] missing translation bzr revid: christophe.chauvet@syleam.fr-20091207221514-s6p3vuz37vqyue4s --- addons/multi_company/i18n/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/multi_company/i18n/fr.po b/addons/multi_company/i18n/fr.po index 5d68473837f..a7a622549ca 100644 --- a/addons/multi_company/i18n/fr.po +++ b/addons/multi_company/i18n/fr.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-07 22:08:12+0000\n" -"PO-Revision-Date: 2009-12-07 23:12+0100\n" +"PO-Revision-Date: 2009-12-07 23:14+0100\n" "Last-Translator: Christophe Chauvet \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -17,7 +17,7 @@ msgstr "" #. module: multi_company #: help:multi_company.default,object_id:0 msgid "Object affect by this rules" -msgstr "" +msgstr "Objet en relation avec cette règle" #. module: multi_company #: constraint:ir.model:0 From 34e6f15329ad5651270a7b66f73f8d7fe9127e0f Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Mon, 7 Dec 2009 23:29:20 +0100 Subject: [PATCH 08/21] [ADD] Add search view on multi_company default bzr revid: christophe.chauvet@syleam.fr-20091207222920-5ofoeta3v4smc2th --- addons/multi_company/multi_company_view.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/addons/multi_company/multi_company_view.xml b/addons/multi_company/multi_company_view.xml index 49594a3df8a..ad16a33f0f3 100644 --- a/addons/multi_company/multi_company_view.xml +++ b/addons/multi_company/multi_company_view.xml @@ -34,11 +34,27 @@
+ + multi_company.default.search + multi_company.default + search + + + + + + + + + + + Multi Company ir.actions.act_window multi_company.default form + Date: Mon, 7 Dec 2009 23:32:38 +0100 Subject: [PATCH 09/21] [ADD] Change order on multi company default to easily find for one company all lines in a single list [IMP] Change sequence 1 to 100 bzr revid: christophe.chauvet@syleam.fr-20091207223238-l65atmgun6evnrms --- addons/multi_company/multi_company.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/multi_company/multi_company.py b/addons/multi_company/multi_company.py index e7e29cfc021..ff52408df60 100644 --- a/addons/multi_company/multi_company.py +++ b/addons/multi_company/multi_company.py @@ -33,7 +33,7 @@ class multi_company_default(osv.osv): """ _name = 'multi_company.default' _description = 'Default multi company' - _order = 'sequence,id' + _order = 'company_id,company_dest_id,sequence,id' _columns = { 'sequence': fields.integer('Sequence'), @@ -50,7 +50,7 @@ class multi_company_default(osv.osv): _defaults = { 'expression': lambda *a: 'True', - 'sequence': lambda *a: 1 + 'sequence': lambda *a: 100, } multi_company_default() From db949d535e991429c5cf796e0f052dedbc275807 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Mon, 7 Dec 2009 23:36:12 +0100 Subject: [PATCH 10/21] add syleam in author bzr revid: christophe.chauvet@syleam.fr-20091207223612-6hgwu0lipimubxla --- addons/multi_company/__terp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/multi_company/__terp__.py b/addons/multi_company/__terp__.py index d54acabd3b7..b23144e56f4 100644 --- a/addons/multi_company/__terp__.py +++ b/addons/multi_company/__terp__.py @@ -27,7 +27,7 @@ 'description': """This module add the possibility to easily manage the default value for each object """, - 'author': 'Tiny', + 'author': 'Tiny,SYLEAM', 'website': 'http://www.openerp.com/', 'depends': [ 'base', From a4cfc08caf1e7b038556006d4c5f11d5e4b0facc Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Tue, 8 Dec 2009 11:00:27 +0100 Subject: [PATCH 11/21] [IMP] Improve tree and form view to be more readable [IMP] Change the order [IMP] Update template and french translation bzr revid: christophe.chauvet@syleam.fr-20091208100027-r0jsx0b0g7f2yel2 --- addons/multi_company/i18n/fr.po | 14 +++++++++++-- addons/multi_company/i18n/multi_company.pot | 14 +++++++++++-- addons/multi_company/multi_company.py | 2 +- addons/multi_company/multi_company_view.xml | 22 ++++++++++++--------- 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/addons/multi_company/i18n/fr.po b/addons/multi_company/i18n/fr.po index a7a622549ca..868649dba08 100644 --- a/addons/multi_company/i18n/fr.po +++ b/addons/multi_company/i18n/fr.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-12-07 22:08:12+0000\n" -"PO-Revision-Date: 2009-12-07 23:14+0100\n" +"POT-Creation-Date: 2009-12-08 09:51:18+0000\n" +"PO-Revision-Date: 2009-12-08 10:52+0100\n" "Last-Translator: Christophe Chauvet \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -82,6 +82,11 @@ msgstr "" msgid "Main Company" msgstr "Société principale" +#. module: multi_company +#: view:multi_company.default:0 +msgid "Condition" +msgstr "Condition" + #. module: multi_company #: help:multi_company.default,company_dest_id:0 msgid "Company to store the current record" @@ -157,3 +162,8 @@ msgstr "Erreur: code EAN invalide" msgid "Expression, must be True to match" msgstr "L'expression doit être à True pour correspondre" +#. module: multi_company +#: view:multi_company.default:0 +msgid "Matching" +msgstr "Critère de correspondance" + diff --git a/addons/multi_company/i18n/multi_company.pot b/addons/multi_company/i18n/multi_company.pot index 008821e0ea5..0764bafa15e 100644 --- a/addons/multi_company/i18n/multi_company.pot +++ b/addons/multi_company/i18n/multi_company.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 5.0.6\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-12-07 22:08:12+0000\n" -"PO-Revision-Date: 2009-12-07 22:08:12+0000\n" +"POT-Creation-Date: 2009-12-08 09:51:18+0000\n" +"PO-Revision-Date: 2009-12-08 09:51:18+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -79,6 +79,11 @@ msgstr "" msgid "Main Company" msgstr "" +#. module: multi_company +#: view:multi_company.default:0 +msgid "Condition" +msgstr "" + #. module: multi_company #: help:multi_company.default,company_dest_id:0 msgid "Company to store the current record" @@ -154,3 +159,8 @@ msgstr "" msgid "Expression, must be True to match" msgstr "" +#. module: multi_company +#: view:multi_company.default:0 +msgid "Matching" +msgstr "" + diff --git a/addons/multi_company/multi_company.py b/addons/multi_company/multi_company.py index ff52408df60..2c56935c394 100644 --- a/addons/multi_company/multi_company.py +++ b/addons/multi_company/multi_company.py @@ -33,7 +33,7 @@ class multi_company_default(osv.osv): """ _name = 'multi_company.default' _description = 'Default multi company' - _order = 'company_id,company_dest_id,sequence,id' + _order = 'company_id,sequence,id' _columns = { 'sequence': fields.integer('Sequence'), diff --git a/addons/multi_company/multi_company_view.xml b/addons/multi_company/multi_company_view.xml index ad16a33f0f3..1644e2e4f05 100644 --- a/addons/multi_company/multi_company_view.xml +++ b/addons/multi_company/multi_company_view.xml @@ -8,12 +8,12 @@ - - - + + + @@ -24,12 +24,16 @@
- - - - - - + + + + + + + + + + From d75a0e513312f2d4d686c3a03dc50d968d53af01 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Tue, 8 Dec 2009 11:17:25 +0100 Subject: [PATCH 12/21] [ADD] Inherit copy to add (copy) in the name field [IMP] Update template and french translation bzr revid: christophe.chauvet@syleam.fr-20091208101725-dp7al0teb8eq2zj2 --- addons/multi_company/i18n/fr.po | 10 ++++++++-- addons/multi_company/i18n/multi_company.pot | 10 ++++++++-- addons/multi_company/multi_company.py | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/addons/multi_company/i18n/fr.po b/addons/multi_company/i18n/fr.po index 868649dba08..083b0b464ec 100644 --- a/addons/multi_company/i18n/fr.po +++ b/addons/multi_company/i18n/fr.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-12-08 09:51:18+0000\n" -"PO-Revision-Date: 2009-12-08 10:52+0100\n" +"POT-Creation-Date: 2009-12-08 10:15:44+0000\n" +"PO-Revision-Date: 2009-12-08 11:16+0100\n" "Last-Translator: Christophe Chauvet \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -162,6 +162,12 @@ msgstr "Erreur: code EAN invalide" msgid "Expression, must be True to match" msgstr "L'expression doit être à True pour correspondre" +#. module: multi_company +#: code:addons/multi_company/multi_company.py:0 +#, python-format +msgid " (copy)" +msgstr " (copie)" + #. module: multi_company #: view:multi_company.default:0 msgid "Matching" diff --git a/addons/multi_company/i18n/multi_company.pot b/addons/multi_company/i18n/multi_company.pot index 0764bafa15e..a9ce1afdac9 100644 --- a/addons/multi_company/i18n/multi_company.pot +++ b/addons/multi_company/i18n/multi_company.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 5.0.6\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-12-08 09:51:18+0000\n" -"PO-Revision-Date: 2009-12-08 09:51:18+0000\n" +"POT-Creation-Date: 2009-12-08 10:15:44+0000\n" +"PO-Revision-Date: 2009-12-08 10:15:44+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -159,6 +159,12 @@ msgstr "" msgid "Expression, must be True to match" msgstr "" +#. module: multi_company +#: code:addons/multi_company/multi_company.py:0 +#, python-format +msgid " (copy)" +msgstr "" + #. module: multi_company #: view:multi_company.default:0 msgid "Matching" diff --git a/addons/multi_company/multi_company.py b/addons/multi_company/multi_company.py index 2c56935c394..6af7e342bed 100644 --- a/addons/multi_company/multi_company.py +++ b/addons/multi_company/multi_company.py @@ -26,6 +26,7 @@ for each company from osv import osv from osv import fields +from tools.translate import _ class multi_company_default(osv.osv): """ @@ -53,6 +54,19 @@ class multi_company_default(osv.osv): 'sequence': lambda *a: 100, } + def copy(self, cr, uid, id, default=None, context=None): + """ + Add (copy) in the name when duplicate record + """ + if not context: + context = {} + if not default: + default = {} + company = self.browse(cr, uid, id, context=context) + default = default.copy() + default['name'] = company.name + _(' (copy)') + return super(multi_company_default, self).copy(cr, uid, id, default, context=context) + multi_company_default() class res_company(osv.osv): From 6d4a82d12e3a4c0c14572d5d6019022b853159e5 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Tue, 8 Dec 2009 12:43:20 +0100 Subject: [PATCH 13/21] [IMP] Change menu "Multi Company" by "Default Company per Object" [IMP] Move menu Mult Company in Administration -> Customization -> Multi Company bzr revid: christophe.chauvet@syleam.fr-20091208114320-l2lsi7h3t1okygc3 --- addons/multi_company/multi_company_view.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/multi_company/multi_company_view.xml b/addons/multi_company/multi_company_view.xml index 1644e2e4f05..b39a5ad0b7e 100644 --- a/addons/multi_company/multi_company_view.xml +++ b/addons/multi_company/multi_company_view.xml @@ -54,16 +54,21 @@ - Multi Company + Default Company per Object ir.actions.act_window multi_company.default form + + + parent="menu_custom_multicompany"/> From 37b6db6293019ae3dee8d9d117c0ac85b693ee3c Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Tue, 8 Dec 2009 12:48:28 +0100 Subject: [PATCH 14/21] [IMP] Update template and french translation bzr revid: christophe.chauvet@syleam.fr-20091208114828-ptvp9l3eju7aqw4t --- addons/multi_company/i18n/fr.po | 21 +++++++++++++++++---- addons/multi_company/i18n/multi_company.pot | 21 +++++++++++++++++---- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/addons/multi_company/i18n/fr.po b/addons/multi_company/i18n/fr.po index 083b0b464ec..4254264e1c6 100644 --- a/addons/multi_company/i18n/fr.po +++ b/addons/multi_company/i18n/fr.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-12-08 10:15:44+0000\n" -"PO-Revision-Date: 2009-12-08 11:16+0100\n" +"POT-Creation-Date: 2009-12-08 11:46:41+0000\n" +"PO-Revision-Date: 2009-12-08 12:48+0100\n" "Last-Translator: Christophe Chauvet \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -59,9 +59,7 @@ msgid "Object" msgstr "Objet" #. module: multi_company -#: model:ir.actions.act_window,name:multi_company.action_inventory_form #: model:ir.module.module,shortdesc:multi_company.module_meta_information -#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form #: view:multi_company.default:0 msgid "Multi Company" msgstr "Multi société" @@ -122,6 +120,11 @@ msgstr "Erreur! Vous ne pouvez pas créer de sociétés récursives." msgid "Name it to easily find a record" msgstr "La nommer facilement de façon a trouver l'enregistrement" +#. module: multi_company +#: model:ir.ui.menu,name:multi_company.menu_custom_multicompany +msgid "Multi company" +msgstr "Multi société" + #. module: multi_company #: model:ir.model,name:multi_company.model_multi_company_default msgid "multi_company.default" @@ -132,6 +135,11 @@ msgstr "multi_company.default" msgid "Company where the user is connected" msgstr "Société dans laquelle l'utilisateur est connectée" +#. module: multi_company +#: model:ir.actions.act_window,name:multi_company.action_inventory_form +msgid "Default Company per Object" +msgstr "Société par défaut par objet" + #. module: multi_company #: field:multi_company.default,expression:0 msgid "Expression" @@ -162,6 +170,11 @@ msgstr "Erreur: code EAN invalide" msgid "Expression, must be True to match" msgstr "L'expression doit être à True pour correspondre" +#. module: multi_company +#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form +msgid "Default company per Object" +msgstr "Société par défaut par objet" + #. module: multi_company #: code:addons/multi_company/multi_company.py:0 #, python-format diff --git a/addons/multi_company/i18n/multi_company.pot b/addons/multi_company/i18n/multi_company.pot index a9ce1afdac9..8f3048ebafa 100644 --- a/addons/multi_company/i18n/multi_company.pot +++ b/addons/multi_company/i18n/multi_company.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 5.0.6\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-12-08 10:15:44+0000\n" -"PO-Revision-Date: 2009-12-08 10:15:44+0000\n" +"POT-Creation-Date: 2009-12-08 11:46:41+0000\n" +"PO-Revision-Date: 2009-12-08 11:46:41+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -60,9 +60,7 @@ msgid "Object" msgstr "" #. module: multi_company -#: model:ir.actions.act_window,name:multi_company.action_inventory_form #: model:ir.module.module,shortdesc:multi_company.module_meta_information -#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form #: view:multi_company.default:0 msgid "Multi Company" msgstr "" @@ -119,6 +117,11 @@ msgstr "" msgid "Name it to easily find a record" msgstr "" +#. module: multi_company +#: model:ir.ui.menu,name:multi_company.menu_custom_multicompany +msgid "Multi company" +msgstr "" + #. module: multi_company #: model:ir.model,name:multi_company.model_multi_company_default msgid "multi_company.default" @@ -129,6 +132,11 @@ msgstr "" msgid "Company where the user is connected" msgstr "" +#. module: multi_company +#: model:ir.actions.act_window,name:multi_company.action_inventory_form +msgid "Default Company per Object" +msgstr "" + #. module: multi_company #: field:multi_company.default,expression:0 msgid "Expression" @@ -159,6 +167,11 @@ msgstr "" msgid "Expression, must be True to match" msgstr "" +#. module: multi_company +#: model:ir.ui.menu,name:multi_company.menu_action_inventory_form +msgid "Default company per Object" +msgstr "" + #. module: multi_company #: code:addons/multi_company/multi_company.py:0 #, python-format From 6d593be9d3e9421c09828af7099a928fa3394795 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 9 Dec 2009 09:51:40 +0100 Subject: [PATCH 15/21] [FIX] security rule multi-company bzr revid: fp@tinyerp.com-20091209085140-e9uykuzgp2biwcf3 --- addons/product/security/product_security.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/product/security/product_security.xml b/addons/product/security/product_security.xml index e0744f8ba95..cceaef7cdd5 100644 --- a/addons/product/security/product_security.xml +++ b/addons/product/security/product_security.xml @@ -9,12 +9,10 @@ Product / Manager - - Product multi-company - + From 3bb215e7ac3cc4ece6d9de89a99a66658ae8fd7d Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Wed, 9 Dec 2009 14:42:36 +0530 Subject: [PATCH 16/21] [IMP] : Caldav: Improvement in import calendar for attendee bzr revid: rpa@tinyerp.com-20091209091236-0q82uid7e1tmqprj --- addons/caldav/calendar.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index 60d0a650a79..5163784759f 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -69,13 +69,12 @@ class CalDAV(object): for child in parsedCal.getChildren(): for cal_data in child.getChildren(): if cal_data.name.lower() == 'attendee': - # This is possible only if Attendee does not inherit osv_memory - attendee = Attendee() + attendee = self.pool.get('caldav.attendee') attendee.import_ical(cr, uid, cal_data) if cal_data.name.lower() in self.__attribute__: self.ical_set(cal_data.name.lower(), cal_data.value, 'value') return True - + class Calendar(CalDAV, osv.osv_memory): _name = 'caldav.calendar' __attribute__ = { @@ -209,11 +208,11 @@ class Event(CalDAV, osv.osv_memory): startdate = todate(startdate) rset1 = rrulestr(rrulestring, dtstart=startdate, forceset=True) for date in exdate: - datetime_obj = datetime.strptime(date, "%Y-%m-%d %H:%M:%S", timezone=True) + datetime_obj = datetime.strptime(date, "%Y-%m-%d %H:%M:%S") # datetime_obj_utc = datetime_obj.replace(tzinfo=timezone('UTC')) rset1._exdate.append(datetime_obj) re_dates = rset1._iter() - recurrent_dates = map(lambda x:x.strftime('%Y-%m-%d %H:%M:%S', timezone=True), re_dates) + recurrent_dates = map(lambda x:x.strftime('%Y-%m-%d %H:%M:%S'), re_dates) return recurrent_dates def search(self, cr, uid, args, offset=0, limit=None, order=None, @@ -294,8 +293,7 @@ class Alarm(CalDAV): if self.__attribute__.has_key(val.name.lower()): self.__attribute__[val.name] = val.value -class Attendee(CalDAV): -# Also inherit osv_memory +class Attendee(CalDAV, osv.osv_memory): _name = 'caldav.attendee' __attribute__ = { 'cutype' : None, # Use: 0-1 Specify the type of calendar user specified by the property like "INDIVIDUAL"/"GROUP"/"RESOURCE"/"ROOM"/"UNKNOWN". @@ -310,7 +308,7 @@ class Attendee(CalDAV): 'dir' : None, # Use: 0-1 Specify reference to a directory entry associated with the calendar user specified by the property. 'language' : None, # Use: 0-1 Specify the language for text values in a property or property parameter. } - + def import_ical(self, cr, uid, ical_data): if ical_data.value: self.__attribute__['sent-by'] = ical_data.value From dd23057ea92b7c48a3efb428afdf2509bd6efb02 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Wed, 9 Dec 2009 14:50:23 +0530 Subject: [PATCH 17/21] [FIX]: crm : Fixed problem of datetime in event export bzr revid: rpa@tinyerp.com-20091209092023-g4dco4l4wnpc0di7 --- addons/crm/crm_calendar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm_calendar.py b/addons/crm/crm_calendar.py index a1bad20948c..baeff6a41ce 100644 --- a/addons/crm/crm_calendar.py +++ b/addons/crm/crm_calendar.py @@ -288,9 +288,9 @@ class crm_case(osv.osv): if val['type'] == "text": vevent.add(key).value = str(crm[val['field']]) elif val['type'] == 'datetime' and crm[val['field']]: - vevent.add(key).value = datetime.strptime(crm[val['field']], "%Y-%m-%d %H:%M:%S") + vevent.add(key).value = datetime.datetime.strptime(crm[val['field']], "%Y-%m-%d %H:%M:%S") if crm[self.__attribute__['rrule']['field']]: - startdate = datetime.strptime(crm['date'], "%Y-%m-%d %H:%M:%S") + startdate = datetime.datetime.strptime(crm['date'], "%Y-%m-%d %H:%M:%S") if not startdate: startdate = datetime.now() rset1 = rrulestr(str(crm[self.__attribute__['rrule']['field']]), dtstart=startdate, forceset=True) From 6dce4f1248adf1b9fb1bdb46a52f9bab25ac74db Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 9 Dec 2009 10:52:38 +0100 Subject: [PATCH 18/21] [FIX] related are stored bzr revid: fp@tinyerp.com-20091209095238-1rt7nk6fel8n6bzy --- addons/account/account.py | 4 ++-- addons/account/account_move_line.py | 2 +- addons/account/invoice.py | 4 ++-- addons/product/pricelist.py | 4 ++-- addons/project/project.py | 2 +- addons/purchase/purchase.py | 2 +- addons/sale/sale.py | 2 +- addons/stock/stock.py | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 6ae6968f364..f26038e421b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -479,7 +479,7 @@ class account_journal(osv.osv): 'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'), 'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'), 'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want new account moves to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation.'), - #'company_id': fields.related('default_credit_account_id','company_id',type='many2one', relation="res.company", string="Company"), + #'company_id': fields.related('default_credit_account_id','company_id',type='many2one', relation="res.company", string="Company",store=True), 'company_id': fields.many2one('res.company', 'Company', required=True,select=1), 'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \ help="The sequence used for invoice numbers in this journal."), @@ -782,7 +782,7 @@ class account_move(osv.osv): ('journal_pur_voucher','Journal Purchase'), ('journal_voucher','Journal Voucher'), ],'Type', readonly=True, select=True, states={'draft':[('readonly',False)]}), - 'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company'), + 'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company',store=True), } _defaults = { 'name': lambda *a: '/', diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index fcade623b76..d8136b8e0fa 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -389,7 +389,7 @@ class account_move_line(osv.osv): 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account'), #TODO: remove this 'amount_taxed':fields.float("Taxed Amount",digits=(16,int(tools.config['price_accuracy']))), - 'company_id': fields.related('account_id','company_id',type='many2one',object='res.company',string='Company') + 'company_id': fields.related('account_id','company_id',type='many2one',object='res.company',string='Company',store=True) } diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 2af3bbc8d5b..005d9b74499 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1086,7 +1086,7 @@ class account_invoice_line(osv.osv): 'invoice_line_tax_id': fields.many2many('account.tax', 'account_invoice_line_tax', 'invoice_line_id', 'tax_id', 'Taxes', domain=[('parent_id','=',False)]), 'note': fields.text('Notes'), 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'), - 'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company') + 'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company',store=True) } _defaults = { 'quantity': lambda *a: 1, @@ -1312,7 +1312,7 @@ class account_invoice_tax(osv.osv): 'base_amount': fields.float('Base Code Amount', digits=(16,int(config['price_accuracy']))), 'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="The tax basis of the tax declaration."), 'tax_amount': fields.float('Tax Code Amount', digits=(16,int(config['price_accuracy']))), - 'company_id': fields.related('account_id','company_id',type='many2one',relation='res.company',string='Company'), + 'company_id': fields.related('account_id','company_id',type='many2one',relation='res.company',string='Company',store=True), } def base_change(self, cr, uid, ids, base,currency_id=False,company_id=False,date_invoice=False): diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index f3131d4fc42..450582edf5d 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -271,7 +271,7 @@ class product_pricelist_version(osv.osv): 'price_version_id', 'Price List Items', required=True), 'date_start': fields.date('Start Date', help="Starting date for this pricelist version to be valid."), 'date_end': fields.date('End Date', help="Ending date for this pricelist version to be valid."), - 'company_id': fields.related('pricelist_id','company_id',type='many2one',relation='res.company',string='Company') + 'company_id': fields.related('pricelist_id','company_id',type='many2one',relation='res.company',string='Company',store=True) } _defaults = { 'active': lambda *a: 1, @@ -368,7 +368,7 @@ class product_pricelist_item(osv.osv): digits=(16, int(config['price_accuracy']))), 'price_max_margin': fields.float('Max. Price Margin', digits=(16, int(config['price_accuracy']))), - 'company_id': fields.related('price_version_id','company_id',type='many2one',relation='res.company',string='Company') + 'company_id': fields.related('price_version_id','company_id',type='many2one',relation='res.company',string='Company',store=True) } _constraints = [ diff --git a/addons/project/project.py b/addons/project/project.py index f06041f0396..f4452a5fbf0 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -443,7 +443,7 @@ class project_work(osv.osv): 'task_id': fields.many2one('project.task', 'Task', ondelete='cascade', required=True), 'hours': fields.float('Time Spent'), 'user_id': fields.many2one('res.users', 'Done by', required=True), - 'company_id': fields.related('task_id','company_id',type='many2one',relation='res.company',string='Company') + 'company_id': fields.related('task_id','company_id',type='many2one',relation='res.company',string='Company',store=True) } _defaults = { 'user_id': lambda obj,cr,uid,context: uid, diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 21d1f9e5660..464421b5be7 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -456,7 +456,7 @@ class purchase_order_line(osv.osv): 'notes': fields.text('Notes'), 'order_id': fields.many2one('purchase.order', 'Order Ref', select=True, required=True, ondelete='cascade'), 'account_analytic_id':fields.many2one('account.analytic.account', 'Analytic Account',), - 'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company') + 'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company',store=True) } _defaults = { 'product_qty': lambda *a: 1.0 diff --git a/addons/sale/sale.py b/addons/sale/sale.py index fd7562144c8..1be4b4a2477 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -778,7 +778,7 @@ class sale_order_line(osv.osv): 'state': fields.selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled'), ('exception', 'Exception')], 'State', required=True, readonly=True), 'order_partner_id': fields.related('order_id', 'partner_id', type='many2one', relation='res.partner', string='Customer'), 'salesman_id':fields.related('order_id','user_id',type='many2one',relation='res.users',string='Salesman'), - 'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company'), + 'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company',store=True), } _order = 'sequence, id' _defaults = { diff --git a/addons/stock/stock.py b/addons/stock/stock.py index cfb43e300c4..95c839be6b7 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -912,7 +912,7 @@ class stock_production_lot_revision(osv.osv): 'indice': fields.char('Revision', size=16), 'author_id': fields.many2one('res.users', 'Author'), 'lot_id': fields.many2one('stock.production.lot', 'Production lot', select=True, ondelete='cascade'), - 'company_id': fields.related('lot_id','company_id',type='many2one',relation='res.company',string='Company'), + 'company_id': fields.related('lot_id','company_id',type='many2one',relation='res.company',string='Company',store=True), } _defaults = { @@ -1457,7 +1457,7 @@ class stock_inventory_line(osv.osv): 'product_id': fields.many2one('product.product', 'Product', required=True), 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True), 'product_qty': fields.float('Quantity'), - 'company_id': fields.related('inventory_id','company_id',type='many2one',object='res.company',string='Company') + 'company_id': fields.related('inventory_id','company_id',type='many2one',object='res.company',string='Company',store=True) } def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False): From d1ffd281b04a2647e2a42d2a8b0245d085a4850c Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 9 Dec 2009 11:36:11 +0100 Subject: [PATCH 19/21] [FIX] multicompany bzr revid: fp@tinyerp.com-20091209103611-jit101ufi52teo8a --- addons/account/account_move_line.py | 2 +- addons/stock/stock.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index d8136b8e0fa..c8a02d00ea4 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -389,7 +389,7 @@ class account_move_line(osv.osv): 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account'), #TODO: remove this 'amount_taxed':fields.float("Taxed Amount",digits=(16,int(tools.config['price_accuracy']))), - 'company_id': fields.related('account_id','company_id',type='many2one',object='res.company',string='Company',store=True) + 'company_id': fields.related('account_id','company_id',type='many2one',relation='res.company',string='Company',store=True) } diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 95c839be6b7..a285cc4b8ad 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1457,7 +1457,7 @@ class stock_inventory_line(osv.osv): 'product_id': fields.many2one('product.product', 'Product', required=True), 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True), 'product_qty': fields.float('Quantity'), - 'company_id': fields.related('inventory_id','company_id',type='many2one',object='res.company',string='Company',store=True) + 'company_id': fields.related('inventory_id','company_id',type='many2one',relation='res.company',string='Company',store=True) } def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False): From 5af061f4e9c21aa9afea442b369d2d5beee33297 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Wed, 9 Dec 2009 12:28:57 +0100 Subject: [PATCH 20/21] [IMP] Move multicompny.default to base bzr revid: christophe.chauvet@syleam.fr-20091209112857-yck5jnhd22s9347f --- addons/multi_company/__init__.py | 2 - addons/multi_company/__terp__.py | 3 +- addons/multi_company/multi_company.py | 94 ------------------- addons/multi_company/multi_company_view.xml | 74 --------------- .../security/ir.model.access.csv | 1 - 5 files changed, 1 insertion(+), 173 deletions(-) delete mode 100644 addons/multi_company/multi_company.py delete mode 100644 addons/multi_company/multi_company_view.xml diff --git a/addons/multi_company/__init__.py b/addons/multi_company/__init__.py index 5856adc9616..0d29405d526 100644 --- a/addons/multi_company/__init__.py +++ b/addons/multi_company/__init__.py @@ -19,7 +19,5 @@ # ############################################################################## -import multi_company - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/multi_company/__terp__.py b/addons/multi_company/__terp__.py index b23144e56f4..83d6afa777f 100644 --- a/addons/multi_company/__terp__.py +++ b/addons/multi_company/__terp__.py @@ -36,8 +36,7 @@ ], 'init_xml': [], 'update_xml': [ - 'security/ir.model.access.csv', - 'multi_company_view.xml', + #'security/ir.model.access.csv', ], 'demo_xml': [ 'multi_company_demo.xml' diff --git a/addons/multi_company/multi_company.py b/addons/multi_company/multi_company.py deleted file mode 100644 index 6af7e342bed..00000000000 --- a/addons/multi_company/multi_company.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -""" -The multicompany module add management to easily custom value by default -for each company -""" - -from osv import osv -from osv import fields -from tools.translate import _ - -class multi_company_default(osv.osv): - """ - Manage multi company default value - """ - _name = 'multi_company.default' - _description = 'Default multi company' - _order = 'company_id,sequence,id' - - _columns = { - 'sequence': fields.integer('Sequence'), - 'name': fields.char('Name', size=32, required=True, help='Name it to easily find a record'), - 'company_id': fields.many2one('res.company', 'Main Company', required=True, - help='Company where the user is connected'), - 'company_dest_id': fields.many2one('res.company', 'Default Company', required=True, - help='Company to store the current record'), - 'object_id': fields.many2one('ir.model', 'Object', required=True, - help='Object affect by this rules'), - 'expression': fields.char('Expression', size=32, required=True, - help='Expression, must be True to match'), - } - - _defaults = { - 'expression': lambda *a: 'True', - 'sequence': lambda *a: 100, - } - - def copy(self, cr, uid, id, default=None, context=None): - """ - Add (copy) in the name when duplicate record - """ - if not context: - context = {} - if not default: - default = {} - company = self.browse(cr, uid, id, context=context) - default = default.copy() - default['name'] = company.name + _(' (copy)') - return super(multi_company_default, self).copy(cr, uid, id, default, context=context) - -multi_company_default() - -class res_company(osv.osv): - """ - Change method to retrieve the company by default - """ - _inherit = 'res.company' - - def _company_default_get(self, cr, uid, object=False, context=None): - """ - Check if the object for this company have a default value - """ - if not context: - context = {} - proxy = self.pool.get('multi_company.default') - ids = proxy.search(cr, uid, [('object_id.model', '=', object)]) - for rule in proxy.browse(cr, uid, ids, context): - user = self.pool.get('res.users').browse(cr, uid, uid) - if eval(rule.expression, {'context': context, 'user': user}): - return rule.company_dest_id.id - return super(res_company, self)._company_default_get(cr, uid, object, context) - -res_company() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/multi_company/multi_company_view.xml b/addons/multi_company/multi_company_view.xml deleted file mode 100644 index b39a5ad0b7e..00000000000 --- a/addons/multi_company/multi_company_view.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - multi_company.default.tree - multi_company.default - tree - - - - - - - - - - - - - - multi_company.default.form - multi_company.default - form - - -
- - - - - - - - - - -
-
-
- - - multi_company.default.search - multi_company.default - search - - - - - - - - - - - - - Default Company per Object - ir.actions.act_window - multi_company.default - form - - - - - - - -
-
diff --git a/addons/multi_company/security/ir.model.access.csv b/addons/multi_company/security/ir.model.access.csv index 3ea1d07dcad..0343f29f43a 100644 --- a/addons/multi_company/security/ir.model.access.csv +++ b/addons/multi_company/security/ir.model.access.csv @@ -1,2 +1 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_multi_company_default user","multi_company_default User","multi_company.model_multi_company_default","base.group_user",1,0,0,0 From bbff6faaa9ad848400dcd39a4da7f2f2538b2496 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 9 Dec 2009 17:13:34 +0530 Subject: [PATCH 21/21] [IMP] Limit for name_search() improved to 100 lp bug: https://launchpad.net/bugs/494401 fixed bzr revid: jvo@tinyerp.com-20091209114334-tppzivue2orjkcn9 --- addons/account/account.py | 4 ++-- addons/account/invoice.py | 2 +- addons/account/project/project.py | 2 +- addons/account_analytic_plans/account_analytic_plans.py | 2 +- addons/account_report/account.py | 2 +- addons/account_reporting/account.py | 2 +- addons/account_voucher/voucher.py | 2 +- addons/product/product.py | 2 +- addons/scrum/scrum.py | 2 +- addons/stock/stock.py | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index f26038e421b..549f257b124 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -349,7 +349,7 @@ class account_account(osv.osv): _sql_constraints = [ ('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !') ] - def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args = [] if not context: @@ -503,7 +503,7 @@ class account_journal(osv.osv): # }) return journal_id - def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args=[] if not context: diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 005d9b74499..8ad957e6453 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -878,7 +878,7 @@ class account_invoice(osv.osv): } return [(r['id'], types[r['type']]+(r['number'] or '')+' '+(r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')] - def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args=[] if context is None: diff --git a/addons/account/project/project.py b/addons/account/project/project.py index f446b6fdf29..51431ee1be1 100644 --- a/addons/account/project/project.py +++ b/addons/account/project/project.py @@ -248,7 +248,7 @@ class account_analytic_account(osv.osv): res['value']['partner_id'] = partner return res - def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): if not args: args=[] if not context: diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 6ad98453719..8367adb20b3 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -122,7 +122,7 @@ class account_analytic_plan_instance(osv.osv): res.append((inst.id, name)) return res - def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): args= args or [] if name: ids = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context or {}) diff --git a/addons/account_report/account.py b/addons/account_report/account.py index 665533aef0a..d34eeb620d5 100644 --- a/addons/account_report/account.py +++ b/addons/account_report/account.py @@ -192,7 +192,7 @@ class account_report(osv.osv): 'type': lambda *args: 'indicator', } - def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args=[] if not context: diff --git a/addons/account_reporting/account.py b/addons/account_reporting/account.py index 0624ab46cfa..89513923070 100644 --- a/addons/account_reporting/account.py +++ b/addons/account_reporting/account.py @@ -103,7 +103,7 @@ class account_report_bs(osv.osv): 'font_style': lambda *a :'', } - def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args=[] if not context: diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py index 4c550cc11bd..b9c223dcb0a 100755 --- a/addons/account_voucher/voucher.py +++ b/addons/account_voucher/voucher.py @@ -441,7 +441,7 @@ class account_voucher(osv.osv): } return [(r['id'], types[r['type']]+(r['number'] or '')+' '+(r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')] - def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args=[] if not context: diff --git a/addons/product/product.py b/addons/product/product.py index 50111af60ef..ad2b4ca0330 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -500,7 +500,7 @@ class product_product(osv.osv): result = map(_name_get, self.read(cr, user, ids, ['variants','name','default_code'], context)) return result - def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): if not args: args=[] if not context: diff --git a/addons/scrum/scrum.py b/addons/scrum/scrum.py index 387c1ce0f00..3e880986038 100644 --- a/addons/scrum/scrum.py +++ b/addons/scrum/scrum.py @@ -119,7 +119,7 @@ class scrum_product_backlog(osv.osv): _name = 'scrum.product.backlog' _description = 'Product Backlog' - def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): if not args: args=[] if not context: diff --git a/addons/stock/stock.py b/addons/stock/stock.py index a285cc4b8ad..8b5356a8573 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -349,7 +349,7 @@ class stock_tracking(osv.osv): 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), } - def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args = [] if not context: