pos_journal_sequence : pos_sequence -> sequence, to have the same as v9
This commit is contained in:
@@ -27,10 +27,13 @@
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Order payment buttons in Point of Sale',
|
||||
'description': """
|
||||
This module adds a field *POS Sequence* on account journals that will
|
||||
This module adds a field *Sequence* field on account journals that will
|
||||
allow you to control the order of the payment buttons in the interface
|
||||
of the point of sale. It requires a patch on the Javascript code of the
|
||||
point of sale (cf file odoo-point_of_sale.patch).
|
||||
point of sale (cf file odoo-point_of_sale.patch) for v8.
|
||||
|
||||
In Odoo v9, this feature will be native, cf
|
||||
https://github.com/odoo/odoo/pull/3705
|
||||
|
||||
This module has been written by Alexis de Lattre
|
||||
<alexis.delattre@akretion.com>.
|
||||
|
||||
@@ -25,7 +25,8 @@ from openerp import models, fields
|
||||
|
||||
class AccountJournal(models.Model):
|
||||
_inherit = 'account.journal'
|
||||
_order = 'sequence,code'
|
||||
|
||||
pos_sequence = fields.Integer(
|
||||
string='POS Sequence',
|
||||
sequence = fields.Integer(
|
||||
string='Sequence',
|
||||
help='Sequence used to order Payment buttons in the Point of Sale')
|
||||
|
||||
@@ -6,9 +6,9 @@ index 8e02ddd..b95c113 100644
|
||||
renderElement: function() {
|
||||
var self = this;
|
||||
this._super();
|
||||
+ // sort cashregisters by pos_sequence
|
||||
+ // sort cashregisters by sequence
|
||||
+ this.pos.cashregisters.sort(function(obj1, obj2) {
|
||||
+ return obj1.journal.pos_sequence - obj2.journal.pos_sequence;
|
||||
+ return obj1.journal.sequence - obj2.journal.sequence;
|
||||
+ });
|
||||
|
||||
_.each(this.pos.cashregisters,function(cashregister) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<field name="inherit_id" ref="point_of_sale.view_account_journal_pos_user_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="amount_authorized_diff" position="after">
|
||||
<field name="pos_sequence"/>
|
||||
<field name="sequence"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
@@ -26,7 +26,7 @@
|
||||
<field name="inherit_id" ref="point_of_sale.view_pos_config_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='journal_ids']/tree/field[@name='cash_control']" position="after">
|
||||
<field name="pos_sequence"/>
|
||||
<field name="sequence"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user