Sylvain LE GAL
5 years ago
18 changed files with 174 additions and 113 deletions
-
7pos_payment_terminal/__manifest__.py
-
8pos_payment_terminal/demo/pos_config.xml
-
8pos_payment_terminal/demo/pos_payment_terminal_demo.xml
-
43pos_payment_terminal/i18n/fr.po
-
30pos_payment_terminal/i18n/pos_payment_terminal.pot
-
1pos_payment_terminal/models/account_journal.py
-
3pos_payment_terminal/models/pos_order.py
-
13pos_payment_terminal/readme/CONFIGURE.rst
-
1pos_payment_terminal/readme/CONTRIBUTORS.rst
-
BINpos_payment_terminal/static/description/account_journal_form.png
-
BINpos_payment_terminal/static/description/pos_config.png
-
49pos_payment_terminal/static/src/js/devices.js
-
30pos_payment_terminal/static/src/js/models.js
-
42pos_payment_terminal/static/src/js/screens.js
-
9pos_payment_terminal/views/account_journal.xml
-
13pos_payment_terminal/views/assets.xml
-
11pos_payment_terminal/views/pos_config.xml
-
11pos_payment_terminal/views/pos_payment_terminal_template.xml
@ -0,0 +1,8 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<record id="point_of_sale.pos_config_main" model="pos.config"> |
||||
|
<field name="iface_payment_terminal" eval="True"/> |
||||
|
</record> |
||||
|
|
||||
|
</odoo> |
@ -1,8 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<odoo noupdate="1"> |
|
||||
|
|
||||
<record id="point_of_sale.pos_config_main" model="pos.config"> |
|
||||
<field name="iface_payment_terminal" eval="True"/> |
|
||||
</record> |
|
||||
|
|
||||
</odoo> |
|
@ -1,4 +1,11 @@ |
|||||
|
* Go to Point of Sale > Configuration > Point of Sale, and check |
||||
|
the field "Payment Terminal" |
||||
|
|
||||
This module support two payment modes : *card* and *check*. The payment |
|
||||
mode should be configured on the main Odoo server, in the menu *Point |
|
||||
of Sale > Configuration > Payment Methods*, under the *Point of Sale* tab. |
|
||||
|
.. figure:: ../static/description/pos_config_form.png |
||||
|
|
||||
|
* Then, in the same point of sale form, click on "Payment Methods" to |
||||
|
set correctly your account journals. |
||||
|
This module support two payment modes : *card* and *check*, this |
||||
|
option is available in te Point of sale tab. |
||||
|
|
||||
|
.. figure:: ../static/description/account_journal_form.png |
@ -1,2 +1,3 @@ |
|||||
* Aurelien Dumaine |
* Aurelien Dumaine |
||||
* Alexis de Lattre <alexis.delattre@akretion.com> |
* Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
* Sylvain LE GAL (https://twitter.com/legalsylvain) |
After Width: 608 | Height: 288 | Size: 18 KiB |
After Width: 524 | Height: 262 | Size: 18 KiB |
@ -0,0 +1,30 @@ |
|||||
|
/* |
||||
|
POS Payment Terminal module for Odoo |
||||
|
Copyright (C) 2014-2016 Aurélien DUMAINE |
||||
|
Copyright (C) 2014-2016 Akretion (www.akretion.com) |
||||
|
@author: Aurélien DUMAINE |
||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
*/ |
||||
|
|
||||
|
odoo.define('pos_payment_terminal.models', function (require) { |
||||
|
"use strict"; |
||||
|
|
||||
|
var models = require('point_of_sale.models'); |
||||
|
var _orderproto = models.Order.prototype; |
||||
|
|
||||
|
models.load_fields('account.journal', ['payment_mode']); |
||||
|
|
||||
|
models.Order = models.Order.extend({ |
||||
|
initialize: function(){ |
||||
|
_orderproto.initialize.apply(this, arguments); |
||||
|
this.in_transaction = false; |
||||
|
}, |
||||
|
export_as_JSON: function() { |
||||
|
var vals = _orderproto.export_as_JSON.apply(this, arguments); |
||||
|
vals['transactions'] = this.transactions || {}; |
||||
|
return vals; |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
}); |
@ -0,0 +1,42 @@ |
|||||
|
/* |
||||
|
POS Payment Terminal module for Odoo |
||||
|
Copyright (C) 2014-2016 Aurélien DUMAINE |
||||
|
Copyright (C) 2014-2016 Akretion (www.akretion.com) |
||||
|
@author: Aurélien DUMAINE |
||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com> |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
*/ |
||||
|
|
||||
|
odoo.define('pos_payment_terminal.screens', function (require) { |
||||
|
"use strict"; |
||||
|
|
||||
|
var screens = require('point_of_sale.screens'); |
||||
|
|
||||
|
screens.PaymentScreenWidget.include({ |
||||
|
|
||||
|
render_paymentlines : function(){ |
||||
|
this._super.apply(this, arguments); |
||||
|
var self = this; |
||||
|
this.$('.paymentlines-container').unbind('click').on('click', '.payment-terminal-transaction-start', function(event){ |
||||
|
// Why this "on" thing links severaltime the button to the action
|
||||
|
// if I don't use "unlink" to reset the button links before ?
|
||||
|
self.pos.get_order().in_transaction = true; |
||||
|
self.order_changes(); |
||||
|
self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name, self.pos.currency.decimals); |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
order_changes: function(){ |
||||
|
this._super.apply(this, arguments); |
||||
|
var order = this.pos.get_order(); |
||||
|
if (!order) { |
||||
|
return; |
||||
|
} else if (order.in_transaction) { |
||||
|
self.$('.next').html('<img src="/web/static/src/img/spin.png" style="animation: fa-spin 1s infinite steps(12);width: 20px;height: auto;vertical-align: middle;">'); |
||||
|
} else { |
||||
|
self.$('.next').html('Validate <i class="fa fa-angle-double-right"></i>'); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
}); |
@ -1,14 +1,15 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<odoo> |
<odoo> |
||||
|
|
||||
<record id="view_account_journal_pos_user_form" model="ir.ui.view"> |
|
||||
<field name="name">pos.payment.terminal.journal.form</field> |
|
||||
|
<record id="view_account_journal_form" model="ir.ui.view"> |
||||
<field name="model">account.journal</field> |
<field name="model">account.journal</field> |
||||
<field name="inherit_id" ref="point_of_sale.view_account_journal_pos_user_form"/> |
<field name="inherit_id" ref="point_of_sale.view_account_journal_pos_user_form"/> |
||||
<field name="arch" type="xml"> |
<field name="arch" type="xml"> |
||||
<field name="amount_authorized_diff" position="after"> |
|
||||
|
<group name="amount_authorized" position="after"> |
||||
|
<group name="payment_mode_group" attrs="{'invisible': [('type', '!=', 'bank')]}"> |
||||
<field name="payment_mode"/> |
<field name="payment_mode"/> |
||||
</field> |
|
||||
|
</group> |
||||
|
</group> |
||||
</field> |
</field> |
||||
</record> |
</record> |
||||
|
|
||||
|
@ -0,0 +1,13 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<template id="assets" inherit_id="point_of_sale.assets"> |
||||
|
<xpath expr="." position="inside"> |
||||
|
<script type="text/javascript" src="/pos_payment_terminal/static/src/js/screens.js"></script> |
||||
|
<script type="text/javascript" src="/pos_payment_terminal/static/src/js/models.js"></script> |
||||
|
<script type="text/javascript" src="/pos_payment_terminal/static/src/js/devices.js"></script> |
||||
|
<link rel="stylesheet" href="/pos_payment_terminal/static/src/css/pos_payment_terminal.css" /> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
</odoo> |
@ -1,14 +1,17 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<odoo> |
<odoo> |
||||
|
|
||||
|
|
||||
<record id="view_pos_config_form" model="ir.ui.view"> |
<record id="view_pos_config_form" model="ir.ui.view"> |
||||
<field name="name">pos.payment.terminal.config.form</field> |
|
||||
<field name="model">pos.config</field> |
<field name="model">pos.config</field> |
||||
<field name="inherit_id" ref="point_of_sale.view_pos_config_form"/> |
|
||||
|
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/> |
||||
<field name="arch" type="xml"> |
<field name="arch" type="xml"> |
||||
<field name="iface_cashdrawer" position="after"> |
|
||||
|
<xpath expr="//field[@name='iface_cashdrawer']/.." position="after"> |
||||
|
<div class="row"> |
||||
|
<label string="Payment Terminal" for="iface_payment_terminal" class="col-lg-3 o_light_label"/> |
||||
<field name="iface_payment_terminal"/> |
<field name="iface_payment_terminal"/> |
||||
</field> |
|
||||
|
</div> |
||||
|
</xpath> |
||||
</field> |
</field> |
||||
</record> |
</record> |
||||
|
|
||||
|
@ -1,11 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<odoo> |
|
||||
|
|
||||
<template id="assets" inherit_id="point_of_sale.assets" name="pos_payment_terminal assets"> |
|
||||
<xpath expr="." position="inside"> |
|
||||
<script type="text/javascript" src="/pos_payment_terminal/static/src/js/pos_payment_terminal.js"></script> |
|
||||
<link rel="stylesheet" href="/pos_payment_terminal/static/src/css/pos_payment_terminal.css" /> |
|
||||
</xpath> |
|
||||
</template> |
|
||||
|
|
||||
</odoo> |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue