summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Heinz <rhe@odoo.com>2019-12-19 12:40:38 +0000
committerPierre Masereel <pim@odoo.com>2021-04-27 12:50:35 +0000
commit54922b38ec2a7de6c3691bae1b23b7288236d04b (patch)
treee1a71e316058aaf17321c4d8ab8524291afa26eb
parent02ee7a505fa8cdc57ea26cb0bccd7b3f5792f30c (diff)
[IMP] point_of_sale: improve serial number usuability.
This tasks allow to see serial numbers or lot numbers for each products on the order. It also add the same information on an invoice generated by the POS if the option is ticked in the pos config. closes odoo/odoo#42410 closes odoo/odoo#69932 Task-id: 2154835 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
-rw-r--r--addons/point_of_sale/static/src/js/models.js5
-rw-r--r--addons/point_of_sale/static/src/xml/Screens/ProductScreen/Orderline.xml9
-rw-r--r--addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml11
3 files changed, 25 insertions, 0 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index f8530296caf..30f131cba62 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -1820,6 +1820,10 @@ exports.Orderline = Backbone.Model.extend({
}
},
+ get_lot_lines: function() {
+ return this.pack_lot_lines.models;
+ },
+
get_required_number_of_lots: function(){
var lots_required = 1;
@@ -1936,6 +1940,7 @@ exports.Orderline = Backbone.Model.extend({
tax: this.get_tax(),
product_description: this.get_product().description,
product_description_sale: this.get_product().description_sale,
+ pack_lot_lines: this.get_lot_lines()
};
},
generate_wrapped_product_name: function() {
diff --git a/addons/point_of_sale/static/src/xml/Screens/ProductScreen/Orderline.xml b/addons/point_of_sale/static/src/xml/Screens/ProductScreen/Orderline.xml
index 258e44e2e98..e0d44c76163 100644
--- a/addons/point_of_sale/static/src/xml/Screens/ProductScreen/Orderline.xml
+++ b/addons/point_of_sale/static/src/xml/Screens/ProductScreen/Orderline.xml
@@ -60,6 +60,15 @@
</li>
</t>
</ul>
+ <t t-if="props.line.get_lot_lines()">
+ <ul class="info-list">
+ <t t-foreach="props.line.get_lot_lines()" t-as="lot">
+ <li>
+ SN <t t-esc="lot.attributes['lot_name']"/>
+ </li>
+ </t>
+ </ul>
+ </t>
</li>
</t>
diff --git a/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml b/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml
index 14e3c65d96b..9950009ebff 100644
--- a/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml
+++ b/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml
@@ -90,6 +90,17 @@
</span>
</div>
</t>
+ <t t-if="line.pack_lot_lines">
+ <div class="pos-receipt-left-padding">
+ <ul>
+ <t t-foreach="line.pack_lot_lines" t-as="lot">
+ <li>
+ SN <t t-esc="lot.attributes['lot_name']"/>
+ </li>
+ </t>
+ </ul>
+ </div>
+ </t>
</t>
</div>