You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
873 B

  1. /* Copyright 2020 Solvos Consultoría Informática
  2. License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  3. */
  4. odoo.define('pos_order_return_traceability.models', function (require) {
  5. 'use strict';
  6. var models = require('point_of_sale.models');
  7. models.load_fields("product.product", ['pos_allow_negative_qty']);
  8. var orderline_super = models.Orderline.prototype;
  9. models.Orderline = models.Orderline.extend({
  10. initialize: function(){
  11. orderline_super.initialize.apply(this, arguments);
  12. this.returned_line_id = false;
  13. this.quantity_returnable = this.get_quantity();
  14. },
  15. export_as_JSON: function () {
  16. var res = orderline_super.export_as_JSON.apply(this, arguments);
  17. res.returned_line_id = this.returned_line_id;
  18. return res;
  19. }
  20. });
  21. });