minor fix
This commit is contained in:
parent
cdeb770e9f
commit
1ccb56fa75
|
@ -7,10 +7,10 @@ from decimal import Decimal
|
||||||
from PyQt5.QtCore import Qt, QThread, pyqtSignal, QDate
|
from PyQt5.QtCore import Qt, QThread, pyqtSignal, QDate
|
||||||
from .tools import get_icon, to_float, to_numeric
|
from .tools import get_icon, to_float, to_numeric
|
||||||
from .dialogs import (Help, SearchSale, SearchParty, SearchProduct, Position,
|
from .dialogs import (Help, SearchSale, SearchParty, SearchProduct, Position,
|
||||||
Comment, DialogPayment, DialogSalesman, DialogVoucher, DialogPrintInvoice,
|
Comment, DialogPayment, DialogSalesman, DialogVoucher, DialogPrintInvoice,
|
||||||
DialogGlobalDiscount, DialogPaymentTerm, DialogStock, DialogOrder,
|
DialogGlobalDiscount, DialogPaymentTerm, DialogStock, DialogOrder,
|
||||||
DialogForceAssign, DialogTaxes, DialogCancelInvoice, SaleLine, DialogAgent,
|
DialogForceAssign, DialogTaxes, DialogCancelInvoice, SaleLine, DialogAgent,
|
||||||
DialogConsumer, DialogManageTables)
|
DialogConsumer, DialogManageTables)
|
||||||
from datetime import datetime, timedelta, date
|
from datetime import datetime, timedelta, date
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
# from PyQt5.QtGui import QTouchEvent
|
# from PyQt5.QtGui import QTouchEvent
|
||||||
|
@ -1882,13 +1882,14 @@ class MainWindow(FrontWindow):
|
||||||
self._current_line_id = res['id']
|
self._current_line_id = res['id']
|
||||||
self.add_sale_line(res)
|
self.add_sale_line(res)
|
||||||
self._sale_line['product'] = product
|
self._sale_line['product'] = product
|
||||||
print(product)
|
|
||||||
self._products[product['id']] = product
|
self._products[product['id']] = product
|
||||||
|
|
||||||
self.update_total_amount()
|
self.update_total_amount()
|
||||||
self.set_state('add')
|
self.set_state('add')
|
||||||
|
|
||||||
def _check_stock_quantity(self, product, request_qty=None):
|
def _check_stock_quantity(self, product, request_qty=None):
|
||||||
|
if not isinstance(product['quantity'], (str, int, float, Decimal)):
|
||||||
|
return True
|
||||||
qty_ = Decimal(product['quantity'])
|
qty_ = Decimal(product['quantity'])
|
||||||
if self._password_admin:
|
if self._password_admin:
|
||||||
if (request_qty and qty_ < request_qty) or (qty_ <= 0):
|
if (request_qty and qty_ < request_qty) or (qty_ <= 0):
|
||||||
|
|
|
@ -82,7 +82,10 @@ class FastModel(object):
|
||||||
route = self.get_route('model_method')
|
route = self.get_route('model_method')
|
||||||
data = json.dumps(args_, default=encoder)
|
data = json.dumps(args_, default=encoder)
|
||||||
res = requests.post(route, data=data)
|
res = requests.post(route, data=data)
|
||||||
data = res.json()
|
try:
|
||||||
|
data = res.json()
|
||||||
|
except ValueError:
|
||||||
|
print(res.text)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue