Migrate to 6.0

This commit is contained in:
José Miguel Pardo Salar 2022-06-17 08:46:12 +02:00
parent 939406e327
commit 568645d742
3 changed files with 10 additions and 19 deletions

View File

@ -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

View File

@ -765,7 +765,7 @@
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
<text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
</text:sequence-decls>
<text:p text:style-name="P47"><text:placeholder text:placeholder-type="text">&lt;set_lang(company.party.lang and company.party.lang.code or &apos;en_US&apos;)&gt;</text:placeholder></text:p>
<text:p text:style-name="P47"><text:placeholder text:placeholder-type="text">&lt;set_lang(company.party.lang and company.party.lang.code or &apos;en&apos;)&gt;</text:placeholder></text:p>
<text:p text:style-name="P34">Sales per country</text:p>
<text:p text:style-name="P25"/>
<text:p text:style-name="P33"><text:span text:style-name="T3">From </text:span><text:span text:style-name="T1"><text:placeholder text:placeholder-type="text">&lt;format_date(data[&apos;start_date&apos;], company.party.lang)&gt;</text:placeholder></text:span><text:span text:style-name="T1"><text:s/></text:span><text:span text:style-name="T2">to </text:span><text:span text:style-name="T1"><text:placeholder text:placeholder-type="text">&lt;format_date(data[&apos;end_date&apos;], company.party.lang)&gt;</text:placeholder></text:span></text:p>

View File

@ -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