add messages in electronic invoice

This commit is contained in:
Camilo Sarmiento 2020-04-24 17:30:54 -05:00
parent b0d9f972ea
commit 0568165bef
1 changed files with 12 additions and 3 deletions

View File

@ -224,6 +224,8 @@ class MainWindow(FrontWindow):
'credit_limit_exceed': ('info', self.tr('CREDIT LIMIT FOR CUSTOMER EXCEED!')),
'credit_limit_capacity': ('info', self.tr('THE CUSTOMER CREDIT CAPACITY IS ABOVE 80%')),
'not_can_force_assign': ('warning', self.tr('YOU CAN NOT FORCE ASSIGN!')),
'send_electronic_failed': ('info', self.tr('FALLO EL ENVIO DE FACTURA!')),
'invoice_done_failed': ('info', self.tr('FALLO FINALIZACIÓN DE FACTURA!')),
})
def load_modules(self):
@ -925,9 +927,16 @@ class MainWindow(FrontWindow):
self.label_input.setText(self._input_text)
def __do_invoice_thread(self):
self.ModSale.faster_post_invoice({
'sale_id': self.sale_to_post['id']
})
try:
res = self.ModSale.faster_post_invoice({
'sale_id': self.sale_to_post['id']
})
except:
self.dialog('invoice_done_failed')
return
if not res['result']:
self.dialog('send_electronic_failed')
return
if self.sale_to_post['is_credit']:
return