Browse Source

[FIX]Type Error fixed

pull/82/head
Sreejith P 7 years ago
parent
commit
64ff58f907
  1. 5
      product_return_pos/__manifest__.py
  2. 9
      product_return_pos/models/pos_return.py
  3. 5
      product_return_pos/static/src/js/pos_return.js

5
product_return_pos/__manifest__.py

@ -3,8 +3,7 @@
# #
# Cybrosys Technologies Pvt. Ltd. # Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). # Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Anusha (<https://www.cybrosys.com>) # Author: Anusha P P(<https://www.cybrosys.com>)
#
# This program is free software: you can modify # This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as # it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -21,7 +20,7 @@
################################################################################### ###################################################################################
{ {
'name': 'Product Return In POS', 'name': 'Product Return In POS',
'version': '10.0.1.0.0', 'version': '10.0.1.1.0',
'category': 'Point of Sale', 'category': 'Point of Sale',
'summary': 'POS Order Return', 'summary': 'POS Order Return',
'author': 'Cybrosys Techno Solutions', 'author': 'Cybrosys Techno Solutions',

9
product_return_pos/models/pos_return.py

@ -50,7 +50,7 @@ class PosReturn(models.Model):
if line: if line:
qty = -(data[2]['qty']) qty = -(data[2]['qty'])
line.returned_qty += qty line.returned_qty += qty
if ui_order['return_ref']: if 'return_ref' in ui_order.keys() and ui_order['return_ref']:
order['return_ref'] = ui_order['return_ref'] order['return_ref'] = ui_order['return_ref']
parent_order = self.search([('pos_reference', '=', ui_order['return_ref'])], limit=1) parent_order = self.search([('pos_reference', '=', ui_order['return_ref'])], limit=1)
lines = self.env['pos.order.line'].search([('order_id', '=', parent_order.id)]) lines = self.env['pos.order.line'].search([('order_id', '=', parent_order.id)])
@ -61,11 +61,12 @@ class PosReturn(models.Model):
if line.returned_qty: if line.returned_qty:
ret += 1 ret += 1
if qty-ret == 0: if qty-ret == 0:
parent_order.return_status = 'fully_return' if parent_order:
parent_order.return_status = 'fully_return'
elif ret: elif ret:
if qty > ret: if qty > ret:
parent_order.return_status = 'partialy_return' if parent_order:
parent_order.return_status = 'partialy_return'
return order return order
@api.model @api.model

5
product_return_pos/static/src/js/pos_return.js

@ -131,6 +131,7 @@ models.PosModel = models.PosModel.extend({
var self = this; var self = this;
var new_order = {}; var new_order = {};
var orders_list = self.pos_orders; var orders_list = self.pos_orders;
for (var i in orders) { for (var i in orders) {
var partners = self.partners; var partners = self.partners;
var partner = ""; var partner = "";
@ -459,7 +460,9 @@ var OrderSuper = models.Order;
models.Order = models.Order.extend({ models.Order = models.Order.extend({
initialize: function(attributes,options){ initialize: function(attributes,options){
var order = OrderSuper.prototype.initialize.call(this, attributes,options); var order = OrderSuper.prototype.initialize.call(this, attributes,options);
order.return_ref = ''; if (typeof(order) != 'undefined'){
order.return_ref = ' '
}
return order; return order;
}, },
init_from_JSON: function(json) { init_from_JSON: function(json) {

Loading…
Cancel
Save