From 568645d74285adaaa70b892fe33175bbc9b5a1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Miguel=20Pardo=20Salar?= Date: Fri, 17 Jun 2022 08:46:12 +0200 Subject: [PATCH] Migrate to 6.0 --- sale.py | 9 ++++----- sale_country.fodt | 2 +- tests/scenario_sale.rst | 18 +++++------------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/sale.py b/sale.py index 13d9783..33da35d 100644 --- a/sale.py +++ b/sale.py @@ -11,10 +11,6 @@ from trytond.wizard import StateReport from trytond.wizard import Wizard, StateTransition, StateView, Button from trytond.tools.multivalue import migrate_property from trytond.modules.company.model import CompanyValueMixin -from trytond import backend - -__all__ = ['SaleConfiguration', 'SaleCountryNote', 'PrintSaleCountryNote', - 'PrintSaleCountryNoteParam', 'ConfigurationReportCountryFilter'] # XXX fix: https://genshi.edgewall.org/ticket/582 from genshi.template.astutil import ASTCodeGenerator, ASTTransformer @@ -88,7 +84,8 @@ class SaleCountryNote(Report): Country = pool.get('country.country') Category = pool.get('product.category') - report_context = super(SaleCountryNote, cls).get_context(records, header, data) + report_context = super(SaleCountryNote, cls).get_context(records, + header, data) company = Company(data['company']) _address = company.party.address_get() @@ -234,6 +231,7 @@ class PrintSaleCountryNote(Wizard): if Transaction().context.get('active_ids'): _ = Transaction().context['active_ids'].pop() + data['company'] = Transaction().context['company'] data['start_date'] = self.params.start_date data['end_date'] = self.params.end_date @@ -247,4 +245,5 @@ class PrintSaleCountryNote(Wizard): data['address_type'] = \ 'invoice' if self.params.invoice_address else 'shipment' data['grouping'] = self.params.grouping + return action, data diff --git a/sale_country.fodt b/sale_country.fodt index 4eb44b7..475d0ac 100644 --- a/sale_country.fodt +++ b/sale_country.fodt @@ -765,7 +765,7 @@ - <set_lang(company.party.lang and company.party.lang.code or 'en_US')> + <set_lang(company.party.lang and company.party.lang.code or 'en')> Sales per country From <format_date(data['start_date'], company.party.lang)>to <format_date(data['end_date'], company.party.lang)> diff --git a/tests/scenario_sale.rst b/tests/scenario_sale.rst index 396a77e..88db576 100644 --- a/tests/scenario_sale.rst +++ b/tests/scenario_sale.rst @@ -39,13 +39,6 @@ Create chart of accounts:: >>> accounts = get_accounts(company) >>> revenue = accounts['revenue'] >>> expense = accounts['expense'] - >>> cash = accounts['cash'] - - >>> Journal = Model.get('account.journal') - >>> cash_journal, = Journal.find([('type', '=', 'cash')]) - >>> cash_journal.credit_account = cash - >>> cash_journal.debit_account = cash - >>> cash_journal.save() Create tax:: @@ -91,7 +84,6 @@ Create product:: >>> template.categories.append(category) >>> template.default_uom = unit >>> template.type = 'goods' - >>> template.purchasable = True >>> template.salable = True >>> template.list_price = Decimal('10') >>> template.cost_price = Decimal('5') @@ -165,7 +157,7 @@ Check report with shipment address:: >>> per_country = Wizard('sale.sale_per_country.print', []) >>> per_country.form.start_date = today >>> per_country.form.end_date = today - >>> per_country.form.type = 'all' + >>> per_country.form.type_ = 'all' >>> per_country.form.quotation = True >>> per_country.form.category = category >>> per_country.form.restrict_countries = False @@ -179,7 +171,7 @@ Check report with shipment address:: >>> per_country = Wizard('sale.sale_per_country.print', []) >>> per_country.form.start_date = today >>> per_country.form.end_date = today - >>> per_country.form.type = 'all' + >>> per_country.form.type_ = 'all' >>> per_country.form.quotation = True >>> per_country.form.category = category >>> per_country.form.restrict_countries = False @@ -192,7 +184,7 @@ Check report with invoice address:: >>> per_country = Wizard('sale.sale_per_country.print', []) >>> per_country.form.start_date = today >>> per_country.form.end_date = today - >>> per_country.form.type = 'all' + >>> per_country.form.type_ = 'all' >>> per_country.form.quotation = True >>> per_country.form.category = category >>> per_country.form.restrict_countries = False @@ -203,7 +195,7 @@ Check report with invoice address:: >>> per_country = Wizard('sale.sale_per_country.print', []) >>> per_country.form.start_date = today >>> per_country.form.end_date = today - >>> per_country.form.type = 'all' + >>> per_country.form.type_ = 'all' >>> per_country.form.quotation = True >>> per_country.form.category = category >>> per_country.form.restrict_countries = False @@ -221,7 +213,7 @@ Configure default countries:: >>> per_country = Wizard('sale.sale_per_country.print', []) >>> per_country.form.start_date = today >>> per_country.form.end_date = today - >>> per_country.form.type = 'export' + >>> per_country.form.type_ = 'export' >>> per_country.form.category = None >>> per_country.form.quotation = False >>> per_country.form.restrict_countries