From f4ec8b95b781d3a7a8f4a8b6163eb9cc83cc66bc Mon Sep 17 00:00:00 2001 From: len-odoo Date: Thu, 9 Aug 2018 11:00:20 +0200 Subject: [PATCH 1/4] [FIX] mail: only get one mail channel partner per user When more than one mail.channel.partner have been linked to a given user, he may be unable to open some discussion channel because of a traceback. The issue is that we access a channel_partner field while the recordset is not a singleton. We limit the search to 1 to ensure that this recordset is a singleton. --- addons/mail/models/mail_channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py index 8f701194494..1b69bfcfd33 100644 --- a/addons/mail/models/mail_channel.py +++ b/addons/mail/models/mail_channel.py @@ -471,7 +471,7 @@ class Channel(models.Model): 'is_minimized': minimized } domain = [('partner_id', '=', self.env.user.partner_id.id), ('channel_id.uuid', '=', uuid)] - channel_partners = self.env['mail.channel.partner'].search(domain) + channel_partners = self.env['mail.channel.partner'].search(domain, limit=1) channel_partners.write(values) self.env['bus.bus'].sendone((self._cr.dbname, 'res.partner', self.env.user.partner_id.id), channel_partners.channel_id.channel_info()[0]) From 1f42cf9f9c504736907d230da661db237d86f10b Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 9 Aug 2018 11:01:00 +0200 Subject: [PATCH 2/4] [FIX] sale, sale_timesheet: re-introduce default invoice policy Related to f89d4201c779d68d584533e62b209ccf6bd16f84 Since the invoice policy is becoming more and more simple, it is always nice to add as much logic as possible to make things even more simple. For the record, 5 fields are taken into account when it comes to invoicing policy: service_policy service_type service_tracking invoice_policy expense_policy They are partially linked one with the other, and not all make sense for a given product type... --- addons/sale/views/res_config_settings_views.xml | 2 +- addons/sale_timesheet/models/product.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/sale/views/res_config_settings_views.xml b/addons/sale/views/res_config_settings_views.xml index 534f50e0360..feac0835056 100644 --- a/addons/sale/views/res_config_settings_views.xml +++ b/addons/sale/views/res_config_settings_views.xml @@ -347,7 +347,7 @@

Invoicing

-