From f8ae3c9bf062cdff41e2d6baf9f8565fa3fe4e3a Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 30 Mar 2015 11:26:09 +0200 Subject: [PATCH 01/56] New module base_usability, that replaces base_title_on_partner and adds new stuff --- base_usability/__init__.py | 23 ++++++++++ base_usability/__openerp__.py | 48 +++++++++++++++++++++ base_usability/partner_view.xml | 34 +++++++++++++++ base_usability/security/ir.model.access.csv | 4 ++ 4 files changed, 109 insertions(+) create mode 100644 base_usability/__init__.py create mode 100644 base_usability/__openerp__.py create mode 100644 base_usability/partner_view.xml create mode 100644 base_usability/security/ir.model.access.csv diff --git a/base_usability/__init__.py b/base_usability/__init__.py new file mode 100644 index 0000000..1a4d311 --- /dev/null +++ b/base_usability/__init__.py @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Base Usability module for Odoo +# Copyright (C) 2014-2015 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 . +# +############################################################################## + + diff --git a/base_usability/__openerp__.py b/base_usability/__openerp__.py new file mode 100644 index 0000000..18ba0b2 --- /dev/null +++ b/base_usability/__openerp__.py @@ -0,0 +1,48 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Base Usability module for Odoo +# Copyright (C) 2014-2015 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'Base Usability', + 'version': '0.1', + 'category': 'Partner', + 'license': 'AGPL-3', + 'summary': 'Better usability in base module', + 'description': """ +Base Usability +============== + +By default, OpenERP doesn't display the title field on all the partner form views. This module fixes it. + +By default, users in the Partner Contact group also have create/write access on Countries and States. This module removes that: only the users in the *Administration > Configuration* group have create/write/delete access on those objects. + +This module replaces the module base_title_on_partner. + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['base'], + 'data': [ + 'partner_view.xml', + 'security/ir.model.access.csv', + ], + 'installable': True, +} diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml new file mode 100644 index 0000000..d5417d6 --- /dev/null +++ b/base_usability/partner_view.xml @@ -0,0 +1,34 @@ + + + + + + + + base_usability.title.on.partner.form + res.partner + + + + + + + + + + base_usability.title.on.partner.simplified.form + res.partner + + + + + + + + + + diff --git a/base_usability/security/ir.model.access.csv b/base_usability/security/ir.model.access.csv new file mode 100644 index 0000000..48ea11a --- /dev/null +++ b/base_usability/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +base.access_res_country_group_user,Full access on res.country to Settings group,base.model_res_country,base.group_system,1,1,1,1 +base.access_res_country_state_group_user,Full access on res.country.state to Settings group,base.model_res_country_state,base.group_system,1,1,1,1 +base.access_res_country_group_group_user,Full access on res.country.group to Settings group,base.model_res_country_group,base.group_system,1,1,1,1 From fa5c5fc5114a1fc966b010961e8a93860ad40bbf Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 1 Apr 2015 09:53:58 +0000 Subject: [PATCH 02/56] Add tracking on important fields of partner --- base_usability/__init__.py | 2 +- base_usability/__openerp__.py | 2 +- base_usability/partner.py | 46 +++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 base_usability/partner.py diff --git a/base_usability/__init__.py b/base_usability/__init__.py index 1a4d311..101105a 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -20,4 +20,4 @@ # ############################################################################## - +from . import partner diff --git a/base_usability/__openerp__.py b/base_usability/__openerp__.py index 18ba0b2..2ac5f22 100644 --- a/base_usability/__openerp__.py +++ b/base_usability/__openerp__.py @@ -39,7 +39,7 @@ This module replaces the module base_title_on_partner. """, 'author': 'Akretion', 'website': 'http://www.akretion.com', - 'depends': ['base'], + 'depends': ['base', 'mail'], 'data': [ 'partner_view.xml', 'security/ir.model.access.csv', diff --git a/base_usability/partner.py b/base_usability/partner.py new file mode 100644 index 0000000..c4866ae --- /dev/null +++ b/base_usability/partner.py @@ -0,0 +1,46 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Base Usability module for Odoo +# Copyright (C) 2015 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, fields + + +class Partner(models.Model): + _inherit = 'res.partner' + + name = fields.Char(track_visibility='onchange') + parent_id = fields.Many2one(track_visibility='onchange') + ref = fields.Char(track_visibility='onchange') + lang = fields.Selection(track_visibility='onchange') + user_id = fields.Many2one(track_visibility='onchange') + vat = fields.Char(track_visibility='onchange') + customer = fields.Boolean(track_visibility='onchange') + supplier = fields.Boolean(track_visibility='onchange') + type = fields.Selection(track_visibility='onchange') + street = fields.Char(track_visibility='onchange') + street2 = fields.Char(track_visibility='onchange') + zip = fields.Char(track_visibility='onchange') + city = fields.Char(track_visibility='onchange') + state_id = fields.Many2one(track_visibility='onchange') + country_id = fields.Many2one(track_visibility='onchange') + email = fields.Char(track_visibility='onchange') + is_company = fields.Boolean(track_visibility='onchange') + use_parent_address = fields.Boolean(track_visibility='onchange') From 0c6e8ac3d8cd3cab98ed16244d51964f20f03a21 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 28 Apr 2015 16:13:57 +0200 Subject: [PATCH 03/56] Update description --- base_usability/__openerp__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base_usability/__openerp__.py b/base_usability/__openerp__.py index 2ac5f22..fe033a2 100644 --- a/base_usability/__openerp__.py +++ b/base_usability/__openerp__.py @@ -31,11 +31,11 @@ Base Usability ============== -By default, OpenERP doesn't display the title field on all the partner form views. This module fixes it. +This module adds *track_visibility='onchange'* on all the important fields of the Partner object. + +By default, Odoo doesn't display the title field on all the partner form views. This module fixes it (it replaces the module base_title_on_partner). By default, users in the Partner Contact group also have create/write access on Countries and States. This module removes that: only the users in the *Administration > Configuration* group have create/write/delete access on those objects. - -This module replaces the module base_title_on_partner. """, 'author': 'Akretion', 'website': 'http://www.akretion.com', From 8d3097de2a7cb4ca4f1359fd379883805e07e009 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 16 Sep 2015 10:17:00 +0200 Subject: [PATCH 04/56] is_company is now readonly when the partner is a contact --- base_usability/partner_view.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml index d5417d6..fd0d0d4 100644 --- a/base_usability/partner_view.xml +++ b/base_usability/partner_view.xml @@ -16,6 +16,10 @@ + + + {'readonly': [('parent_id', '!=', False)]} + @@ -27,6 +31,9 @@ + + {'readonly': [('parent_id', '!=', False)]} + From a5420e85c4626cdf464d4345bdd86ed1f3818b23 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 16 Sep 2015 10:34:42 +0200 Subject: [PATCH 05/56] Wider 'name' field on partner form --- base_usability/partner_view.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml index fd0d0d4..166adf1 100644 --- a/base_usability/partner_view.xml +++ b/base_usability/partner_view.xml @@ -20,6 +20,13 @@ {'readonly': [('parent_id', '!=', False)]} + + + width: 650px; + + + width: 600px; + From 121261630d177b0c9694b8ae6a5d9b6a4d128697 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 19 Oct 2015 11:25:18 +0200 Subject: [PATCH 06/56] Add tracking on active on res.partner --- base_usability/partner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/base_usability/partner.py b/base_usability/partner.py index c4866ae..efffa99 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -44,3 +44,4 @@ class Partner(models.Model): email = fields.Char(track_visibility='onchange') is_company = fields.Boolean(track_visibility='onchange') use_parent_address = fields.Boolean(track_visibility='onchange') + active = fields.Boolean(track_visibility='onchange') From 70f393822d42cd193bbe839070b01e668e670e6a Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 2 Nov 2015 10:28:47 +0100 Subject: [PATCH 07/56] Add name_title field --- base_usability/partner.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/base_usability/partner.py b/base_usability/partner.py index efffa99..3d8cfcb 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -20,7 +20,7 @@ # ############################################################################## -from openerp import models, fields +from openerp import models, fields, api class Partner(models.Model): @@ -45,3 +45,18 @@ class Partner(models.Model): is_company = fields.Boolean(track_visibility='onchange') use_parent_address = fields.Boolean(track_visibility='onchange') active = fields.Boolean(track_visibility='onchange') + # For reports + name_title = fields.Char( + compute='_compute_name_title', string='Name with Title') + + @api.one + @api.depends('name', 'title', 'is_company') + def _compute_name_title(self): + name_title = self.name + if self.title: + title = self.title.shortcut or self.title + if self.is_company: + name_title = ' '.join([name_title, title]) + else: + name_title = ' '.join([title, name_title]) + self.name_title = name_title From 43a1f7e02713fdc35c72d313938baded46d270d4 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 4 Dec 2015 17:35:29 +0100 Subject: [PATCH 08/56] Add log message when sending en email to the outside world ! --- base_usability/__init__.py | 23 ++----------------- base_usability/mail.py | 46 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 21 deletions(-) create mode 100644 base_usability/mail.py diff --git a/base_usability/__init__.py b/base_usability/__init__.py index 101105a..75c4381 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -1,23 +1,4 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2014-2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- from . import partner +from . import mail diff --git a/base_usability/mail.py b/base_usability/mail.py new file mode 100644 index 0000000..a9cd095 --- /dev/null +++ b/base_usability/mail.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Base Usability module for Odoo +# Copyright (C) 2015 Akretion (http://www.akretion.com/) +# @author: Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models +import logging + +logger = logging.getLogger(__name__) + + +class IrMailServer(models.Model): + _inherit = "ir.mail_server" + + def send_email( + self, cr, uid, message, mail_server_id=None, smtp_server=None, + smtp_port=None, smtp_user=None, smtp_password=None, + smtp_encryption=None, smtp_debug=False, context=None): + + logger.info("Sending email to %s copy %s with subject %s", + message.get('To'), + message.get('Cc'), + message.get('Subject')) + return super(IrMailServer, self).send_email( + cr, uid, message, mail_server_id=mail_server_id, + smtp_server=smtp_server, smtp_port=smtp_port, + smtp_user=smtp_user, smtp_password=smtp_password, + smtp_encryption=smtp_encryption, smtp_debug=smtp_debug, + context=context) From 9a42d93013e2161b969cd86e7b0bf153f16955bc Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 7 Dec 2015 10:04:16 +0100 Subject: [PATCH 09/56] Module in tree view by default, filtered on Installed modules (not Apps) --- base_usability/__openerp__.py | 5 +++++ base_usability/module_view.xml | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 base_usability/module_view.xml diff --git a/base_usability/__openerp__.py b/base_usability/__openerp__.py index fe033a2..0946035 100644 --- a/base_usability/__openerp__.py +++ b/base_usability/__openerp__.py @@ -36,12 +36,17 @@ This module adds *track_visibility='onchange'* on all the important fields of th By default, Odoo doesn't display the title field on all the partner form views. This module fixes it (it replaces the module base_title_on_partner). By default, users in the Partner Contact group also have create/write access on Countries and States. This module removes that: only the users in the *Administration > Configuration* group have create/write/delete access on those objects. + +It also adds a log message at INFO level when sending an email via SMTP. + +It displays the Local modules by default in tree view (instead of Kanban) filtered on installed modules (instead of filtered on Apps). """, 'author': 'Akretion', 'website': 'http://www.akretion.com', 'depends': ['base', 'mail'], 'data': [ 'partner_view.xml', + 'module_view.xml', 'security/ir.model.access.csv', ], 'installable': True, diff --git a/base_usability/module_view.xml b/base_usability/module_view.xml new file mode 100644 index 0000000..5274550 --- /dev/null +++ b/base_usability/module_view.xml @@ -0,0 +1,17 @@ + + + + + + + + {'search_default_installed': 1} + tree,form,kanban + + + + From 5416fc1219952e4e6cb092db7627d70cb9c3d8d8 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 8 Dec 2015 11:09:48 +0100 Subject: [PATCH 10/56] Add state in translation tree view --- base_usability/__openerp__.py | 1 + base_usability/translation_view.xml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 base_usability/translation_view.xml diff --git a/base_usability/__openerp__.py b/base_usability/__openerp__.py index 0946035..d59193c 100644 --- a/base_usability/__openerp__.py +++ b/base_usability/__openerp__.py @@ -47,6 +47,7 @@ It displays the Local modules by default in tree view (instead of Kanban) filter 'data': [ 'partner_view.xml', 'module_view.xml', + 'translation_view.xml', 'security/ir.model.access.csv', ], 'installable': True, diff --git a/base_usability/translation_view.xml b/base_usability/translation_view.xml new file mode 100644 index 0000000..026d59d --- /dev/null +++ b/base_usability/translation_view.xml @@ -0,0 +1,23 @@ + + + + + + + + base_usability.state.translation.tree + ir.translation + + + + + + + + + + From cb2dc352af0c5b6d6073a3a2614dde60ba2cea2b Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 1 Jan 2016 11:39:15 +0100 Subject: [PATCH 11/56] Better search and form views for countries and states --- base_usability/__openerp__.py | 1 + base_usability/country_view.xml | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 base_usability/country_view.xml diff --git a/base_usability/__openerp__.py b/base_usability/__openerp__.py index d59193c..7f336f5 100644 --- a/base_usability/__openerp__.py +++ b/base_usability/__openerp__.py @@ -46,6 +46,7 @@ It displays the Local modules by default in tree view (instead of Kanban) filter 'depends': ['base', 'mail'], 'data': [ 'partner_view.xml', + 'country_view.xml', 'module_view.xml', 'translation_view.xml', 'security/ir.model.access.csv', diff --git a/base_usability/country_view.xml b/base_usability/country_view.xml new file mode 100644 index 0000000..fcb048c --- /dev/null +++ b/base_usability/country_view.xml @@ -0,0 +1,53 @@ + + + + + + + + base_usability.res.country.state.search + res.country.state + + + + + + + + + + + + + + base_usability.res.country.search + res.country + + + + + + + + + + + + + + base_usability.res.country.form + res.country + + + + + + + + + + From 8bf7cf021839254c8d9613ef16031688c4e61cf6 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 30 Mar 2016 14:17:10 +0200 Subject: [PATCH 12/56] Modify default values for lang wizards --- base_usability/__init__.py | 1 + base_usability/misc.py | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 base_usability/misc.py diff --git a/base_usability/__init__.py b/base_usability/__init__.py index 75c4381..a0c9233 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -2,3 +2,4 @@ from . import partner from . import mail +from . import misc diff --git a/base_usability/misc.py b/base_usability/misc.py new file mode 100644 index 0000000..557b02a --- /dev/null +++ b/base_usability/misc.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Base Usability module for Odoo +# Copyright (C) 2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, fields + + +class BaseLanguageExport(models.TransientModel): + _inherit = 'base.language.export' + + # Default format for language files = format used by OpenERP modules + format = fields.Selection(default='po') + + +class BaseLanguageInstall(models.TransientModel): + _inherit = 'base.language.install' + + overwrite = fields.Boolean(default=True) From c74f82d232c3f162a94da65ad087baff21e9f031 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 3 May 2016 18:30:25 +0200 Subject: [PATCH 13/56] Allow to force a date in the computation of the prefix of a sequence --- base_usability/__init__.py | 1 + base_usability/ir_sequence.py | 48 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 base_usability/ir_sequence.py diff --git a/base_usability/__init__.py b/base_usability/__init__.py index a0c9233..1baafee 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -3,3 +3,4 @@ from . import partner from . import mail from . import misc +from . import ir_sequence diff --git a/base_usability/ir_sequence.py b/base_usability/ir_sequence.py new file mode 100644 index 0000000..1d7f014 --- /dev/null +++ b/base_usability/ir_sequence.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Base Usability module for Odoo +# Copyright (C) 2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, fields +from datetime import datetime +import pytz + + +class IrSequence(models.Model): + _inherit = 'ir.sequence' + + def _interpolation_dict_context(self, context=None): + if context is None: + context = {} + t = False + if context.get('force_sequence_date'): + date_str = context['force_sequence_date'] + if isinstance(date_str, (str, unicode)) and len(date_str) == 10: + t = fields.Date.from_string(date_str) + if not t: + t = datetime.now(pytz.timezone(context.get('tz') or 'UTC')) + sequences = { + 'year': '%Y', 'month': '%m', 'day': '%d', 'y': '%y', 'doy': '%j', + 'woy': '%W', + 'weekday': '%w', 'h24': '%H', 'h12': '%I', 'min': '%M', 'sec': '%S' + } + return { + key: t.strftime(sequence) + for key, sequence in sequences.iteritems()} From aeb987eca7c48bd9914f9c93b4a70bdc9afe4249 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 20 May 2016 12:51:12 +0200 Subject: [PATCH 14/56] Add module account_hide_analytic_line --- base_usability/__openerp__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base_usability/__openerp__.py b/base_usability/__openerp__.py index 7f336f5..538773a 100644 --- a/base_usability/__openerp__.py +++ b/base_usability/__openerp__.py @@ -45,11 +45,12 @@ It displays the Local modules by default in tree view (instead of Kanban) filter 'website': 'http://www.akretion.com', 'depends': ['base', 'mail'], 'data': [ + 'security/group.xml', + 'security/ir.model.access.csv', 'partner_view.xml', 'country_view.xml', 'module_view.xml', 'translation_view.xml', - 'security/ir.model.access.csv', ], 'installable': True, } From 3401f972ad74ea19b5dbe85ede1db6dbe77dcf45 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 20 May 2016 12:52:13 +0200 Subject: [PATCH 15/56] Forgot a file --- base_usability/security/group.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 base_usability/security/group.xml diff --git a/base_usability/security/group.xml b/base_usability/security/group.xml new file mode 100644 index 0000000..8572291 --- /dev/null +++ b/base_usability/security/group.xml @@ -0,0 +1,24 @@ + + + + + + + + + + Nobody (used to hide native menus) + + + + From b1f978408e884f436baf0634764018e91261a640 Mon Sep 17 00:00:00 2001 From: David Beal Date: Tue, 24 May 2016 11:14:12 +0200 Subject: [PATCH 16/56] [IMP] usability module --- base_usability/module_view.xml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/base_usability/module_view.xml b/base_usability/module_view.xml index 5274550..41a8cc5 100644 --- a/base_usability/module_view.xml +++ b/base_usability/module_view.xml @@ -8,10 +8,20 @@ - - {'search_default_installed': 1} - tree,form,kanban - + + ir.module.module + + + + + + + + + + ir.module.module + {} + From 7206f30c5792eb4b1b037857d566b9e045cc38b3 Mon Sep 17 00:00:00 2001 From: David Beal Date: Tue, 24 May 2016 11:36:13 +0200 Subject: [PATCH 17/56] [IMP] hide description field on product --- base_usability/__openerp__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base_usability/__openerp__.py b/base_usability/__openerp__.py index 538773a..c270c45 100644 --- a/base_usability/__openerp__.py +++ b/base_usability/__openerp__.py @@ -39,7 +39,8 @@ By default, users in the Partner Contact group also have create/write access on It also adds a log message at INFO level when sending an email via SMTP. -It displays the Local modules by default in tree view (instead of Kanban) filtered on installed modules (instead of filtered on Apps). +It displays the Local modules by default in tree view (instead of Kanban) without filter. +A group by 'State' is added to module search view. """, 'author': 'Akretion', 'website': 'http://www.akretion.com', From b559f2258e8c9a404016476a6f178172ebaf40c0 Mon Sep 17 00:00:00 2001 From: David Beal Date: Sun, 19 Jun 2016 10:45:12 +0200 Subject: [PATCH 18/56] Update __openerp__.py --- base_usability/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_usability/__openerp__.py b/base_usability/__openerp__.py index c270c45..d8a92b1 100644 --- a/base_usability/__openerp__.py +++ b/base_usability/__openerp__.py @@ -39,7 +39,7 @@ By default, users in the Partner Contact group also have create/write access on It also adds a log message at INFO level when sending an email via SMTP. -It displays the Local modules by default in tree view (instead of Kanban) without filter. +It displays the local modules by default in tree view (instead of Kanban) without filter. A group by 'State' is added to module search view. """, 'author': 'Akretion', From d0204a6a30b77411365886febfb1691df03c1f36 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 11 Oct 2016 15:32:30 +0200 Subject: [PATCH 19/56] Set all modules as uninstallable --- base_usability/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_usability/__openerp__.py b/base_usability/__openerp__.py index d8a92b1..b38e5dd 100644 --- a/base_usability/__openerp__.py +++ b/base_usability/__openerp__.py @@ -53,5 +53,5 @@ A group by 'State' is added to module search view. 'module_view.xml', 'translation_view.xml', ], - 'installable': True, + 'installable': False, } From 3bde97db3fed081bcc57cf546b7d8b6c163c20e4 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 11 Oct 2016 15:40:03 +0200 Subject: [PATCH 20/56] Mass rename from __openerp__.py to __manifest__.py --- base_usability/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename base_usability/{__openerp__.py => __manifest__.py} (100%) diff --git a/base_usability/__openerp__.py b/base_usability/__manifest__.py similarity index 100% rename from base_usability/__openerp__.py rename to base_usability/__manifest__.py From 6d887f79cf471a8ffabf5071ec83c911d9b96c29 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 27 Oct 2016 09:33:15 +0200 Subject: [PATCH 21/56] Port base_usability, sale_usability, sale_stock_usability to v10 --- base_usability/__init__.py | 1 - base_usability/__manifest__.py | 31 +++-------- base_usability/country_view.xml | 14 +++-- base_usability/ir_sequence.py | 48 ----------------- base_usability/mail.py | 34 +++--------- base_usability/misc.py | 24 ++------- base_usability/module_view.xml | 37 ++++++------- base_usability/partner.py | 57 +++++++++------------ base_usability/partner_view.xml | 27 +++------- base_usability/security/group.xml | 6 +-- base_usability/security/ir.model.access.csv | 1 + base_usability/translation_view.xml | 23 --------- 12 files changed, 73 insertions(+), 230 deletions(-) delete mode 100644 base_usability/ir_sequence.py delete mode 100644 base_usability/translation_view.xml diff --git a/base_usability/__init__.py b/base_usability/__init__.py index 1baafee..a0c9233 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -3,4 +3,3 @@ from . import partner from . import mail from . import misc -from . import ir_sequence diff --git a/base_usability/__manifest__.py b/base_usability/__manifest__.py index b38e5dd..fecea96 100644 --- a/base_usability/__manifest__.py +++ b/base_usability/__manifest__.py @@ -1,25 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2014-2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - +# -*- coding: utf-8 -*- +# © 2014-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Base Usability', @@ -44,14 +26,13 @@ A group by 'State' is added to module search view. """, 'author': 'Akretion', 'website': 'http://www.akretion.com', - 'depends': ['base', 'mail'], + 'depends': ['base'], 'data': [ 'security/group.xml', 'security/ir.model.access.csv', 'partner_view.xml', 'country_view.xml', 'module_view.xml', - 'translation_view.xml', ], - 'installable': False, + 'installable': True, } diff --git a/base_usability/country_view.xml b/base_usability/country_view.xml index fcb048c..9a5e486 100644 --- a/base_usability/country_view.xml +++ b/base_usability/country_view.xml @@ -1,12 +1,11 @@ - - + base_usability.res.country.state.search @@ -43,11 +42,10 @@ res.country - + - - + diff --git a/base_usability/ir_sequence.py b/base_usability/ir_sequence.py deleted file mode 100644 index 1d7f014..0000000 --- a/base_usability/ir_sequence.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2016 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - -from openerp import models, fields -from datetime import datetime -import pytz - - -class IrSequence(models.Model): - _inherit = 'ir.sequence' - - def _interpolation_dict_context(self, context=None): - if context is None: - context = {} - t = False - if context.get('force_sequence_date'): - date_str = context['force_sequence_date'] - if isinstance(date_str, (str, unicode)) and len(date_str) == 10: - t = fields.Date.from_string(date_str) - if not t: - t = datetime.now(pytz.timezone(context.get('tz') or 'UTC')) - sequences = { - 'year': '%Y', 'month': '%m', 'day': '%d', 'y': '%y', 'doy': '%j', - 'woy': '%W', - 'weekday': '%w', 'h24': '%H', 'h12': '%I', 'min': '%M', 'sec': '%S' - } - return { - key: t.strftime(sequence) - for key, sequence in sequences.iteritems()} diff --git a/base_usability/mail.py b/base_usability/mail.py index a9cd095..c507cbe 100644 --- a/base_usability/mail.py +++ b/base_usability/mail.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com/) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2015-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models +from odoo import models, api import logging logger = logging.getLogger(__name__) @@ -29,18 +11,18 @@ logger = logging.getLogger(__name__) class IrMailServer(models.Model): _inherit = "ir.mail_server" + @api.model def send_email( - self, cr, uid, message, mail_server_id=None, smtp_server=None, + self, message, mail_server_id=None, smtp_server=None, smtp_port=None, smtp_user=None, smtp_password=None, - smtp_encryption=None, smtp_debug=False, context=None): + smtp_encryption=None, smtp_debug=False): logger.info("Sending email to %s copy %s with subject %s", message.get('To'), message.get('Cc'), message.get('Subject')) return super(IrMailServer, self).send_email( - cr, uid, message, mail_server_id=mail_server_id, + message, mail_server_id=mail_server_id, smtp_server=smtp_server, smtp_port=smtp_port, smtp_user=smtp_user, smtp_password=smtp_password, - smtp_encryption=smtp_encryption, smtp_debug=smtp_debug, - context=context) + smtp_encryption=smtp_encryption, smtp_debug=smtp_debug) diff --git a/base_usability/misc.py b/base_usability/misc.py index 557b02a..da6960e 100644 --- a/base_usability/misc.py +++ b/base_usability/misc.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2016 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2015-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields +from odoo import models, fields class BaseLanguageExport(models.TransientModel): diff --git a/base_usability/module_view.xml b/base_usability/module_view.xml index 41a8cc5..e55dbb6 100644 --- a/base_usability/module_view.xml +++ b/base_usability/module_view.xml @@ -1,27 +1,24 @@ - - + - - ir.module.module - - - - - - - + + ir.module.module + + + + + + + - - ir.module.module - {} - + + {} + - - + diff --git a/base_usability/partner.py b/base_usability/partner.py index 3d8cfcb..d5fe3d6 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -1,31 +1,16 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Base Usability module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from odoo import models, fields, api -class Partner(models.Model): +class ResPartner(models.Model): _inherit = 'res.partner' + # track_visibility is handled in the 'mail' module, and base_usability + # doesn't depend on 'mail', but that doesn't hurt, it will just be + # ignored if mail is not installed name = fields.Char(track_visibility='onchange') parent_id = fields.Many2one(track_visibility='onchange') ref = fields.Char(track_visibility='onchange') @@ -43,20 +28,26 @@ class Partner(models.Model): country_id = fields.Many2one(track_visibility='onchange') email = fields.Char(track_visibility='onchange') is_company = fields.Boolean(track_visibility='onchange') - use_parent_address = fields.Boolean(track_visibility='onchange') active = fields.Boolean(track_visibility='onchange') # For reports name_title = fields.Char( compute='_compute_name_title', string='Name with Title') - @api.one - @api.depends('name', 'title', 'is_company') + @api.multi + @api.depends('name', 'title') def _compute_name_title(self): - name_title = self.name - if self.title: - title = self.title.shortcut or self.title - if self.is_company: - name_title = ' '.join([name_title, title]) - else: + for partner in self: + name_title = partner.name + if partner.title and not partner.is_company: + title = partner.title.shortcut or partner.title name_title = ' '.join([title, name_title]) - self.name_title = name_title + partner.name_title = name_title + + @api.multi + def _display_address(self, without_company=False): + '''Remove empty lines''' + res = super(ResPartner, self)._display_address( + without_company=without_company) + while "\n\n" in res: + res = res.replace('\n\n', '\n') + return res diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml index 166adf1..b05f8f8 100644 --- a/base_usability/partner_view.xml +++ b/base_usability/partner_view.xml @@ -1,32 +1,21 @@ - - + base_usability.title.on.partner.form res.partner - - - - - - {'readonly': [('parent_id', '!=', False)]} - - + width: 650px; - - width: 600px; - @@ -38,11 +27,7 @@ - - {'readonly': [('parent_id', '!=', False)]} - - - + diff --git a/base_usability/security/group.xml b/base_usability/security/group.xml index 8572291..bb84ffa 100644 --- a/base_usability/security/group.xml +++ b/base_usability/security/group.xml @@ -5,8 +5,7 @@ --> - - + Nobody (used to hide native menus) - - + diff --git a/base_usability/security/ir.model.access.csv b/base_usability/security/ir.model.access.csv index 48ea11a..947087d 100644 --- a/base_usability/security/ir.model.access.csv +++ b/base_usability/security/ir.model.access.csv @@ -2,3 +2,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink base.access_res_country_group_user,Full access on res.country to Settings group,base.model_res_country,base.group_system,1,1,1,1 base.access_res_country_state_group_user,Full access on res.country.state to Settings group,base.model_res_country_state,base.group_system,1,1,1,1 base.access_res_country_group_group_user,Full access on res.country.group to Settings group,base.model_res_country_group,base.group_system,1,1,1,1 +base.access_res_partner_title_group_user,Full access on res.partner.title,base.model_res_partner_title,base.group_system,1,1,1,1 diff --git a/base_usability/translation_view.xml b/base_usability/translation_view.xml deleted file mode 100644 index 026d59d..0000000 --- a/base_usability/translation_view.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - base_usability.state.translation.tree - ir.translation - - - - - - - - - - From 250b749b232385951912f34af2c84a3e67088bf3 Mon Sep 17 00:00:00 2001 From: David Beal Date: Fri, 18 Nov 2016 10:37:43 +0100 Subject: [PATCH 22/56] IMP add icons --- base_usability/static/description/icon.png | Bin 0 -> 6662 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 base_usability/static/description/icon.png diff --git a/base_usability/static/description/icon.png b/base_usability/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1a60d0ef970b6a9b19e742f3bb9f86cb17f52daa GIT binary patch literal 6662 zcmWkz1z3|^6rLy{-Ca^r(k(6BB_Jss(jZ-;2uKMyx>H(8Bt~}+ejHr`k?yYl`s`ag zd$w=)JNKNo7Nw=3h=WOq34uUxl$GRkz_SLpn`5AXM+N#LM(~7Ysj4UkdH8qBg_R_M zcb>W_z43%Vu!#QMA3@SH$-$fGUdrn7=qp(G1pH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hTmIm)a`R5dhPC^f14U)!r}aiJfK(HSdj)8EeDf6mj4IQX z&;QJei02<{{Ys;7;2W@UaAMauvp0LEX%*b5`rQXcM{WFJOa0`p09lOS%NJ;W*DE8R z0oq&MnF&yWEef6x~#if zP-lndJXaree0`jv$L0hGp%A_ zVa0?oFffJPQC4D2Y}W7?Yrz^DC4O9qo@BtE|(9{HC8yRq9Vta)>)RJ8!77 z5Jf8#BxNJ;%`wMMoX)nVyUJddR}E|&Kg4l&Q8W%9xftNi^b8<-`e@DcUz%5<0M}$* z1g*ak@Fg>Zbe@_4D|+lu`!sV`C#R9rfiPd;RUr^GoOV3M`w@;sCdA+8|L~icIz*W8 z1r;T=Ee0@J)Tk@xCBUhbFzb>?gb@dyI47R}bf zF05~9X`;+~e<7cM%$&SB*&IY3ai(eKMwR=`I{g&9Ip1R}fQzh#o8TkpIiV`y;JZ`6 zBoDYWKF}Qn^A|JIK>Ypv|Ky1KCF)lg5^%tBDo{xgDDK-bDJTS9(rxH>ETq*JJmHNq%s z6Bk9<;Y5fu;OWA>`NpZ)I=gXv`1z&DTzxT>uuIRmI?Gfu(4rGySHh2)X`-kHPg;L~ zglDeKE?&#rygfu=tL`9h^Cct{Sc6`JDwC^Kj_OufpvIC+pUDmk4CKBr{yCB1+BR$3 zI3I!m8JDqxm28k`>Se9(FEC z)Bg~XeD~6sEtr{-VY0EYvHg7RU9~8!|KDdi<E%WYavU#~S!^v-HT6yGsMHD+vL!`i)X(VEyiS+;n^B59HRYoSbrIW=kD_q7D80{0e{p*<4>2?>VUX! zNaOY1w!P0bG!it8$`X731z0P Date: Wed, 14 Dec 2016 14:21:31 +0100 Subject: [PATCH 23/56] Add string in partner search view --- base_usability/partner_view.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml index b05f8f8..3a3c4b3 100644 --- a/base_usability/partner_view.xml +++ b/base_usability/partner_view.xml @@ -30,4 +30,16 @@ + + base_usability.partner.search.form + res.partner + + + + Name or Email + + + + + From 19d2dba6cb4490374c0a51816671ec0a8cfa9cf2 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 15 Dec 2016 17:39:48 +0100 Subject: [PATCH 24/56] Handle lang in name_title field --- base_usability/partner.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/base_usability/partner.py b/base_usability/partner.py index d5fe3d6..7a6c87b 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -39,8 +39,14 @@ class ResPartner(models.Model): for partner in self: name_title = partner.name if partner.title and not partner.is_company: - title = partner.title.shortcut or partner.title - name_title = ' '.join([title, name_title]) + partner_lg = partner + # If prefer to read the lang of the partner than the lang + # of the context. That way, an English man will be displayed + # with his title in English whatever the environment + if partner.lang: + partner_lg = partner.with_context(lang=partner.lang) + title = partner_lg.title.shortcut or partner_lg.title.name + name_title = u' '.join([title, name_title]) partner.name_title = name_title @api.multi From f36904552db801068767a9c909f60b9c3963c8be Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 16 Dec 2016 00:55:53 +0100 Subject: [PATCH 25/56] Add method for reports --- base_usability/partner.py | 49 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/base_usability/partner.py b/base_usability/partner.py index 7a6c87b..83d836c 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -2,7 +2,7 @@ # © 2015-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api +from odoo import models, fields, api, _ class ResPartner(models.Model): @@ -57,3 +57,50 @@ class ResPartner(models.Model): while "\n\n" in res: res = res.replace('\n\n', '\n') return res + + # for reports + @api.multi + def _display_full_address( + self, details=['address', 'phone', 'fax', 'mobile', 'email'], + icon=True, without_company=False): + self.ensure_one() + res = self.name_title + if ( + not without_company and + self.parent_id and + self.parent_id.is_company): + res = self.parent_id.name + '\n' + res + options = { + 'phone': { + 'value': self.phone, + # http://www.fileformat.info/info/unicode/char/1f4de/index.htm + 'icon': u'\U0001F4DE', + 'label': _('Tel:')}, + 'fax': { + 'value': self.fax, + # http://www.fileformat.info/info/unicode/char/1f5b7/index.htm + 'icon': u'\U0001F5B7', + 'label': _('Fax:')}, + 'mobile': { + 'value': self.mobile, + # http://www.fileformat.info/info/unicode/char/1f4f1/index.htm + 'icon': u'\U0001F4F1', + 'label': _('Mobile:')}, + 'email': { + 'value': self.email, + # http://www.fileformat.info/info/unicode/char/2709/index.htm + 'icon': u'\u2709', + 'label': _('E-mail:')}, + 'address': { + 'value': self._display_address(without_company=True), + } + } + for detail in details: + if options.get(detail) and options[detail]['value']: + entry = options[detail] + prefix = icon and entry.get('icon') or entry.get('label') + if prefix: + res += u'\n%s %s' % (prefix, entry['value']) + else: + res += u'\n%s' % entry['value'] + return res From 88fd24faa9cbc5e6a36ba4ab06de764077d423e8 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 19 Dec 2016 02:06:11 +0100 Subject: [PATCH 26/56] Monkey-patching of formatLang to have clean display of float that are integers --- base_usability/__init__.py | 1 + base_usability/report_sxw.py | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 base_usability/report_sxw.py diff --git a/base_usability/__init__.py b/base_usability/__init__.py index a0c9233..32f4452 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -3,3 +3,4 @@ from . import partner from . import mail from . import misc +from . import report_sxw diff --git a/base_usability/report_sxw.py b/base_usability/report_sxw.py new file mode 100644 index 0000000..d1ce3b1 --- /dev/null +++ b/base_usability/report_sxw.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, api +from odoo.report import report_sxw +from openerp.tools import float_compare + + +class BaseUsabilityInstalled(models.AbstractModel): + _name = "base.usability.installed" + + +formatLang_original = report_sxw.rml_parse.formatLang + + +def formatLang( + self, value, digits=None, date=False, date_time=False, grouping=True, + monetary=False, dp=False, currency_obj=False, int_no_digits=True): + with api.Environment.manage(): + env = api.Environment(self.cr, self.uid, {}) + if ( + 'base.usability.installed' in env and + int_no_digits and + isinstance(value, float) and + dp): + prec = env['decimal.precision'].precision_get(dp) + if not float_compare(value, int(value), precision_digits=prec): + digits = 0 + dp = False + res = formatLang_original( + self, value, digits=digits, date=date, date_time=date_time, + grouping=grouping, monetary=monetary, dp=dp, currency_obj=currency_obj) + return res + +report_sxw.rml_parse.formatLang = formatLang From 0bd84171e2a1a8272a1adcaa694ba5ce5073ab2e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 20 Dec 2016 01:05:09 +0100 Subject: [PATCH 27/56] Add methods for reports --- base_usability/__init__.py | 1 + base_usability/company.py | 81 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 base_usability/company.py diff --git a/base_usability/__init__.py b/base_usability/__init__.py index 32f4452..767083b 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from . import partner +from . import company from . import mail from . import misc from . import report_sxw diff --git a/base_usability/company.py b/base_usability/company.py new file mode 100644 index 0000000..2cb4206 --- /dev/null +++ b/base_usability/company.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +# © 2015-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, api, _ + + +class ResCompany(models.Model): + _inherit = 'res.company' + + @api.model + def generate_line(self, fields, options, icon=True, separator=' - '): + assert fields + assert options + content = [] + for field in fields: + value = False + if isinstance(field, tuple) and len(field) == 2: + value = field[0] + label = field[1] + uicon = False + elif isinstance(field, (str, unicode)) and field in options: + value = options[field]['value'] + label = options[field].get('label') + uicon = options[field].get('icon') + if value: + prefix = icon and uicon or label + if prefix: + content.append(u'%s %s' % (prefix, value)) + else: + content.append(value) + line = separator.join(content) + return line + + @api.multi + def _prepare_header_options(self): + self.ensure_one() + options = { + 'phone': { + 'value': self.phone, + # http://www.fileformat.info/info/unicode/char/1f4de/index.htm + 'icon': u'\U0001F4DE', + 'label': _('Tel:')}, + 'fax': { + 'value': self.fax, + # http://www.fileformat.info/info/unicode/char/1f5b7/index.htm + 'icon': u'\U0001F5B7', + 'label': _('Fax:')}, + 'email': { + 'value': self.email, + # http://www.fileformat.info/info/unicode/char/2709/index.htm + 'icon': u'\u2709', + 'label': _('E-mail:')}, + 'website': { + 'value': self.website, + 'icon': u'\U0001f310', + 'label': _('Website:')}, + 'vat': { + 'value': self.vat, + 'label': _('TVA :')}, # TODO translate + } + return options + + # for reports + @api.multi + def _display_report_header( + self, line_details=[['phone', 'fax', 'website'], ['vat']], + icon=True, line_separator=' - '): + self.ensure_one() + res = u'' + address = self.partner_id._display_address(without_company=True) + address = address.replace('\n', u' - ') + line1 = u'%s - %s' % (self.name, address) + lines = [line1] + options = self._prepare_header_options() + for details in line_details: + line = self.generate_line( + details, options, icon=icon, separator=line_separator) + lines.append(line) + res = '\n'.join(lines) + return res From 58b83c2844dac44bd9a8389c717813e89ce6b157 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 23 Dec 2016 00:23:17 +0100 Subject: [PATCH 28/56] Add comment about py3o and icons --- base_usability/partner.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base_usability/partner.py b/base_usability/partner.py index 83d836c..328d773 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -70,6 +70,9 @@ class ResPartner(models.Model): self.parent_id and self.parent_id.is_company): res = self.parent_id.name + '\n' + res + # To make the icons work with py3o with PDF export, on the py3o server: + # 1) sudo apt-get install fonts-symbola + # 2) start libreoffice in xvfb (don't use --headless) (To confirm) options = { 'phone': { 'value': self.phone, From 187a531fce346ed6b5f65c109230e3de4ebf54d6 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 31 Dec 2016 17:42:44 +0100 Subject: [PATCH 29/56] New prototype for method _display_full_address() (Py3o reports will need to be updated) --- base_usability/partner.py | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/base_usability/partner.py b/base_usability/partner.py index 328d773..3708887 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -61,49 +61,57 @@ class ResPartner(models.Model): # for reports @api.multi def _display_full_address( - self, details=['address', 'phone', 'fax', 'mobile', 'email'], - icon=True, without_company=False): + self, details=[ + 'company', 'name', 'address', 'phone', 'fax', + 'mobile', 'email'], + icon=True): self.ensure_one() - res = self.name_title - if ( - not without_company and - self.parent_id and - self.parent_id.is_company): - res = self.parent_id.name + '\n' + res # To make the icons work with py3o with PDF export, on the py3o server: # 1) sudo apt-get install fonts-symbola # 2) start libreoffice in xvfb (don't use --headless) (To confirm) options = { + 'name': { + 'value': self.name_title, + }, + 'company': { + 'value': self.parent_id and self.parent_id.is_company and + self.parent_id.name or False, + }, 'phone': { 'value': self.phone, # http://www.fileformat.info/info/unicode/char/1f4de/index.htm 'icon': u'\U0001F4DE', - 'label': _('Tel:')}, + 'label': _('Tel:'), + }, 'fax': { 'value': self.fax, # http://www.fileformat.info/info/unicode/char/1f5b7/index.htm 'icon': u'\U0001F5B7', - 'label': _('Fax:')}, + 'label': _('Fax:'), + }, 'mobile': { 'value': self.mobile, # http://www.fileformat.info/info/unicode/char/1f4f1/index.htm 'icon': u'\U0001F4F1', - 'label': _('Mobile:')}, + 'label': _('Mobile:'), + }, 'email': { 'value': self.email, # http://www.fileformat.info/info/unicode/char/2709/index.htm 'icon': u'\u2709', - 'label': _('E-mail:')}, + 'label': _('E-mail:'), + }, 'address': { 'value': self._display_address(without_company=True), } } + res = [] for detail in details: if options.get(detail) and options[detail]['value']: entry = options[detail] prefix = icon and entry.get('icon') or entry.get('label') if prefix: - res += u'\n%s %s' % (prefix, entry['value']) + res.append(u'%s %s' % (prefix, entry['value'])) else: - res += u'\n%s' % entry['value'] - return res + res.append(u'%s' % entry['value']) + return '\n'.join(res) From b8d98a80ad1ded3290323c9968251e98be66adea Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sun, 1 Jan 2017 08:36:51 +0100 Subject: [PATCH 30/56] Add track_visibility='onchange' on important fields of picking Code cleanup --- base_usability/partner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base_usability/partner.py b/base_usability/partner.py index 3708887..f59318f 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -114,4 +114,5 @@ class ResPartner(models.Model): res.append(u'%s %s' % (prefix, entry['value'])) else: res.append(u'%s' % entry['value']) - return '\n'.join(res) + res = '\n'.join(res) + return res From f62f7121db16ca6af6b49e7327f352886c0d5e51 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 3 Jan 2017 15:34:44 +0100 Subject: [PATCH 31/56] Add city and country in partner tree view --- base_usability/partner_view.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml index 3a3c4b3..4b72a96 100644 --- a/base_usability/partner_view.xml +++ b/base_usability/partner_view.xml @@ -30,6 +30,20 @@ + + base_usability.res.partner.tree + res.partner + + + + 0 + + + + + + + base_usability.partner.search.form res.partner @@ -41,5 +55,4 @@ - From 2db13433c3ea017bb7e7616dd84bbccbf8c4908f Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 4 Jan 2017 18:52:29 +0100 Subject: [PATCH 32/56] Add 'website' on partner display --- base_usability/partner.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base_usability/partner.py b/base_usability/partner.py index f59318f..f31f4d4 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -101,6 +101,12 @@ class ResPartner(models.Model): 'icon': u'\u2709', 'label': _('E-mail:'), }, + 'website': { + 'value': self.website, + # http://www.fileformat.info/info/unicode/char/1f310/index.htm + 'icon': u'\U0001f310', + 'label': _('Website:'), + }, 'address': { 'value': self._display_address(without_company=True), } From d1813a0f421f83a113c5a5cc73f30806f32c73a5 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 9 Jan 2017 22:56:35 +0100 Subject: [PATCH 33/56] Update company/name in report --- base_usability/partner.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/base_usability/partner.py b/base_usability/partner.py index f31f4d4..4e93a38 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -69,13 +69,19 @@ class ResPartner(models.Model): # To make the icons work with py3o with PDF export, on the py3o server: # 1) sudo apt-get install fonts-symbola # 2) start libreoffice in xvfb (don't use --headless) (To confirm) + if self.is_company: + company = self.name + name = False + else: + name = self.name_title + company = self.parent_id and self.parent_id.is_company and\ + self.parent_id.name or False options = { 'name': { - 'value': self.name_title, + 'value': name, }, 'company': { - 'value': self.parent_id and self.parent_id.is_company and - self.parent_id.name or False, + 'value': company, }, 'phone': { 'value': self.phone, From b5d7f5e5f76fb0a7fc6f8734ce857922181a51fc Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 1 Feb 2017 12:08:38 +0100 Subject: [PATCH 34/56] Legal name in report header --- base_usability/company.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/base_usability/company.py b/base_usability/company.py index 2cb4206..dfe6e15 100644 --- a/base_usability/company.py +++ b/base_usability/company.py @@ -61,6 +61,11 @@ class ResCompany(models.Model): } return options + def _report_company_legal_name(self): + '''Method inherited in the module base_company_extension''' + self.ensure_one() + return self.name + # for reports @api.multi def _display_report_header( @@ -70,7 +75,8 @@ class ResCompany(models.Model): res = u'' address = self.partner_id._display_address(without_company=True) address = address.replace('\n', u' - ') - line1 = u'%s - %s' % (self.name, address) + + line1 = u'%s - %s' % (self._report_company_legal_name(), address) lines = [line1] options = self._prepare_header_options() for details in line_details: From b50c167b40336e45efc39d3bf1a5542f1ae122fc Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 24 Mar 2017 18:00:53 +0100 Subject: [PATCH 35/56] Display more fields on stock.quant form view Better search view on partners --- base_usability/partner_view.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml index 4b72a96..91951cf 100644 --- a/base_usability/partner_view.xml +++ b/base_usability/partner_view.xml @@ -50,7 +50,9 @@ - Name or Email + Name or Email or Reference + + ['|','|',('display_name','ilike',self),('ref','=ilike',self + '%'),('email','ilike',self)] From c1d12605422a1a66794dcc7d1e03965874097f4d Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 29 Mar 2017 17:45:16 +0200 Subject: [PATCH 36/56] Better log message for outgoing emails --- base_usability/mail.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/base_usability/mail.py b/base_usability/mail.py index c507cbe..ebcc299 100644 --- a/base_usability/mail.py +++ b/base_usability/mail.py @@ -3,6 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, api +from odoo.addons.base.ir.ir_mail_server import extract_rfc2822_addresses import logging logger = logging.getLogger(__name__) @@ -16,11 +17,17 @@ class IrMailServer(models.Model): self, message, mail_server_id=None, smtp_server=None, smtp_port=None, smtp_user=None, smtp_password=None, smtp_encryption=None, smtp_debug=False): - - logger.info("Sending email to %s copy %s with subject %s", - message.get('To'), - message.get('Cc'), - message.get('Subject')) + # Start copy from native method + smtp_from = message['Return-Path'] or\ + self._get_default_bounce_address() or message['From'] + from_rfc2822 = extract_rfc2822_addresses(smtp_from) + smtp_from = from_rfc2822[-1] + # End copy from native method + logger.info( + "Sending email from '%s' to '%s' Cc '%s' Bcc '%s' " + "with subject '%s'", + smtp_from, message.get('To'), message.get('Cc'), + message.get('Bcc'), message.get('Subject')) return super(IrMailServer, self).send_email( message, mail_server_id=mail_server_id, smtp_server=smtp_server, smtp_port=smtp_port, From d0b02c6ae2b1da1d8f4f2017d8dcca37fa009042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Tue, 13 Jun 2017 22:41:20 +0200 Subject: [PATCH 37/56] [10.0] setup.py and addons versions (#35) * [IMP] set 10.0 version prefix in all installable addons * [FIX] 10.0 instead of 9.0 version prefix for sale_order_add_bom on 10.0 branch * [ADD] setup.py for all installable addons --- base_usability/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_usability/__manifest__.py b/base_usability/__manifest__.py index fecea96..6e25a1a 100644 --- a/base_usability/__manifest__.py +++ b/base_usability/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Base Usability', - 'version': '0.1', + 'version': '10.0.0.1.0', 'category': 'Partner', 'license': 'AGPL-3', 'summary': 'Better usability in base module', From f91738176af6006b4026be0f429accd4cb398503 Mon Sep 17 00:00:00 2001 From: David Beal Date: Wed, 16 Aug 2017 13:45:12 +0200 Subject: [PATCH 38/56] IMP make module filter to installable --- base_usability/__manifest__.py | 2 +- base_usability/module_view.xml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/base_usability/__manifest__.py b/base_usability/__manifest__.py index 6e25a1a..094c5f9 100644 --- a/base_usability/__manifest__.py +++ b/base_usability/__manifest__.py @@ -21,7 +21,7 @@ By default, users in the Partner Contact group also have create/write access on It also adds a log message at INFO level when sending an email via SMTP. -It displays the local modules by default in tree view (instead of Kanban) without filter. +It displays the local modules with installable filter. A group by 'State' is added to module search view. """, 'author': 'Akretion', diff --git a/base_usability/module_view.xml b/base_usability/module_view.xml index e55dbb6..3688e44 100644 --- a/base_usability/module_view.xml +++ b/base_usability/module_view.xml @@ -11,6 +11,9 @@ ir.module.module + + + @@ -18,7 +21,7 @@ - {} + {'search_default_installable': 1} From 34795353566c2b5ab96ec2c6f796138cca84b882 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 7 Sep 2017 18:41:39 +0200 Subject: [PATCH 39/56] translate=False on 'name' field of crm.lead.tag and res.partner.category --- base_usability/partner.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base_usability/partner.py b/base_usability/partner.py index 4e93a38..d1e9567 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -128,3 +128,9 @@ class ResPartner(models.Model): res.append(u'%s' % entry['value']) res = '\n'.join(res) return res + + +class ResPartnerCategory(models.Model): + _inherit = 'res.partner.category' + + name = fields.Char(translate=False) From 9bbb9087619d77072c92781459a5d200a8ec4199 Mon Sep 17 00:00:00 2001 From: David Beal Date: Wed, 22 Nov 2017 11:18:22 +0100 Subject: [PATCH 40/56] UPD Branding --- base_usability/static/description/icon.png | Bin 6662 -> 9769 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/base_usability/static/description/icon.png b/base_usability/static/description/icon.png index 1a60d0ef970b6a9b19e742f3bb9f86cb17f52daa..c91da7980d9ac757c41eb45c5388e69281434b76 100644 GIT binary patch literal 9769 zcmXY11yEH_ygrw1?xm6L4hiW7xqx(Ex*MdsyCnq_P)boc73nS|giANl-OaoI_ukIz z?wm7ccINE<;`_ee#%ri4;$pqP0ssJ42`aCJn6v-u7-)!59OS-^m{2@rm2@x=EeOLp z4)Kin7Ha5;_lg?xkShrR`?xd0JV#wc&R2u={W% z{sI7K0VR1E9lwu<`GG;kx<9W&$L0go(@jgbxM+p2RbjL)5fP*s0+iAyrK%YR4&|Sw zi?bs2FKDS#TUn^bPAR2RJ$kW&B_hn->i?E}Mk?}yWxaQjNeA11AOb^5{!JR?S=%08 z20rItUhxI;IgM??x9)F8zwB1Dac4Yi%{f(HR&0a%$?ZP6|KGs&ifW7OM#T!1iA+W@y*KeO%yn6?p(j8F(m`Qi)}I>jQbhMy zT@3ZWiG2|psZx^m&dyT|;#)6=(r7u|O?)lEDB4i9ls-!U3}DDJ&OY0%TwiuR0Zwa_qDDMobuh{c^8M(?3bLWqo#IsZh8|}qo|whY zDlt{3;BPjDiW%b4@{E^Z_H}K}3vhI!+VD{A@+rCq%4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5fu;OWA>`NpZ)I=gXv`1z&DTzxT>uuIRmI?Gfu(4rGySHh2)X`-kHPg;L~ zglDeKE?&#rygfu=tL`9h^Cct{Sc6`JDwC^Kj_OufpvIC+pUDmk4CKBr{yCB1+BR$3 zI3I!m8JDqxm28k`>Se9(FEC z)Bg~XeD~6sEtr{-VY0EYvHg7RU9~8!|KDdi<E%WYavU#~S!^v-HT6yGsMHD+vL!`i)X(VEyiS+;n^B59HRYoSbrIW=kD_q7D80{0e{p*<4>2?>VUX! zNaOY1w!P0bG!it8$`X731z0P Date: Wed, 13 Dec 2017 17:59:37 +0100 Subject: [PATCH 41/56] copy=False on ref field of res.partner --- base_usability/partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_usability/partner.py b/base_usability/partner.py index d1e9567..bbe0677 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -13,7 +13,7 @@ class ResPartner(models.Model): # ignored if mail is not installed name = fields.Char(track_visibility='onchange') parent_id = fields.Many2one(track_visibility='onchange') - ref = fields.Char(track_visibility='onchange') + ref = fields.Char(track_visibility='onchange', copy=False) lang = fields.Selection(track_visibility='onchange') user_id = fields.Many2one(track_visibility='onchange') vat = fields.Char(track_visibility='onchange') From bd9979a87dafbec644d00e26b7d7cc25d5209a4b Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 27 Feb 2018 09:30:35 +0100 Subject: [PATCH 42/56] base_usability: add tracking on company_id on res.partner --- base_usability/partner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/base_usability/partner.py b/base_usability/partner.py index bbe0677..cd30113 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -29,6 +29,7 @@ class ResPartner(models.Model): email = fields.Char(track_visibility='onchange') is_company = fields.Boolean(track_visibility='onchange') active = fields.Boolean(track_visibility='onchange') + company_id = fields.Many2one(track_visibility='onchange') # For reports name_title = fields.Char( compute='_compute_name_title', string='Name with Title') From dc287c243b882fb7a6c54d2bb981cc3a85e6a521 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 9 Mar 2018 11:22:28 +0100 Subject: [PATCH 43/56] Partners auto-created when you create a user should have customer=False and supplier=True --- base_usability/__init__.py | 1 + base_usability/users.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 base_usability/users.py diff --git a/base_usability/__init__.py b/base_usability/__init__.py index 767083b..d77ca0e 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +from . import users from . import partner from . import company from . import mail diff --git a/base_usability/users.py b/base_usability/users.py new file mode 100644 index 0000000..78bf333 --- /dev/null +++ b/base_usability/users.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, api + + +class ResUsers(models.Model): + _inherit = 'res.users' + + @api.model + def default_get(self, fields_list): + res = super(ResUsers, self).default_get(fields_list) + # For a new partner auto-created when you create a new user, we prefer + # customer=False and supplier=True by default + res.update({ + 'customer': False, + 'supplier': True, + }) + return res From 78915ccf955ecc5d1c4b9a77c56469240eddcfbe Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 22 Mar 2018 18:24:52 +0100 Subject: [PATCH 44/56] Add string on bank_name of res.partner.bank --- base_usability/partner.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/base_usability/partner.py b/base_usability/partner.py index cd30113..d600399 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -135,3 +135,12 @@ class ResPartnerCategory(models.Model): _inherit = 'res.partner.category' name = fields.Char(translate=False) + + +class ResPartnerBank(models.Model): + _inherit = 'res.partner.bank' + + # In the 'base' module, they didn't put any string, so the bank name is + # displayed as 'Name', which the string of the related field it + # points to + bank_name = fields.Char(string='Bank Name') From 6b160636925c14fdfc33ac729caf13e0298aad2a Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 23 Mar 2018 17:27:42 +0100 Subject: [PATCH 45/56] Add script to fix partners related to users in multi-company setup where partners are NOT shared between companies --- base_usability/__manifest__.py | 1 + ...ase-multi-company-partners-not-shared.diff | 18 +++++++++++++++ base_usability/users.py | 23 ++++++++++++++++++- base_usability/users_view.xml | 21 +++++++++++++++++ 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 base_usability/fix-odoo-base-multi-company-partners-not-shared.diff create mode 100644 base_usability/users_view.xml diff --git a/base_usability/__manifest__.py b/base_usability/__manifest__.py index 094c5f9..df9bbc7 100644 --- a/base_usability/__manifest__.py +++ b/base_usability/__manifest__.py @@ -31,6 +31,7 @@ A group by 'State' is added to module search view. 'security/group.xml', 'security/ir.model.access.csv', 'partner_view.xml', + 'users_view.xml', 'country_view.xml', 'module_view.xml', ], diff --git a/base_usability/fix-odoo-base-multi-company-partners-not-shared.diff b/base_usability/fix-odoo-base-multi-company-partners-not-shared.diff new file mode 100644 index 0000000..f8529eb --- /dev/null +++ b/base_usability/fix-odoo-base-multi-company-partners-not-shared.diff @@ -0,0 +1,18 @@ +diff --git a/odoo/addons/base/res/res_users.py b/odoo/addons/base/res/res_users.py +index c621ca4..d3880fe 100644 +--- a/odoo/addons/base/res/res_users.py ++++ b/odoo/addons/base/res/res_users.py +@@ -334,7 +334,12 @@ class Users(models.Model): + user = super(Users, self).create(vals) + user.partner_id.active = user.active + if user.partner_id.company_id: +- user.partner_id.write({'company_id': user.company_id.id}) ++ # AKRETION HACK: if you have a multi-company setup where ++ # partners are NOT shared between companies, having ++ # company_id=False on partners related to users ++ # avoids a lot of trouble (you should also disable 'read' ++ # on the ir.rule 'user rule' (XMLID base.res_users_rule) ++ user.partner_id.write({'company_id': False}) + return user + + @api.multi diff --git a/base_usability/users.py b/base_usability/users.py index 78bf333..2621d05 100644 --- a/base_usability/users.py +++ b/base_usability/users.py @@ -2,7 +2,10 @@ # Copyright 2018 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, api +from odoo import models, api, SUPERUSER_ID, _ +from odoo.exceptions import UserError +import logging +logger = logging.getLogger(__name__) class ResUsers(models.Model): @@ -18,3 +21,21 @@ class ResUsers(models.Model): 'supplier': True, }) return res + + @api.model + def _script_partners_linked_to_users_no_company(self): + if self.env.user.id != SUPERUSER_ID: + raise UserError(_('You must run this script as admin user')) + logger.info( + 'START to set company_id=False on partners related to users') + users = self.search( + ['|', ('active', '=', True), ('active', '=', False)]) + for user in users: + if user.partner_id.company_id: + user.partner_id.company_id = False + logger.info( + 'Wrote company_id=False on user %s ID %d', + user.login, user.id) + logger.info( + 'END setting company_id=False on partners related to users') + return True diff --git a/base_usability/users_view.xml b/base_usability/users_view.xml new file mode 100644 index 0000000..e692049 --- /dev/null +++ b/base_usability/users_view.xml @@ -0,0 +1,21 @@ + + + + + + + base_usability.res.users.tree + res.users + + + + + + + + + From 7d51bdbcd3b8be4ccf69e3eb8168211976642c0e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 20 Jun 2018 23:45:09 +0200 Subject: [PATCH 46/56] Add widget="email" on email of contacts --- base_usability/partner_view.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml index 91951cf..da409b9 100644 --- a/base_usability/partner_view.xml +++ b/base_usability/partner_view.xml @@ -16,6 +16,9 @@ width: 650px; + + email + From e34323ec99fa02db9f5b80bfa603325b59ab90e1 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 13 Jul 2018 15:43:46 +0200 Subject: [PATCH 47/56] Show title not only on Contacts --- base_usability/partner_view.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/base_usability/partner_view.xml b/base_usability/partner_view.xml index da409b9..643b94c 100644 --- a/base_usability/partner_view.xml +++ b/base_usability/partner_view.xml @@ -19,6 +19,10 @@ email + + + + From 7532676cf99521b4c53d38f731811a8738aedd54 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 18 Jul 2018 14:27:21 +0200 Subject: [PATCH 48/56] carrier_id not readonly on done picking (add tracking on it) fix for formatLang inherit in base_usability --- base_usability/report_sxw.py | 1 + 1 file changed, 1 insertion(+) diff --git a/base_usability/report_sxw.py b/base_usability/report_sxw.py index d1ce3b1..e0749c6 100644 --- a/base_usability/report_sxw.py +++ b/base_usability/report_sxw.py @@ -22,6 +22,7 @@ def formatLang( if ( 'base.usability.installed' in env and int_no_digits and + not monetary and isinstance(value, float) and dp): prec = env['decimal.precision'].precision_get(dp) From da7c38701c5e9f5a79ca5392a11caf33f0ff9851 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 17 Sep 2018 11:18:01 +0200 Subject: [PATCH 49/56] Add widget=handle on sequence of res.partner.bank --- base_usability/__manifest__.py | 1 + base_usability/partner_bank_view.xml | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 base_usability/partner_bank_view.xml diff --git a/base_usability/__manifest__.py b/base_usability/__manifest__.py index df9bbc7..998e8ae 100644 --- a/base_usability/__manifest__.py +++ b/base_usability/__manifest__.py @@ -31,6 +31,7 @@ A group by 'State' is added to module search view. 'security/group.xml', 'security/ir.model.access.csv', 'partner_view.xml', + 'partner_bank_view.xml', 'users_view.xml', 'country_view.xml', 'module_view.xml', diff --git a/base_usability/partner_bank_view.xml b/base_usability/partner_bank_view.xml new file mode 100644 index 0000000..6d750cd --- /dev/null +++ b/base_usability/partner_bank_view.xml @@ -0,0 +1,24 @@ + + + + + + + + base_usability.res.partner.bank.tree + res.partner.bank + + + + 0 + handle + + + + + + From 851193eb5adea46d929e7c860ee91427f1ee0589 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 18 Sep 2018 21:32:16 +0200 Subject: [PATCH 50/56] Add active field on res.partner.bank --- base_usability/__init__.py | 1 + base_usability/partner_bank.py | 12 ++++++++++++ base_usability/partner_bank_view.xml | 26 ++++++++++++++++++++++++++ base_usability/report_sxw.py | 1 + 4 files changed, 40 insertions(+) create mode 100644 base_usability/partner_bank.py diff --git a/base_usability/__init__.py b/base_usability/__init__.py index d77ca0e..2c19a03 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -2,6 +2,7 @@ from . import users from . import partner +from . import partner_bank from . import company from . import mail from . import misc diff --git a/base_usability/partner_bank.py b/base_usability/partner_bank.py new file mode 100644 index 0000000..628c75a --- /dev/null +++ b/base_usability/partner_bank.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Akretion France +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResPartnerBank(models.Model): + _inherit = 'res.partner.bank' + + active = fields.Boolean(default=True) diff --git a/base_usability/partner_bank_view.xml b/base_usability/partner_bank_view.xml index 6d750cd..d2ee6dc 100644 --- a/base_usability/partner_bank_view.xml +++ b/base_usability/partner_bank_view.xml @@ -7,6 +7,22 @@ + + usability.res.partner.bank.form + res.partner.bank + + + +
+ +
+
+
+
base_usability.res.partner.bank.tree @@ -20,5 +36,15 @@
+ + base_usability.res.partner.bank.search + res.partner.bank + + + + + + + diff --git a/base_usability/report_sxw.py b/base_usability/report_sxw.py index e0749c6..db90e2f 100644 --- a/base_usability/report_sxw.py +++ b/base_usability/report_sxw.py @@ -34,4 +34,5 @@ def formatLang( grouping=grouping, monetary=monetary, dp=dp, currency_obj=currency_obj) return res + report_sxw.rml_parse.formatLang = formatLang From 04b91380a4aa74c2bc6f31f2687e47364addd461 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 18 Sep 2018 23:19:09 +0200 Subject: [PATCH 51/56] Revert my previous commit: use partner_bank_active instead The module partner_bank_active is avail in OCA/partner-contact --- base_usability/__init__.py | 1 - base_usability/partner_bank.py | 12 ------------ base_usability/partner_bank_view.xml | 28 ---------------------------- 3 files changed, 41 deletions(-) delete mode 100644 base_usability/partner_bank.py diff --git a/base_usability/__init__.py b/base_usability/__init__.py index 2c19a03..d77ca0e 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -2,7 +2,6 @@ from . import users from . import partner -from . import partner_bank from . import company from . import mail from . import misc diff --git a/base_usability/partner_bank.py b/base_usability/partner_bank.py deleted file mode 100644 index 628c75a..0000000 --- a/base_usability/partner_bank.py +++ /dev/null @@ -1,12 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2018 Akretion France -# @author: Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import fields, models - - -class ResPartnerBank(models.Model): - _inherit = 'res.partner.bank' - - active = fields.Boolean(default=True) diff --git a/base_usability/partner_bank_view.xml b/base_usability/partner_bank_view.xml index d2ee6dc..93e7366 100644 --- a/base_usability/partner_bank_view.xml +++ b/base_usability/partner_bank_view.xml @@ -7,23 +7,6 @@ - - usability.res.partner.bank.form - res.partner.bank - - - -
- -
-
-
-
- base_usability.res.partner.bank.tree res.partner.bank @@ -36,15 +19,4 @@ - - base_usability.res.partner.bank.search - res.partner.bank - - - - - - - -
From b78e1f50dc900633eaf2a47334237617e992672e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Tue, 25 Dec 2018 15:29:56 -0200 Subject: [PATCH 52/56] [MIG] base_usability: Migration to 12.0 --- base_usability/__init__.py | 2 -- base_usability/__manifest__.py | 9 ++++---- base_usability/company.py | 24 ++++++++------------- base_usability/mail.py | 8 +++---- base_usability/misc.py | 1 - base_usability/partner.py | 23 +++++++------------- base_usability/report_sxw.py | 19 +++++++--------- base_usability/security/ir.model.access.csv | 5 ----- base_usability/users.py | 1 - 9 files changed, 33 insertions(+), 59 deletions(-) delete mode 100644 base_usability/security/ir.model.access.csv diff --git a/base_usability/__init__.py b/base_usability/__init__.py index d77ca0e..d522841 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from . import users from . import partner from . import company diff --git a/base_usability/__manifest__.py b/base_usability/__manifest__.py index 998e8ae..fef0193 100644 --- a/base_usability/__manifest__.py +++ b/base_usability/__manifest__.py @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- # © 2014-2016 Akretion (http://www.akretion.com) # @author Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Base Usability', - 'version': '10.0.0.1.0', + 'version': '12.0.0.1.0', 'category': 'Partner', 'license': 'AGPL-3', 'summary': 'Better usability in base module', @@ -17,19 +16,19 @@ This module adds *track_visibility='onchange'* on all the important fields of th By default, Odoo doesn't display the title field on all the partner form views. This module fixes it (it replaces the module base_title_on_partner). -By default, users in the Partner Contact group also have create/write access on Countries and States. This module removes that: only the users in the *Administration > Configuration* group have create/write/delete access on those objects. - It also adds a log message at INFO level when sending an email via SMTP. It displays the local modules with installable filter. A group by 'State' is added to module search view. + +It provides a _display_report_header method on the res.company object and +_display_full_address on res.partner which are useful for reporting. """, 'author': 'Akretion', 'website': 'http://www.akretion.com', 'depends': ['base'], 'data': [ 'security/group.xml', - 'security/ir.model.access.csv', 'partner_view.xml', 'partner_bank_view.xml', 'users_view.xml', diff --git a/base_usability/company.py b/base_usability/company.py index dfe6e15..650520d 100644 --- a/base_usability/company.py +++ b/base_usability/company.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2015-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -19,14 +18,14 @@ class ResCompany(models.Model): value = field[0] label = field[1] uicon = False - elif isinstance(field, (str, unicode)) and field in options: + elif isinstance(field, str) and field in options: value = options[field]['value'] label = options[field].get('label') uicon = options[field].get('icon') if value: prefix = icon and uicon or label if prefix: - content.append(u'%s %s' % (prefix, value)) + content.append('%s %s' % (prefix, value)) else: content.append(value) line = separator.join(content) @@ -39,21 +38,16 @@ class ResCompany(models.Model): 'phone': { 'value': self.phone, # http://www.fileformat.info/info/unicode/char/1f4de/index.htm - 'icon': u'\U0001F4DE', + 'icon': '\U0001F4DE', 'label': _('Tel:')}, - 'fax': { - 'value': self.fax, - # http://www.fileformat.info/info/unicode/char/1f5b7/index.htm - 'icon': u'\U0001F5B7', - 'label': _('Fax:')}, 'email': { 'value': self.email, # http://www.fileformat.info/info/unicode/char/2709/index.htm - 'icon': u'\u2709', + 'icon': '\u2709', 'label': _('E-mail:')}, 'website': { 'value': self.website, - 'icon': u'\U0001f310', + 'icon': '\U0001f310', 'label': _('Website:')}, 'vat': { 'value': self.vat, @@ -69,14 +63,14 @@ class ResCompany(models.Model): # for reports @api.multi def _display_report_header( - self, line_details=[['phone', 'fax', 'website'], ['vat']], + self, line_details=[['phone', 'website'], ['vat']], icon=True, line_separator=' - '): self.ensure_one() - res = u'' + res = '' address = self.partner_id._display_address(without_company=True) - address = address.replace('\n', u' - ') + address = address.replace('\n', ' - ') - line1 = u'%s - %s' % (self._report_company_legal_name(), address) + line1 = '%s - %s' % (self._report_company_legal_name(), address) lines = [line1] options = self._prepare_header_options() for details in line_details: diff --git a/base_usability/mail.py b/base_usability/mail.py index ebcc299..35c7093 100644 --- a/base_usability/mail.py +++ b/base_usability/mail.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # © 2015-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, api -from odoo.addons.base.ir.ir_mail_server import extract_rfc2822_addresses +from odoo.addons.base.models.ir_mail_server import extract_rfc2822_addresses import logging logger = logging.getLogger(__name__) @@ -16,7 +15,7 @@ class IrMailServer(models.Model): def send_email( self, message, mail_server_id=None, smtp_server=None, smtp_port=None, smtp_user=None, smtp_password=None, - smtp_encryption=None, smtp_debug=False): + smtp_encryption=None, smtp_debug=False, smtp_session=None): # Start copy from native method smtp_from = message['Return-Path'] or\ self._get_default_bounce_address() or message['From'] @@ -32,4 +31,5 @@ class IrMailServer(models.Model): message, mail_server_id=mail_server_id, smtp_server=smtp_server, smtp_port=smtp_port, smtp_user=smtp_user, smtp_password=smtp_password, - smtp_encryption=smtp_encryption, smtp_debug=smtp_debug) + smtp_encryption=smtp_encryption, smtp_debug=smtp_debug, + smtp_session=smtp_session) diff --git a/base_usability/misc.py b/base_usability/misc.py index da6960e..11ef333 100644 --- a/base_usability/misc.py +++ b/base_usability/misc.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2015-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/base_usability/partner.py b/base_usability/partner.py index d600399..b4349bb 100644 --- a/base_usability/partner.py +++ b/base_usability/partner.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2015-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -47,7 +46,7 @@ class ResPartner(models.Model): if partner.lang: partner_lg = partner.with_context(lang=partner.lang) title = partner_lg.title.shortcut or partner_lg.title.name - name_title = u' '.join([title, name_title]) + name_title = ' '.join([title, name_title]) partner.name_title = name_title @api.multi @@ -63,7 +62,7 @@ class ResPartner(models.Model): @api.multi def _display_full_address( self, details=[ - 'company', 'name', 'address', 'phone', 'fax', + 'company', 'name', 'address', 'phone', 'mobile', 'email'], icon=True): self.ensure_one() @@ -87,31 +86,25 @@ class ResPartner(models.Model): 'phone': { 'value': self.phone, # http://www.fileformat.info/info/unicode/char/1f4de/index.htm - 'icon': u'\U0001F4DE', + 'icon': '\U0001F4DE', 'label': _('Tel:'), }, - 'fax': { - 'value': self.fax, - # http://www.fileformat.info/info/unicode/char/1f5b7/index.htm - 'icon': u'\U0001F5B7', - 'label': _('Fax:'), - }, 'mobile': { 'value': self.mobile, # http://www.fileformat.info/info/unicode/char/1f4f1/index.htm - 'icon': u'\U0001F4F1', + 'icon': '\U0001F4F1', 'label': _('Mobile:'), }, 'email': { 'value': self.email, # http://www.fileformat.info/info/unicode/char/2709/index.htm - 'icon': u'\u2709', + 'icon': '\u2709', 'label': _('E-mail:'), }, 'website': { 'value': self.website, # http://www.fileformat.info/info/unicode/char/1f310/index.htm - 'icon': u'\U0001f310', + 'icon': '\U0001f310', 'label': _('Website:'), }, 'address': { @@ -124,9 +117,9 @@ class ResPartner(models.Model): entry = options[detail] prefix = icon and entry.get('icon') or entry.get('label') if prefix: - res.append(u'%s %s' % (prefix, entry['value'])) + res.append('%s %s' % (prefix, entry['value'])) else: - res.append(u'%s' % entry['value']) + res.append('%s' % entry['value']) res = '\n'.join(res) return res diff --git a/base_usability/report_sxw.py b/base_usability/report_sxw.py index db90e2f..64e2bd1 100644 --- a/base_usability/report_sxw.py +++ b/base_usability/report_sxw.py @@ -1,22 +1,19 @@ -# -*- coding: utf-8 -*- # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, api -from odoo.report import report_sxw -from openerp.tools import float_compare +from odoo.tools import misc +from odoo.tools import float_compare class BaseUsabilityInstalled(models.AbstractModel): _name = "base.usability.installed" -formatLang_original = report_sxw.rml_parse.formatLang +formatLang_original = misc.formatLang - -def formatLang( - self, value, digits=None, date=False, date_time=False, grouping=True, - monetary=False, dp=False, currency_obj=False, int_no_digits=True): +def formatLang(self, value, digits=None, grouping=True, monetary=False, + dp=False, currency_obj=False, int_no_digits=True): with api.Environment.manage(): env = api.Environment(self.cr, self.uid, {}) if ( @@ -30,9 +27,9 @@ def formatLang( digits = 0 dp = False res = formatLang_original( - self, value, digits=digits, date=date, date_time=date_time, - grouping=grouping, monetary=monetary, dp=dp, currency_obj=currency_obj) + self, value, digits=digits, grouping=grouping, monetary=monetary, + dp=dp, currency_obj=currency_obj) return res -report_sxw.rml_parse.formatLang = formatLang +misc.formatLang = formatLang diff --git a/base_usability/security/ir.model.access.csv b/base_usability/security/ir.model.access.csv deleted file mode 100644 index 947087d..0000000 --- a/base_usability/security/ir.model.access.csv +++ /dev/null @@ -1,5 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -base.access_res_country_group_user,Full access on res.country to Settings group,base.model_res_country,base.group_system,1,1,1,1 -base.access_res_country_state_group_user,Full access on res.country.state to Settings group,base.model_res_country_state,base.group_system,1,1,1,1 -base.access_res_country_group_group_user,Full access on res.country.group to Settings group,base.model_res_country_group,base.group_system,1,1,1,1 -base.access_res_partner_title_group_user,Full access on res.partner.title,base.model_res_partner_title,base.group_system,1,1,1,1 diff --git a/base_usability/users.py b/base_usability/users.py index 2621d05..ffebe32 100644 --- a/base_usability/users.py +++ b/base_usability/users.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2018 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). From 11d113449add89393fd8fcf4a4575f21d00c1b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Tue, 25 Dec 2018 15:35:05 -0200 Subject: [PATCH 53/56] adopted OCA file layout --- base_usability/__init__.py | 7 +------ base_usability/__manifest__.py | 10 +++++----- base_usability/models/__init__.py | 6 ++++++ base_usability/{ => models}/company.py | 0 base_usability/{ => models}/mail.py | 0 base_usability/{ => models}/misc.py | 0 base_usability/{ => models}/partner.py | 0 base_usability/{ => models}/report_sxw.py | 0 base_usability/{ => models}/users.py | 0 base_usability/{ => views}/country_view.xml | 0 base_usability/{ => views}/module_view.xml | 0 base_usability/{ => views}/partner_bank_view.xml | 0 base_usability/{ => views}/partner_view.xml | 0 base_usability/{ => views}/users_view.xml | 0 14 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 base_usability/models/__init__.py rename base_usability/{ => models}/company.py (100%) rename base_usability/{ => models}/mail.py (100%) rename base_usability/{ => models}/misc.py (100%) rename base_usability/{ => models}/partner.py (100%) rename base_usability/{ => models}/report_sxw.py (100%) rename base_usability/{ => models}/users.py (100%) rename base_usability/{ => views}/country_view.xml (100%) rename base_usability/{ => views}/module_view.xml (100%) rename base_usability/{ => views}/partner_bank_view.xml (100%) rename base_usability/{ => views}/partner_view.xml (100%) rename base_usability/{ => views}/users_view.xml (100%) diff --git a/base_usability/__init__.py b/base_usability/__init__.py index d522841..0650744 100644 --- a/base_usability/__init__.py +++ b/base_usability/__init__.py @@ -1,6 +1 @@ -from . import users -from . import partner -from . import company -from . import mail -from . import misc -from . import report_sxw +from . import models diff --git a/base_usability/__manifest__.py b/base_usability/__manifest__.py index fef0193..06efa3e 100644 --- a/base_usability/__manifest__.py +++ b/base_usability/__manifest__.py @@ -29,11 +29,11 @@ _display_full_address on res.partner which are useful for reporting. 'depends': ['base'], 'data': [ 'security/group.xml', - 'partner_view.xml', - 'partner_bank_view.xml', - 'users_view.xml', - 'country_view.xml', - 'module_view.xml', + 'views/partner_view.xml', + 'views/partner_bank_view.xml', + 'views/users_view.xml', + 'views/country_view.xml', + 'views/module_view.xml', ], 'installable': True, } diff --git a/base_usability/models/__init__.py b/base_usability/models/__init__.py new file mode 100644 index 0000000..d522841 --- /dev/null +++ b/base_usability/models/__init__.py @@ -0,0 +1,6 @@ +from . import users +from . import partner +from . import company +from . import mail +from . import misc +from . import report_sxw diff --git a/base_usability/company.py b/base_usability/models/company.py similarity index 100% rename from base_usability/company.py rename to base_usability/models/company.py diff --git a/base_usability/mail.py b/base_usability/models/mail.py similarity index 100% rename from base_usability/mail.py rename to base_usability/models/mail.py diff --git a/base_usability/misc.py b/base_usability/models/misc.py similarity index 100% rename from base_usability/misc.py rename to base_usability/models/misc.py diff --git a/base_usability/partner.py b/base_usability/models/partner.py similarity index 100% rename from base_usability/partner.py rename to base_usability/models/partner.py diff --git a/base_usability/report_sxw.py b/base_usability/models/report_sxw.py similarity index 100% rename from base_usability/report_sxw.py rename to base_usability/models/report_sxw.py diff --git a/base_usability/users.py b/base_usability/models/users.py similarity index 100% rename from base_usability/users.py rename to base_usability/models/users.py diff --git a/base_usability/country_view.xml b/base_usability/views/country_view.xml similarity index 100% rename from base_usability/country_view.xml rename to base_usability/views/country_view.xml diff --git a/base_usability/module_view.xml b/base_usability/views/module_view.xml similarity index 100% rename from base_usability/module_view.xml rename to base_usability/views/module_view.xml diff --git a/base_usability/partner_bank_view.xml b/base_usability/views/partner_bank_view.xml similarity index 100% rename from base_usability/partner_bank_view.xml rename to base_usability/views/partner_bank_view.xml diff --git a/base_usability/partner_view.xml b/base_usability/views/partner_view.xml similarity index 100% rename from base_usability/partner_view.xml rename to base_usability/views/partner_view.xml diff --git a/base_usability/users_view.xml b/base_usability/views/users_view.xml similarity index 100% rename from base_usability/users_view.xml rename to base_usability/views/users_view.xml From 0ea0110fea8d612950be451e18874ba77d92a699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Tue, 25 Dec 2018 15:41:05 -0200 Subject: [PATCH 54/56] moved formatLang monkey patch in misc.py like in Odoo codebase --- base_usability/models/__init__.py | 1 - base_usability/models/misc.py | 33 ++++++++++++++++++++++++++- base_usability/models/report_sxw.py | 35 ----------------------------- 3 files changed, 32 insertions(+), 37 deletions(-) delete mode 100644 base_usability/models/report_sxw.py diff --git a/base_usability/models/__init__.py b/base_usability/models/__init__.py index d522841..c4d8b8b 100644 --- a/base_usability/models/__init__.py +++ b/base_usability/models/__init__.py @@ -3,4 +3,3 @@ from . import partner from . import company from . import mail from . import misc -from . import report_sxw diff --git a/base_usability/models/misc.py b/base_usability/models/misc.py index 11ef333..53c1968 100644 --- a/base_usability/models/misc.py +++ b/base_usability/models/misc.py @@ -1,7 +1,9 @@ # © 2015-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields +from odoo import models, fields, api +from odoo.tools import misc +from odoo.tools import float_compare class BaseLanguageExport(models.TransientModel): @@ -15,3 +17,32 @@ class BaseLanguageInstall(models.TransientModel): _inherit = 'base.language.install' overwrite = fields.Boolean(default=True) + + +class BaseUsabilityInstalled(models.AbstractModel): + _name = "base.usability.installed" + _description = "technical flag to see if base_usability module is installed" + + +formatLang_original = misc.formatLang + +def formatLang(self, value, digits=None, grouping=True, monetary=False, + dp=False, currency_obj=False, int_no_digits=True): + with api.Environment.manage(): + env = api.Environment(self.cr, self.uid, {}) + if ( + 'base.usability.installed' in env and + int_no_digits and + not monetary and + isinstance(value, float) and + dp): + prec = env['decimal.precision'].precision_get(dp) + if not float_compare(value, int(value), precision_digits=prec): + digits = 0 + dp = False + res = formatLang_original( + self, value, digits=digits, grouping=grouping, monetary=monetary, + dp=dp, currency_obj=currency_obj) + return res + +misc.formatLang = formatLang diff --git a/base_usability/models/report_sxw.py b/base_usability/models/report_sxw.py deleted file mode 100644 index 64e2bd1..0000000 --- a/base_usability/models/report_sxw.py +++ /dev/null @@ -1,35 +0,0 @@ -# © 2016 Akretion (Alexis de Lattre ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import models, api -from odoo.tools import misc -from odoo.tools import float_compare - - -class BaseUsabilityInstalled(models.AbstractModel): - _name = "base.usability.installed" - - -formatLang_original = misc.formatLang - -def formatLang(self, value, digits=None, grouping=True, monetary=False, - dp=False, currency_obj=False, int_no_digits=True): - with api.Environment.manage(): - env = api.Environment(self.cr, self.uid, {}) - if ( - 'base.usability.installed' in env and - int_no_digits and - not monetary and - isinstance(value, float) and - dp): - prec = env['decimal.precision'].precision_get(dp) - if not float_compare(value, int(value), precision_digits=prec): - digits = 0 - dp = False - res = formatLang_original( - self, value, digits=digits, grouping=grouping, monetary=monetary, - dp=dp, currency_obj=currency_obj) - return res - - -misc.formatLang = formatLang From 7ef94252a7cb6cf721e0b7896ce8e3e49abdc915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Wed, 26 Dec 2018 13:17:07 -0200 Subject: [PATCH 55/56] updated user create patch --- ...ase-multi-company-partners-not-shared.diff | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/base_usability/fix-odoo-base-multi-company-partners-not-shared.diff b/base_usability/fix-odoo-base-multi-company-partners-not-shared.diff index f8529eb..f19a3f8 100644 --- a/base_usability/fix-odoo-base-multi-company-partners-not-shared.diff +++ b/base_usability/fix-odoo-base-multi-company-partners-not-shared.diff @@ -1,18 +1,19 @@ -diff --git a/odoo/addons/base/res/res_users.py b/odoo/addons/base/res/res_users.py -index c621ca4..d3880fe 100644 ---- a/odoo/addons/base/res/res_users.py -+++ b/odoo/addons/base/res/res_users.py -@@ -334,7 +334,12 @@ class Users(models.Model): - user = super(Users, self).create(vals) - user.partner_id.active = user.active - if user.partner_id.company_id: -- user.partner_id.write({'company_id': user.company_id.id}) -+ # AKRETION HACK: if you have a multi-company setup where -+ # partners are NOT shared between companies, having -+ # company_id=False on partners related to users -+ # avoids a lot of trouble (you should also disable 'read' -+ # on the ir.rule 'user rule' (XMLID base.res_users_rule) -+ user.partner_id.write({'company_id': False}) - return user - +diff --git a/odoo/addons/base/models/res_users.py b/odoo/addons/base/models/res_users.py +index 083607f9..99ae8857 100644 +--- a/odoo/addons/base/models/res_users.py ++++ b/odoo/addons/base/models/res_users.py +@@ -426,7 +426,13 @@ class Users(models.Model): + for user in users: + user.partner_id.active = user.active + if user.partner_id.company_id: +- user.partner_id.write({'company_id': user.company_id.id}) ++ # AKRETION HACK: if you have a multi-company setup where ++ # partners are NOT shared between companies, having ++ # company_id=False on partners related to users ++ # avoids a lot of trouble (you should also disable 'read' ++ # on the ir.rule 'user rule' (XMLID base.res_users_rule) ++ # user.partner_id.write({'company_id': user.company_id.id}) ++ user.partner_id.write({'company_id': False}) + return users + @api.multi From 0119e40a762b8783130a10e1b51fb1e21c8b4b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Wed, 26 Dec 2018 13:18:04 -0200 Subject: [PATCH 56/56] @class -> hasclass to avoid warning, see https://stackoverflow.com/questions/47092148/warning-error-prone-use-of-class --- base_usability/views/partner_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_usability/views/partner_view.xml b/base_usability/views/partner_view.xml index 643b94c..6b1ab69 100644 --- a/base_usability/views/partner_view.xml +++ b/base_usability/views/partner_view.xml @@ -13,7 +13,7 @@ - + width: 650px;