Browse Source

[IMP] display gross weight and tare on ticket (non proxy mode)

pull/501/head
Sylvain LE GAL 4 years ago
parent
commit
eafd5e27c4
  1. 1
      pos_tare/readme/ROADMAP.rst
  2. BIN
      pos_tare/static/description/pos_ticket.png
  3. 10
      pos_tare/static/src/js/models.js
  4. 5
      pos_tare/static/src/js/screens.js
  5. 16
      pos_tare/static/src/xml/pos_tare.xml

1
pos_tare/readme/ROADMAP.rst

@ -1 +0,0 @@
- Print tare value on customer receipt.

BIN
pos_tare/static/description/pos_ticket.png

After

Width: 500  |  Height: 395  |  Size: 24 KiB

10
pos_tare/static/src/js/models.js

@ -97,6 +97,16 @@ odoo.define('pos_tare.models', function (require) {
return tare_str + ' ' + unit.name;
},
get_gross_weight_str_with_unit: function () {
var unit = this.get_unit();
var gross_weight_str = pos_tare_tools.format_tare(
this.pos,
this.get_tare() + this.get_quantity(),
this.get_unit(),
);
return gross_weight_str + ' ' + unit.name;
},
});
models.Orderline = OrderLineWithTare;

5
pos_tare/static/src/js/screens.js

@ -42,11 +42,10 @@ odoo.define('pos_tare.screens', function (require) {
// Overload Section
// /////////////////////////////
// Overload show function
// add an handler on the
show: function () {
this._super();
this.tare = 0.0;
this.gross_weight = 0.0;
this._super();
var self = this;
this.$('#input_weight_tare').keyup(function (event) {
self.onchange_tare(event);

16
pos_tare/static/src/xml/pos_tare.xml

@ -40,4 +40,20 @@
</t>
</t>
<t t-name="PosTicket" t-extend="PosTicket">
<t t-jquery="tr[t-foreach='orderlines'] > td:nth-child(1)"
t-operation="append">
<t t-if="orderline.get_tare() > 0">
<div class="pos-disc-font">
Gross Weight : <t t-esc="orderline.get_gross_weight_str_with_unit()" /><br/>
Tare : <t t-esc="orderline.get_tare_str_with_unit()" /><br/>
</div>
</t>
</t>
</t>
<!-- TODO Overload XmlReceipt for Proxy usage -->
<!-- <t t-name="XmlReceipt" t-extend="XmlReceipt">
</t> -->
</templates>
Loading…
Cancel
Save