Browse Source

[REF] rename field

pull/440/head
Sylvain LE GAL 5 years ago
parent
commit
b72f5221a8
  1. 8
      pos_payment_terminal/i18n/es.po
  2. 8
      pos_payment_terminal/i18n/fr.po
  3. 8
      pos_payment_terminal/i18n/hr_HR.po
  4. 8
      pos_payment_terminal/i18n/it.po
  5. 8
      pos_payment_terminal/i18n/nl_NL.po
  6. 4
      pos_payment_terminal/i18n/pos_payment_terminal.pot
  7. 5
      pos_payment_terminal/models/account_journal.py
  8. 2
      pos_payment_terminal/models/pos_order.py
  9. 2
      pos_payment_terminal/static/src/js/devices.js
  10. 2
      pos_payment_terminal/static/src/js/models.js
  11. 2
      pos_payment_terminal/views/account_journal.xml

8
pos_payment_terminal/i18n/es.po

@ -20,12 +20,12 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Card" msgid "Card"
msgstr "Tarjeta" msgstr "Tarjeta"
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Check" msgid "Check"
msgstr "Talón" msgstr "Talón"
@ -35,7 +35,7 @@ msgid "Journal"
msgstr "Diario" msgstr "Diario"
#. module: pos_payment_terminal #. 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" msgid "Payment Mode"
msgstr "Forma de pago" msgstr "Forma de pago"
@ -45,7 +45,7 @@ msgid "Point of Sale Orders"
msgstr "" msgstr ""
#. module: pos_payment_terminal #. 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" msgid "Select the payment mode sent to the payment terminal"
msgstr "Seleccione la forma de pega enviada al terminal de pago" msgstr "Seleccione la forma de pega enviada al terminal de pago"

8
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" msgstr "Un terminal de paiment est disponible sur le proxy"
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Card" msgid "Card"
msgstr "Carte" msgstr "Carte"
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Check" msgid "Check"
msgstr "Chèque" msgstr "Chèque"
@ -36,7 +36,7 @@ msgid "Journal"
msgstr "Journal" msgstr "Journal"
#. module: pos_payment_terminal #. 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" msgid "Payment Mode"
msgstr "Moyen de paiement" msgstr "Moyen de paiement"
@ -57,7 +57,7 @@ msgid "Point of Sale Orders"
msgstr "Commandes du point de vente" msgstr "Commandes du point de vente"
#. module: pos_payment_terminal #. 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" msgid "Select the payment mode sent to the payment terminal"
msgstr "Sélectionner le mode de paiement envoyé au terminal de paiement" msgstr "Sélectionner le mode de paiement envoyé au terminal de paiement"

8
pos_payment_terminal/i18n/hr_HR.po

@ -21,12 +21,12 @@ msgstr ""
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Card" msgid "Card"
msgstr "Kartica" msgstr "Kartica"
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Check" msgid "Check"
msgstr "Ček" msgstr "Ček"
@ -36,7 +36,7 @@ msgid "Journal"
msgstr "Dnevnik" msgstr "Dnevnik"
#. module: pos_payment_terminal #. 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" msgid "Payment Mode"
msgstr "Način plaćanja" msgstr "Način plaćanja"
@ -46,7 +46,7 @@ msgid "Point of Sale Orders"
msgstr "" msgstr ""
#. module: pos_payment_terminal #. 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" msgid "Select the payment mode sent to the payment terminal"
msgstr "Odaberite način plaćanja korišten na naplatnom terminalu" msgstr "Odaberite način plaćanja korišten na naplatnom terminalu"

8
pos_payment_terminal/i18n/it.po

@ -19,12 +19,12 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Card" msgid "Card"
msgstr "" msgstr ""
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Check" msgid "Check"
msgstr "" msgstr ""
@ -34,7 +34,7 @@ msgid "Journal"
msgstr "" msgstr ""
#. module: pos_payment_terminal #. 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" msgid "Payment Mode"
msgstr "" msgstr ""
@ -44,7 +44,7 @@ msgid "Point of Sale Orders"
msgstr "" msgstr ""
#. module: pos_payment_terminal #. 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" msgid "Select the payment mode sent to the payment terminal"
msgstr "" msgstr ""

8
pos_payment_terminal/i18n/nl_NL.po

@ -20,12 +20,12 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Card" msgid "Card"
msgstr "" msgstr ""
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Check" msgid "Check"
msgstr "" msgstr ""
@ -35,7 +35,7 @@ msgid "Journal"
msgstr "" msgstr ""
#. module: pos_payment_terminal #. 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" msgid "Payment Mode"
msgstr "" msgstr ""
@ -45,7 +45,7 @@ msgid "Point of Sale Orders"
msgstr "" msgstr ""
#. module: pos_payment_terminal #. 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" msgid "Select the payment mode sent to the payment terminal"
msgstr "" msgstr ""

4
pos_payment_terminal/i18n/pos_payment_terminal.pot

@ -21,12 +21,12 @@ msgid "A payment terminal is available on the Proxy"
msgstr "" msgstr ""
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Card" msgid "Card"
msgstr "" msgstr ""
#. module: pos_payment_terminal #. module: pos_payment_terminal
#: selection:account.journal,payment_mode:0
#: selection:account.journal,pos_terminal_payment_mode:0
msgid "Check" msgid "Check"
msgstr "" msgstr ""

5
pos_payment_terminal/models/account_journal.py

@ -8,6 +8,7 @@ from odoo import models, fields
class AccountJournal(models.Model): class AccountJournal(models.Model):
_inherit = 'account.journal' _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") help="Select the payment mode sent to the payment terminal")

2
pos_payment_terminal/models/pos_order.py

@ -21,7 +21,7 @@ class PosOrder(models.Model):
currency_digits = pos_session.currency_id.decimal_places currency_digits = pos_session.currency_id.decimal_places
card_journals = self.env['account.journal'].search([ card_journals = self.env['account.journal'].search([
('id', 'in', [p[2]['journal_id'] for p in payments]), ('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 card_payments = [record[2] for record in payments
if record[2]['journal_id'] in card_journals.ids] if record[2]['journal_id'] in card_journals.ids]

2
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(), var data = {'amount' : line.get_amount(),
'currency_iso' : currency_iso, 'currency_iso' : currency_iso,
'currency_decimals' : currency_decimals, 'currency_decimals' : currency_decimals,
'payment_mode' : line.cashregister.journal.payment_mode,
'payment_mode' : line.cashregister.journal.pos_terminal_payment_mode,
'order_id': order.uid}; 'order_id': order.uid};
this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)});
}, },

2
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 models = require('point_of_sale.models');
var _orderproto = models.Order.prototype; 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({ models.Order = models.Order.extend({
initialize: function(){ initialize: function(){

2
pos_payment_terminal/views/account_journal.xml

@ -7,7 +7,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<group name="amount_authorized" position="after"> <group name="amount_authorized" position="after">
<group name="payment_mode_group" attrs="{'invisible': [('type', '!=', 'bank')]}"> <group name="payment_mode_group" attrs="{'invisible': [('type', '!=', 'bank')]}">
<field name="payment_mode"/>
<field name="pos_terminal_payment_mode"/>
</group> </group>
</group> </group>
</field> </field>

Loading…
Cancel
Save