Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
1244 Vizualizări

Hi, some help plz 
how can i choose payment methods appearance order in POS session, for ex: cash before bank, or inverse
i've already created some payment method, (cash, bank, user account...) i just want to display them in customized order in POS session (on payment) like:
1-bank
2-cash
3-user account
i've tried to select the payment method on POS settings in the exact order of display, but it doesn't work

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

Create a new field sequence then add that to the pos.payment.method then update the pos.session _loader_params_pos_payment_method function to order by the sequence field

class PosPaymentMethod(models.Model):
_inherit = 'pos.payment.method'

sequence = fields.Integer('Sequence')


class PosSession(models.Model):
_inherit = 'pos.session'

def _loader_params_pos_payment_method(self):
res = super()._loader_params_pos_payment_method()
res["search_params"]["order"] = 'sequence asc, id'
return res

Regards

Imagine profil
Abandonează