From 0a68a44460e4e465f45d4be2b72d863061b86935 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 2 Mar 2023 23:24:11 +0100 Subject: [PATCH] account_payment_mode: add sequence on payment mode Currently, payment modes are ordered by name. With the introduction of a sequence field on account.payment.mode, the user can now decide the order. --- account_payment_mode/models/account_payment_mode.py | 3 ++- account_payment_mode/views/account_payment_mode.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/account_payment_mode/models/account_payment_mode.py b/account_payment_mode/models/account_payment_mode.py index a8db617b9..5fed3d834 100644 --- a/account_payment_mode/models/account_payment_mode.py +++ b/account_payment_mode/models/account_payment_mode.py @@ -13,7 +13,7 @@ class AccountPaymentMode(models.Model): _name = "account.payment.mode" _description = "Payment Modes" - _order = "name" + _order = "sequence, name" _check_company_auto = True name = fields.Char(required=True, translate=True) @@ -68,6 +68,7 @@ class AccountPaymentMode(models.Model): ) active = fields.Boolean(default=True) note = fields.Text(translate=True) + sequence = fields.Integer(default=10) @api.onchange("company_id") def _onchange_company_id(self): diff --git a/account_payment_mode/views/account_payment_mode.xml b/account_payment_mode/views/account_payment_mode.xml index ac2838e1d..734c70838 100644 --- a/account_payment_mode/views/account_payment_mode.xml +++ b/account_payment_mode/views/account_payment_mode.xml @@ -46,6 +46,7 @@ account.payment.mode +