diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 20be7f6e68f..ab6a3b0189c 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -9730,6 +9730,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 13705d23ca2..13a3d886d99 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -360,6 +360,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) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 5d99febd727..0e26a143195 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -109,7 +109,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) diff --git a/addons/l10n_mx/models/chart_template.py b/addons/l10n_mx/models/chart_template.py index 4e1397073ba..d6607a7a359 100644 --- a/addons/l10n_mx/models/chart_template.py +++ b/addons/l10n_mx/models/chart_template.py @@ -16,6 +16,7 @@ class AccountChartTemplate(models.Model): if not self == self.env.ref('l10n_mx.mx_coa'): return res journal_basis = self.env['account.journal'].search([ + ('company_id', '=', company.id), ('type', '=', 'general'), ('code', '=', 'CBMX')], limit=1) company.write({'tax_cash_basis_journal_id': journal_basis.id}) 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') 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 diff --git a/addons/website_quote/views/website_quote_templates.xml b/addons/website_quote/views/website_quote_templates.xml index e5e8df5c62c..dcbe6ffe1ce 100644 --- a/addons/website_quote/views/website_quote_templates.xml +++ b/addons/website_quote/views/website_quote_templates.xml @@ -349,10 +349,8 @@ diff --git a/addons/website_sale/static/src/js/website_sale_payment.js b/addons/website_sale/static/src/js/website_sale_payment.js index c4c4861654d..526145bba8d 100644 --- a/addons/website_sale/static/src/js/website_sale_payment.js +++ b/addons/website_sale/static/src/js/website_sale_payment.js @@ -6,9 +6,10 @@ var ajax = require('web.ajax'); $(document).ready(function () { // If option is enable if ($("#checkbox_cgv").length) { - $("#checkbox_cgv").click(function() { + var enabling_button = function() { $("div.oe_sale_acquirer_button").find('input, button').prop("disabled", !this.checked); - }); + }; + $("#checkbox_cgv").click(enabling_button).each(enabling_button); } // When choosing an acquirer, display its Pay Now button