minor fix

This commit is contained in:
Wilson Gomez 2023-11-03 17:30:32 -05:00
parent f3b49f5a3f
commit 0ac16c993e
1 changed files with 4 additions and 6 deletions

View File

@ -1,18 +1,16 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
import os
import logging
import base64
import time
import traceback
import threading
import atexit
from decimal import Decimal
from datetime import datetime, timedelta
from collections import OrderedDict
from PySide6 import QtGui
from PySide6.QtCore import Qt, QTimer, QThread
from PySide6.QtCore import Qt
from PySide6.QtWidgets import (
QLabel, QHBoxLayout, QVBoxLayout,
QWidget)
@ -36,7 +34,7 @@ from .commons.custom_button import CustomButton
from .threads import DoInvoice
from .store import StoreView
from .constants import (
PATH_PRINTERS, DELTA_LOCALE, STRETCH, alignRight, alignLeft, alignCenter,
DELTA_LOCALE, STRETCH, alignRight, alignLeft, alignCenter,
alignHCenter, DIALOG_REPLY_NO, ZERO, RATE_CREDIT_LIMIT, CONVERSION_DIGITS,
SALE_FIELDS, KIND_REST, KIND_RETAIL, DIALOG_REPLY_YES,
)
@ -1558,8 +1556,8 @@ class AppWindow(FrontWindow):
sale = self.store.store
if number:
if type_doc in ['order', 'delivery', 'quotation']:
if number != sale.get('number'):
sale_id = sale['id']
if number != sale.get('number') and sale.get('id'):
sale_id = sale.get('id')
else:
sales = self.Sale.find([('number', '=', number)], fields=['id'])
sale = sales[0]