From b72f5221a891e759b45020b02c979173b8d55caf Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 24 Jan 2020 13:02:52 +0100 Subject: [PATCH] [REF] rename field --- pos_payment_terminal/i18n/es.po | 8 ++++---- pos_payment_terminal/i18n/fr.po | 8 ++++---- pos_payment_terminal/i18n/hr_HR.po | 8 ++++---- pos_payment_terminal/i18n/it.po | 8 ++++---- pos_payment_terminal/i18n/nl_NL.po | 8 ++++---- pos_payment_terminal/i18n/pos_payment_terminal.pot | 4 ++-- pos_payment_terminal/models/account_journal.py | 5 +++-- pos_payment_terminal/models/pos_order.py | 2 +- pos_payment_terminal/static/src/js/devices.js | 2 +- pos_payment_terminal/static/src/js/models.js | 2 +- pos_payment_terminal/views/account_journal.xml | 2 +- 11 files changed, 29 insertions(+), 28 deletions(-) diff --git a/pos_payment_terminal/i18n/es.po b/pos_payment_terminal/i18n/es.po index ff43732c..4b2863e5 100644 --- a/pos_payment_terminal/i18n/es.po +++ b/pos_payment_terminal/i18n/es.po @@ -20,12 +20,12 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Card" msgstr "Tarjeta" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Check" msgstr "Talón" @@ -35,7 +35,7 @@ msgid "Journal" msgstr "Diario" #. module: pos_payment_terminal -#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal__pos_terminal_payment_mode msgid "Payment Mode" msgstr "Forma de pago" @@ -45,7 +45,7 @@ msgid "Point of Sale Orders" msgstr "" #. module: pos_payment_terminal -#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal__pos_terminal_payment_mode msgid "Select the payment mode sent to the payment terminal" msgstr "Seleccione la forma de pega enviada al terminal de pago" diff --git a/pos_payment_terminal/i18n/fr.po b/pos_payment_terminal/i18n/fr.po index 3f7250bc..a0fe0ed3 100644 --- a/pos_payment_terminal/i18n/fr.po +++ b/pos_payment_terminal/i18n/fr.po @@ -21,12 +21,12 @@ msgid "A payment terminal is available on the Proxy" msgstr "Un terminal de paiment est disponible sur le proxy" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Card" msgstr "Carte" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Check" msgstr "Chèque" @@ -36,7 +36,7 @@ msgid "Journal" msgstr "Journal" #. module: pos_payment_terminal -#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal__payment_mode +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal__pos_terminal_payment_mode msgid "Payment Mode" msgstr "Moyen de paiement" @@ -57,7 +57,7 @@ msgid "Point of Sale Orders" msgstr "Commandes du point de vente" #. module: pos_payment_terminal -#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal__payment_mode +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal__pos_terminal_payment_mode msgid "Select the payment mode sent to the payment terminal" msgstr "Sélectionner le mode de paiement envoyé au terminal de paiement" diff --git a/pos_payment_terminal/i18n/hr_HR.po b/pos_payment_terminal/i18n/hr_HR.po index 1f3a060c..baa7833d 100644 --- a/pos_payment_terminal/i18n/hr_HR.po +++ b/pos_payment_terminal/i18n/hr_HR.po @@ -21,12 +21,12 @@ msgstr "" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Card" msgstr "Kartica" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Check" msgstr "Ček" @@ -36,7 +36,7 @@ msgid "Journal" msgstr "Dnevnik" #. module: pos_payment_terminal -#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal__pos_terminal_payment_mode msgid "Payment Mode" msgstr "Način plaćanja" @@ -46,7 +46,7 @@ msgid "Point of Sale Orders" msgstr "" #. module: pos_payment_terminal -#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal__pos_terminal_payment_mode msgid "Select the payment mode sent to the payment terminal" msgstr "Odaberite način plaćanja korišten na naplatnom terminalu" diff --git a/pos_payment_terminal/i18n/it.po b/pos_payment_terminal/i18n/it.po index 4ade8568..e248b19a 100644 --- a/pos_payment_terminal/i18n/it.po +++ b/pos_payment_terminal/i18n/it.po @@ -19,12 +19,12 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Card" msgstr "" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Check" msgstr "" @@ -34,7 +34,7 @@ msgid "Journal" msgstr "" #. module: pos_payment_terminal -#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal__pos_terminal_payment_mode msgid "Payment Mode" msgstr "" @@ -44,7 +44,7 @@ msgid "Point of Sale Orders" msgstr "" #. module: pos_payment_terminal -#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal__pos_terminal_payment_mode msgid "Select the payment mode sent to the payment terminal" msgstr "" diff --git a/pos_payment_terminal/i18n/nl_NL.po b/pos_payment_terminal/i18n/nl_NL.po index 0fd6be84..7e2f780b 100644 --- a/pos_payment_terminal/i18n/nl_NL.po +++ b/pos_payment_terminal/i18n/nl_NL.po @@ -20,12 +20,12 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Card" msgstr "" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Check" msgstr "" @@ -35,7 +35,7 @@ msgid "Journal" msgstr "" #. module: pos_payment_terminal -#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal__pos_terminal_payment_mode msgid "Payment Mode" msgstr "" @@ -45,7 +45,7 @@ msgid "Point of Sale Orders" msgstr "" #. module: pos_payment_terminal -#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal__pos_terminal_payment_mode msgid "Select the payment mode sent to the payment terminal" msgstr "" diff --git a/pos_payment_terminal/i18n/pos_payment_terminal.pot b/pos_payment_terminal/i18n/pos_payment_terminal.pot index baf366ee..4b8ddfa0 100644 --- a/pos_payment_terminal/i18n/pos_payment_terminal.pot +++ b/pos_payment_terminal/i18n/pos_payment_terminal.pot @@ -21,12 +21,12 @@ msgid "A payment terminal is available on the Proxy" msgstr "" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Card" msgstr "" #. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 +#: selection:account.journal,pos_terminal_payment_mode:0 msgid "Check" msgstr "" diff --git a/pos_payment_terminal/models/account_journal.py b/pos_payment_terminal/models/account_journal.py index 84080a1a..a4f688c9 100644 --- a/pos_payment_terminal/models/account_journal.py +++ b/pos_payment_terminal/models/account_journal.py @@ -8,6 +8,7 @@ from odoo import models, fields class AccountJournal(models.Model): _inherit = 'account.journal' - payment_mode = fields.Selection( - [('card', 'Card'), ('check', 'Check')], 'Payment Mode', + pos_terminal_payment_mode = fields.Selection( + selection=[('card', 'Card'), ('check', 'Check')], + string='Terminal Payment Mode', help="Select the payment mode sent to the payment terminal") diff --git a/pos_payment_terminal/models/pos_order.py b/pos_payment_terminal/models/pos_order.py index 1d6dcebe..5050c067 100644 --- a/pos_payment_terminal/models/pos_order.py +++ b/pos_payment_terminal/models/pos_order.py @@ -21,7 +21,7 @@ class PosOrder(models.Model): currency_digits = pos_session.currency_id.decimal_places card_journals = self.env['account.journal'].search([ ('id', 'in', [p[2]['journal_id'] for p in payments]), - ('payment_mode', '!=', False), + ('pos_terminal_payment_mode', '!=', False), ]) card_payments = [record[2] for record in payments if record[2]['journal_id'] in card_journals.ids] diff --git a/pos_payment_terminal/static/src/js/devices.js b/pos_payment_terminal/static/src/js/devices.js index 1bbb9fa8..b1839412 100644 --- a/pos_payment_terminal/static/src/js/devices.js +++ b/pos_payment_terminal/static/src/js/devices.js @@ -60,7 +60,7 @@ odoo.define('pos_payment_terminal.devices', function (require) { var data = {'amount' : line.get_amount(), 'currency_iso' : currency_iso, 'currency_decimals' : currency_decimals, - 'payment_mode' : line.cashregister.journal.payment_mode, + 'payment_mode' : line.cashregister.journal.pos_terminal_payment_mode, 'order_id': order.uid}; this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); }, diff --git a/pos_payment_terminal/static/src/js/models.js b/pos_payment_terminal/static/src/js/models.js index cfb4035c..83218044 100644 --- a/pos_payment_terminal/static/src/js/models.js +++ b/pos_payment_terminal/static/src/js/models.js @@ -13,7 +13,7 @@ odoo.define('pos_payment_terminal.models', function (require) { var models = require('point_of_sale.models'); var _orderproto = models.Order.prototype; - models.load_fields('account.journal', ['payment_mode']); + models.load_fields('account.journal', ['pos_terminal_payment_mode']); models.Order = models.Order.extend({ initialize: function(){ diff --git a/pos_payment_terminal/views/account_journal.xml b/pos_payment_terminal/views/account_journal.xml index 6c38cb33..eeb60eca 100644 --- a/pos_payment_terminal/views/account_journal.xml +++ b/pos_payment_terminal/views/account_journal.xml @@ -7,7 +7,7 @@ - +