From eb934a3de9e924c2147d4804fa6c168a59a8ba1a Mon Sep 17 00:00:00 2001 From: sinergia Date: Mon, 11 Dec 2023 20:41:19 -0500 Subject: [PATCH] fix: Se corrigen errores en 6.8 --- report_close_statement.py | 21 ++++---- sale.py | 4 -- sale.xml | 104 +++++++++++++++++++------------------- view/sale_form.xml | 7 +-- 4 files changed, 68 insertions(+), 68 deletions(-) diff --git a/report_close_statement.py b/report_close_statement.py index bdece44..3c6d613 100644 --- a/report_close_statement.py +++ b/report_close_statement.py @@ -43,10 +43,11 @@ class ReportCloseStatementStart(ModelView): @classmethod def default_shop(cls): context = Transaction().context - shop = context['shop'] - - if shop: - return shop + if context: + shop = context['shop'] + if shop: + return shop + return class PrintReportCloseStatement(Wizard): @@ -108,10 +109,10 @@ class CashRegister(Report): return journals = [j.id for j in device.journals] statements = Statement.search([ - ('journal', 'in', journals), - ('state', 'in', ['validated', 'posted']), - ('date', '=', date) - ]) + ('journal', 'in', journals), + ('state', 'in', ['validated', 'posted']), + ('date', '=', date) + ]) return statements def _get_invoices_by_subtype(date, shop): @@ -173,7 +174,7 @@ class CashRegister(Report): amount_tips.append(info_pizzas_sold['amount_tip']) total_amount += sale.total_amount - untaxed_amount_for_tax = round((tax_amount * 100)/Decimal('8.0'), 2) + untaxed_amount_for_tax = round((tax_amount * 100) / Decimal('8.0'), 2) statements = cls._get_statements_by_date(data['date']) if statements: @@ -184,7 +185,7 @@ class CashRegister(Report): 'total_amount': sum( (line.amount for line in statement.lines if line.description), Decimal(0)) - } for statement in statements] + } for statement in statements] report_context['total_statements'] = sum( [s['total_amount'] for s in report_context['statements']]) diff --git a/sale.py b/sale.py index e287d17..3e79ed3 100644 --- a/sale.py +++ b/sale.py @@ -126,10 +126,6 @@ class Sale(metaclass=PoolMeta): @classmethod def get_invoice(cls, record): - pool = Pool() - ctx = Transaction().context - Shop = pool.get('sale.shop') - shop = Shop.search([('id', '=', ctx["shop"])])[0] if record.state != 'draft' and record.invoices: invoice = record.invoices[0] data = {} diff --git a/sale.xml b/sale.xml index 5c88593..4700891 100644 --- a/sale.xml +++ b/sale.xml @@ -2,55 +2,57 @@ - - sale.sale - - sale_tree - - - sale.sale - - sale_form - - - sale.line - - sale_line_form - - - add_pizza - Add Pizza - - - - kitchen - Kitchen - - - - bar - Bar - - - - print_bill - Bill - - - - impreso - Impreso - - - - Customer Order - sale.sale - sale.customer_order - sale_fast_food/report/customer_order.fodt - - - form_print - sale.sale,-1 - - + + + sale.sale + + sale_tree + + + sale.sale + + sale_form + + + sale.line + + sale_line_form + + + add_pizza + Add Pizza + + + + kitchen + Kitchen + + + + bar + Bar + + + + print_bill + Bill + + + + impreso + Impreso + + + + Customer Order + sale.sale + sale.customer_order + sale_fast_food/report/customer_order.fodt + + + form_print + sale.sale,-1 + + + diff --git a/view/sale_form.xml b/view/sale_form.xml index 4604357..a161879 100644 --- a/view/sale_form.xml +++ b/view/sale_form.xml @@ -12,8 +12,9 @@ this repository contains the full copyright notices and license terms. --> - -