From cd26062a38291563280746d9454f3562784d3198 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 13 Sep 2017 18:41:54 +0200 Subject: [PATCH 1/5] [FIX] mass_mailing: add missing statistics index Indexing `mail_mail_id_int` is useful for locating the statistics entry that should be updated (bounced/opened/replied) --- addons/mass_mailing/models/mass_mailing_stats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mass_mailing/models/mass_mailing_stats.py b/addons/mass_mailing/models/mass_mailing_stats.py index e330975fe5f..cea7ee28a63 100644 --- a/addons/mass_mailing/models/mass_mailing_stats.py +++ b/addons/mass_mailing/models/mass_mailing_stats.py @@ -20,7 +20,8 @@ class MailMailStats(models.Model): string='Mail ID (tech)', help='ID of the related mail_mail. This field is an integer field because ' 'the related mail_mail can be deleted separately from its statistics. ' - 'However the ID is needed for several action and controllers.' + 'However the ID is needed for several action and controllers.', + index=True, ) message_id = fields.Char(string='Message-ID') model = fields.Char(string='Document model') From c5b9bdcf9f0bb41f0e65b0f96aeac89d544b3301 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 12 Sep 2017 15:41:11 +0200 Subject: [PATCH 2/5] [FIX] website_quote: images of acquirer should be dynamic Echoes commit c255342e8fa1902852b17f39bedccfb698471546 Before this commit, the image that was fetched for the quotes was the static one, preventing it to be changed Now, the image is dynamically fetched OPW 769701 closes #19417 --- addons/website_quote/views/website_quote_templates.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/website_quote/views/website_quote_templates.xml b/addons/website_quote/views/website_quote_templates.xml index 369ab2890ea..2aa63f2f730 100644 --- a/addons/website_quote/views/website_quote_templates.xml +++ b/addons/website_quote/views/website_quote_templates.xml @@ -340,9 +340,7 @@
  • From ecc75092776ca11089772a970fba9638071322d9 Mon Sep 17 00:00:00 2001 From: Lucas Perais Date: Thu, 14 Sep 2017 09:56:07 +0200 Subject: [PATCH 3/5] [FIX] account, invoice analysis: negative amounts for in_invoice-like Before this commit, the invoice analysis report summed the amount of invoices regardless of whether they were in or out, as if it were an absolute sum. This commit corrects the behavior back to v9's, where in_invoice have the minus sign and are hence subtracted opw 769409. Was PR #19413 --- addons/account/report/account_invoice_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index e76f25027ff..df6c4c5c2f8 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -114,7 +114,7 @@ class AccountInvoiceReport(models.Model): ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id AS account_line_id, ai.partner_bank_id, SUM ((invoice_type.sign * ail.quantity) / u.factor * u2.factor) AS product_qty, - SUM(ail.price_subtotal_signed) AS price_total, + SUM(ail.price_subtotal_signed * invoice_type.sign) AS price_total, SUM(ABS(ail.price_subtotal_signed)) / CASE WHEN SUM(ail.quantity / u.factor * u2.factor) <> 0::numeric THEN SUM(ail.quantity / u.factor * u2.factor) From ce2d00f3467e616de2e75a445bb6f2cb76d30495 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 13 Sep 2017 15:22:42 +0200 Subject: [PATCH 4/5] [FIX] account: Register a payment with no sequence for account.payment When registring a supplier invoice, if no sequence exists for code "account.payment.supplier.invoice" then it failed for the creation of the counterpart lines because a name is required to create an account move line. ps: check function "_get_liquidity_move_line_vals" for the condition. opw:767224 --- addons/account/i18n/account.pot | 6 ++++++ addons/account/models/account_payment.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 0b7b1461634..81687316647 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -9674,6 +9674,12 @@ msgstr "" msgid "You have" msgstr "" +#. module: account +#: code:addons/account/models/account_payment.py:360 +#, python-format +msgid "You have to define a sequence for %s in your company." +msgstr "" + #. module: account #: code:addons/account/wizard/account_report_general_ledger.py:21 #, python-format diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 4a49bb3b5f9..fcc2dbd0319 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -356,6 +356,8 @@ class account_payment(models.Model): if rec.payment_type == 'outbound': sequence_code = 'account.payment.supplier.invoice' rec.name = self.env['ir.sequence'].with_context(ir_sequence_date=rec.payment_date).next_by_code(sequence_code) + if not rec.name and self.payment_type != 'transfer': + raise UserError(_("You have to define a sequence for %s in your company.") % (sequence_code,)) # Create the journal entry amount = rec.amount * (rec.payment_type in ('outbound', 'transfer') and 1 or -1) From bf8f7010329971d1d9c71f8e6d7fbaf55b069061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pigeon?= Date: Thu, 14 Sep 2017 15:14:37 +0200 Subject: [PATCH 5/5] [FIX] purchase: multiple backorders Avoid crash if multiple backorders are found. Closes #19452 opw-771732 --- addons/purchase/models/stock.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/purchase/models/stock.py b/addons/purchase/models/stock.py index e3e66104591..4f10e405165 100644 --- a/addons/purchase/models/stock.py +++ b/addons/purchase/models/stock.py @@ -25,10 +25,10 @@ class StockPicking(models.Model): res = super(StockPicking, self)._create_backorder(backorder_moves) for picking in self: if picking.picking_type_id.code == 'incoming': - backorder = self.search([('backorder_id', '=', picking.id)]) - backorder.message_post_with_view('mail.message_origin_link', - values={'self': backorder, 'origin': backorder.purchase_id}, - subtype_id=self.env.ref('mail.mt_note').id) + for backorder in self.search([('backorder_id', '=', picking.id)]): + backorder.message_post_with_view('mail.message_origin_link', + values={'self': backorder, 'origin': backorder.purchase_id}, + subtype_id=self.env.ref('mail.mt_note').id) return res