Add encoding 'utf8' to str.

Remove unnecesary rec_name in UserError.
Add message.xml to tryton.cfg.
Re-format message.xml file.
This commit is contained in:
Juanjo Garcia 2020-05-15 09:48:49 +02:00
parent 34c5827912
commit 5e27473d2b
3 changed files with 34 additions and 32 deletions

View File

@ -157,7 +157,7 @@ class AccountImportContaplusStart(ModelView):
def on_change_data(self):
inv = False
if self.data:
for iline in read_all(str(self.data)):
for iline in read_all(str(self.data, 'utf8')):
if len(iline.contra.strip()) > 0:
inv = True
break
@ -187,11 +187,11 @@ class AccountImportContaplus(Wizard):
if not parties:
raise UserError(
gettext('account_import_contaplus.msg_party_not_found' ,
party=party.rec_name))
party=party))
if (len(parties) > 1):
raise UserError(
gettext('account_import_contaplus.msg_multiple_parties_found' ,
party=party.rec_name))
party=party))
return parties[0]
def get_account(self, account):
@ -200,11 +200,11 @@ class AccountImportContaplus(Wizard):
if not accounts:
raise UserError(
gettext('account_import_contaplus.msg_account_not_found' ,
account=account.rec_name))
if (len(accounts) > 1):
account=account))
if (len(accounts) > 1):
raise UserError(
gettext('account_import_contaplus.msg_multiple_accounts_found' ,
account=account.rec_name))
account=account))
return accounts[0]
def get_account_maybe(self, account):
@ -227,7 +227,7 @@ class AccountImportContaplus(Wizard):
to_create = {}
pre = "ALE-"
for iline in read(str(self.start.data)):
for iline in read(str(self.start.data, 'utf8')):
asien = pre + iline.asien
if asien not in to_create:
@ -360,7 +360,7 @@ class AccountImportContaplus(Wizard):
vat = vat_0 # default vat no taxes
totals = {}
invoice = None # current invoice
for iline in read(str(self.start.data)):
for iline in read(str(self.start.data, 'utf8')):
iline.factura = iline.factura.strip()
iline.serie = iline.serie.strip()
invoice_number = iline.serie + iline.factura

View File

@ -1,27 +1,28 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton><data group="1">
<record model="ir.message" id="msg_number_exists">
<field name="text">Duplicated account move number "%(move_number)s".</field>
</record>
<record model="ir.message" id="msg_multiple_accounts_found">
<field name="text">Multiple accounts fount for "%(account)s"</field>
</record>
<record model="ir.message" id="msg_party_not_found">
<field name="text">Party "%(party)s" not found</field>
</record>
<record model="ir.message" id="msg_multiple_parties_found">
<field name="text">Multiple parties fount for "%(party)s"</field>
</record>
<record model="ir.message" id="msg_unbalance_lines">
<field name="text">Unbalance lines</field>
</record>
<record model="ir.message" id="msg_unmatch_total_invoice">
<field name="text">Total for %(invoice)s does not match</field>
</record>
<record model="ir.message" id="msg_missing_payment_term">
<field name="text">Payment terms missing for %(party)s.</field>
</record>
</data></tryton>
<tryton>
<data grouped="1">
<record model="ir.message" id="msg_number_exists">
<field name="text">Duplicated account move number "%(move_number)s".</field>
</record>
<record model="ir.message" id="msg_multiple_accounts_found">
<field name="text">Multiple accounts fount for "%(account)s"</field>
</record>
<record model="ir.message" id="msg_party_not_found">
<field name="text">Party "%(party)s" not found</field>
</record>
<record model="ir.message" id="msg_multiple_parties_found">
<field name="text">Multiple parties fount for "%(party)s"</field>
</record>
<record model="ir.message" id="msg_unbalance_lines">
<field name="text">Unbalance lines</field>
</record>
<record model="ir.message" id="msg_unmatch_total_invoice">
<field name="text">Total for %(invoice)s does not match</field>
</record>
<record model="ir.message" id="msg_missing_payment_term">
<field name="text">Payment terms missing for %(party)s.</field>
</record>
</data>
</tryton>

View File

@ -7,3 +7,4 @@ depends:
account_es
xml:
account.xml
message.xml