diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 8d610f5584f..b08a17092a9 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -371,7 +371,7 @@ class account_payment(models.Model): if self.payment_difference_handling == 'reconcile' and self.payment_difference: writeoff_line = self._get_shared_move_line_vals(0, 0, 0, move.id, False) debit_wo, credit_wo, amount_currency_wo, currency_id = aml_obj.with_context(date=self.payment_date).compute_amount_fields(self.payment_difference, self.currency_id, self.company_id.currency_id, invoice_currency) - writeoff_line['name'] = _('Write-Off') + writeoff_line['name'] = _('Counterpart') writeoff_line['account_id'] = self.writeoff_account_id.id writeoff_line['debit'] = debit_wo writeoff_line['credit'] = credit_wo diff --git a/addons/account_extra_reports/report/account_partner_ledger.py b/addons/account_extra_reports/report/account_partner_ledger.py index a5ca5ed2a3c..12ddab4e451 100644 --- a/addons/account_extra_reports/report/account_partner_ledger.py +++ b/addons/account_extra_reports/report/account_partner_ledger.py @@ -28,9 +28,9 @@ class ReportPartnerLedger(models.AbstractModel): sum = 0.0 for r in res: r['displayed_name'] = '-'.join( - r['move_name'] not in ['', '/'] and [r['move_name']] or [] + - r['ref'] not in ['', '/'] and [r['ref']] or [] + - r['name'] not in ['', '/'] and [r['name']] or [] + (r['move_name'] not in ['', '/'] and [r['move_name']] or []) + + (r['ref'] not in ['', '/'] and [r['ref']] or []) + + (r['name'] not in ['', '/'] and [r['name']] or []) ) sum += r['debit'] - r['credit'] r['progress'] = sum diff --git a/addons/im_livechat/models/im_livechat_channel.py b/addons/im_livechat/models/im_livechat_channel.py index 731118d31c4..b657f770c6e 100644 --- a/addons/im_livechat/models/im_livechat_channel.py +++ b/addons/im_livechat/models/im_livechat_channel.py @@ -176,7 +176,7 @@ class ImLivechatChannel(models.Model): 'anonymous_name': anonymous_name, 'channel_type': 'livechat', 'name': ', '.join([anonymous_name, user.name]), - 'public': 'public', + 'public': 'private', 'email_send': False, }) return mail_channel.sudo().with_context(im_livechat_operator_partner_id=operator_partner_id).channel_info()[0] diff --git a/addons/im_livechat/models/mail_channel.py b/addons/im_livechat/models/mail_channel.py index eded0ff17da..8fb014f0b8f 100644 --- a/addons/im_livechat/models/mail_channel.py +++ b/addons/im_livechat/models/mail_channel.py @@ -24,6 +24,11 @@ class MailChannel(models.Model): should be added to the notification, since the user cannot be listining to the channel. """ notifications = super(MailChannel, self)._channel_message_notifications(message) + message_values_dict = notifications[0][1] if len(notifications) else dict(message.message_format()[0]) + for channel in self: + # add uuid for private livechat channels to allow anonymous to listen + if channel.channel_type == 'livechat': + notifications.append([channel.uuid, message_values_dict]) if not message.author_id: unpinned_channel_partner = self.mapped('channel_last_seen_partner_ids').filtered(lambda cp: not cp.is_pinned) if unpinned_channel_partner: @@ -53,7 +58,7 @@ class MailChannel(models.Model): def channel_fetch_slot(self): values = super(MailChannel, self).channel_fetch_slot() pinned_channels = self.env['mail.channel.partner'].search([('partner_id', '=', self.env.user.partner_id.id), ('is_pinned', '=', True)]).mapped('channel_id') - values['channel_livechat'] = self.search([('channel_type', '=', 'livechat'), ('public', 'in', ['public']), ('id', 'in', pinned_channels.ids)]).channel_info() + values['channel_livechat'] = self.search([('channel_type', '=', 'livechat'), ('id', 'in', pinned_channels.ids)]).channel_info() return values @api.model diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index 8a80968c5b7..cb9794b07bc 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -336,10 +336,8 @@ function make_channel (data, options) { messages: [], }}, }; - if (channel.type === "channel" && data.public !== "private") { - channel.type = "public"; - } else if (data.public === "private") { - channel.type = "private"; + if (channel.type === "channel") { + channel.type = data.public !== "private" ? "public" : "private"; } if (_.size(data.direct_partner) > 0) { channel.type = "dm"; diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c7fbd39d880..ea46e64b6be 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -240,7 +240,6 @@ class SaleOrder(models.Model): 'name': self.client_order_ref or '', 'origin': self.name, 'type': 'out_invoice', - 'reference': self.client_order_ref or self.name, 'account_id': self.partner_invoice_id.property_account_receivable_id.id, 'partner_id': self.partner_invoice_id.id, 'journal_id': journal_id, @@ -307,8 +306,13 @@ class SaleOrder(models.Model): inv_data = order._prepare_invoice() invoice = inv_obj.create(inv_data) invoices[group_key] = invoice - elif group_key in invoices and order.name not in invoices[group_key].origin.split(', '): - invoices[group_key].write({'origin': invoices[group_key].origin + ', ' + order.name}) + elif group_key in invoices: + vals = {} + if order.name not in invoices[group_key].origin.split(', '): + vals['origin'] = invoices[group_key].origin + ', ' + order.name + if order.client_order_ref and order.client_order_ref not in invoices[group_key].name.split(', '): + vals['name'] = invoices[group_key].name + ', ' + order.client_order_ref + invoices[group_key].write(vals) if line.qty_to_invoice > 0: line.invoice_line_create(invoices[group_key].id, line.qty_to_invoice) elif line.qty_to_invoice < 0 and final: