From 8de9a0fa27d3e07868235e5f431f73c2de857632 Mon Sep 17 00:00:00 2001 From: Stepan Savelyev Date: Wed, 15 Jan 2020 18:00:55 +0500 Subject: [PATCH] [IMP] translated for generate ru filenames --- models/res_partner_contract.py | 14 +++++++------- wizard/res_partner_contract_wizard.py | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/models/res_partner_contract.py b/models/res_partner_contract.py index 6880f71..3b694c8 100644 --- a/models/res_partner_contract.py +++ b/models/res_partner_contract.py @@ -139,18 +139,18 @@ class DocumentTemplate(models.Model): document_type = fields.Selection( string="Type of document", selection=[ - ("contract", "Contract"), - ("annex", "Annex"), - ("addition", "Addition"), + ("contract", _("Contract")), + ("annex", _("Annex")), + ("addition", _("Addition")), ] ) document_type_name = fields.Selection( string="Document", selection=[ - ("specification", "Specification"), - ("approval_list", "Approval List"), - ("act_at", "Act of Acceptance and Transfer"), - ("act_ad", "Act of Acceptance and Delivery"), + ("specification", _("Specification")), + ("approval_list", _("Approval List")), + ("act_at", _("Act of Acceptance and Transfer")), + ("act_ad", _("Act of Acceptance and Delivery")), ] ) company_type = fields.Selection( diff --git a/wizard/res_partner_contract_wizard.py b/wizard/res_partner_contract_wizard.py index 91b8e49..7dc43d1 100644 --- a/wizard/res_partner_contract_wizard.py +++ b/wizard/res_partner_contract_wizard.py @@ -156,14 +156,14 @@ class ContractWizard(models.TransientModel): if self.target._name == "res.partner.contract": contract = self.target attachment_name = _("{type} {number} from {date}").format( - type=dict(self.document_template._fields['document_type'].selection).get(self.document_template.document_type), + type=_(dict(self.document_template._fields['document_type'].selection).get(self.document_template.document_type)), number=contract.name, date=contract.get_date().strftime("%d.%m.%Y"), ) elif self.target._name == "res.partner.contract.annex": annex = self.target attachment_name = "{type} №{name}".format( - type=dict(self.document_template._fields['document_type'].selection).get(self.document_template.document_type), + type=_(dict(self.document_template._fields['document_type'].selection).get(self.document_template.document_type)), name={ "specification": "{number} {type} {name}", "approval_list": "{number}.1 {type} {name}-1", @@ -171,7 +171,7 @@ class ContractWizard(models.TransientModel): "act_ad": "{number}.3 {type} {name}-3", }.get(self.document_template.document_type_name).format( number=annex.number, - type=dict(self.document_template._fields['document_type_name'].selection).get(self.document_template.document_type_name), + type=_(dict(self.document_template._fields['document_type_name'].selection).get(self.document_template.document_type_name)), name=annex.name, ) )