set message for delete product

This commit is contained in:
Wilson Gomez 2023-03-13 09:31:29 -05:00
parent 2229ea6622
commit 8bebdb5699
2 changed files with 3 additions and 0 deletions

View File

@ -2973,6 +2973,8 @@ class AppWindow(FrontWindow):
self._print_reversion(self._sale['id'], removed_item['id'])
if note:
self.SaleLine.write([removed_item['id']], {'note': note})
if self._sale.get('state') and self._sale['state'] != 'draft' and self.enviroment == 'retail':
return self.dialog('dont_delete_product')
self.SaleLine.delete([removed_item['id']])
self.set_amounts()

View File

@ -61,4 +61,5 @@ class StackMessages(QWidget):
'release_table': ('question', 'DESEA LIBERAR LA MESA?'),
'user_without_permission': ('info', 'USUARIO NO AUTORIZADO!'),
'missing_note_for_delete_product': ('error', 'DEBE ESCRIBIR UNA OBSERVACION PARA ELIMINAR EL PRODUCTO'),
'dont_delete_product': ('error', 'PARA ELIMINAR UN PRODUCTO LA VENTA DEBE ESTAR EN ESTADO BORRADOR \n POR FAVOR FORZAR A BORRADOR LA VENTA DESDE TRYTON'),
}