diff --git a/history_delete_product.fods b/history_delete_product.fods index 512e325..2fe58de 100644 --- a/history_delete_product.fods +++ b/history_delete_product.fods @@ -1,22 +1,22 @@ - 2022-11-21T16:14:45.9668377182023-01-21T18:56:46.446459200PT23M17S11LibreOffice/7.3.6.2$Linux_X86_64 LibreOffice_project/30$Build-2 + 2022-11-21T16:14:45.9668377182023-10-13T15:06:47.202528816PT3H58M41S33LibreOffice/7.3.7.2$Linux_X86_64 LibreOffice_project/30$Build-2 0 0 - 36858 - 5211 + 41787 + 5285 view1 - 11 - 16 + 13 + 7 2 - 5 + 4 0 0 0 @@ -28,7 +28,7 @@ Sheet1 - 1834 + 1900 0 160 60 @@ -63,6 +63,15 @@ false true false + + + en + US + + + + + 12632256 true true @@ -98,7 +107,9 @@ - + + + @@ -109,298 +120,126 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - $ - - - - - - $ - - ( - - ) - - - $ - - - - - - - - - - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - - - / - - / - - - - - - - - - - - - - - - - - % - - - - - - - % - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - + - - - + + + - + - + + + - pta - - - - - - - pta - - - - - pta - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $ - - - ($ + + + ( ) - - - $ + - - + - - - $ - - - - - - - - $ - - - - - - - + - - - + + + - - - - - - - - - - - - - - - + $ - + $ - - + ( - + ) - + $ - - + - - - + + + - + - - + + - - + - - - + + + - + - - + - + - - - + + + - - + + + + + + - + + + + + + + $ + + + - - + $ - + - + + $ - - - - + - @@ -409,86 +248,258 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $ - - - + + + + - - $ - - - - - - - + + - + + + pta + + - - - - - - - - - + + pta - + + + - pta + + - - - + + + - + + + + + + + + - + + + + + + - + + + + + + + + + + + + + + + + + + ( + + ) + + + + - + + + + + + + + + + + + + + + + - + + + + + + + + + + - + + + + + + + - + + + + + + + + + + + + + / + + / + + + + + + + + $ + + + + + + $ + + - + + + + + $ + + - + + + + + + + + + + + - + - - + - + + + + + + + + + + + + - + + + + + + + + - + + + + + + + $ + + + + + ($ + + ) + + + + $ + + + + + - + $ + + + + + + % + + + + - + + % + + + + + + + + + + - + + + + + + - + + + + + + + + + + + $ - + ( $ ) - + @@ -685,26 +696,55 @@ - + - + - + - + + + + - + - + + + + + + + + + + / + + / + + + + + - + + - + + + + : + + : + + / @@ -714,37 +754,37 @@ - + - + - + - + - + - + - + - + @@ -752,47 +792,57 @@ - + - + - + - + - + + + + + + - + - + + + + + + - + - + @@ -800,31 +850,36 @@ - + - + - + + + + + + - + - + - + @@ -846,12 +901,13 @@ - + - - - - + + + + + company.party.name @@ -912,12 +968,14 @@ - - + - + - FECHA + FECHA ELIMINACION + + + FECHA VENTA ORDEN @@ -952,34 +1010,37 @@ FECHA CREADA + + TIEMPO TRANSCURRIDO + NOTAS - - + for each='line in records' - - - + + - line.date + line.create_date + + line.date line.sale and line.sale.number - line.product.code + line.product.code - line.product.name + line.product.name line.quantity line.unit_price - line.shop.name + line.shop.name line.order_status @@ -989,26 +1050,25 @@ line.salesman and line.salesman.rec_name - line.line_created + line.line_created + + line.line_created -line.create_date line.note - - + /for - - - + + - - + @@ -1018,13 +1078,11 @@ - - + - - + diff --git a/message.xml b/message.xml index cd8a627..704b85b 100644 --- a/message.xml +++ b/message.xml @@ -12,8 +12,8 @@ this repository contains the full copyright notices and license terms. --> Party %s has no any account receivable defined. Please, assign one. - - The sale '%(sale)s' can not delete + + The sale can not delete becouse this order has sended The quantity '%(quantity)s' must be less than '%(product_mix)s' in products mix diff --git a/sale.py b/sale.py index a1dc24a..93af042 100644 --- a/sale.py +++ b/sale.py @@ -236,12 +236,10 @@ class Sale(metaclass=PoolMeta): @classmethod def delete(cls, sales): - for sale in sales: - for line in sale.lines: - if line.order_sended: - raise DeleteSaleError( - gettext('sale_pos_frontend_rest.msg_delete_error', - sale=sale.number)) + has_order_sended = any(line.order_sended for sale in sales for line in sale.lines) + if has_order_sended: + raise DeleteSaleError( + gettext('sale_pos_frontend_rest.msg_sale_delete_error')) super(Sale, cls).delete(sales) @classmethod @@ -542,6 +540,7 @@ class SaleLineHistoryDelete(ModelView, ModelSQL): salesman = fields.Many2One('company.employee', 'Salesman') line_created = fields.DateTime('Line Created') + class SaleLineHistoryDeleteStart(ModelSQL, ModelView): 'Sale Line History Delete Start' __name__ = 'line_history.delete_start' @@ -612,7 +611,9 @@ class SaleLineHistoryDeleteReport(Report): domain = [ ('date', '>=', data['start_date']), ('date', '<=', data['end_date']), - ] + ] + if data['shop']: + domain.append(('shop', '=', data['shop'])) records = History.search_read(domain) record_ids = [r['id'] for r in records] records = cls._get_records(record_ids, 'sale.line._history.delete', data) diff --git a/view/line_history_delete_view_form.xml b/view/line_history_delete_view_form.xml index 541d8ec..1180294 100644 --- a/view/line_history_delete_view_form.xml +++ b/view/line_history_delete_view_form.xml @@ -5,7 +5,7 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig