[IMP] translated for generate ru filenames

This commit is contained in:
Stepan Savelyev 2020-01-15 18:00:55 +05:00
parent 34e73ebc4a
commit 8de9a0fa27
2 changed files with 10 additions and 10 deletions

View File

@ -139,18 +139,18 @@ class DocumentTemplate(models.Model):
document_type = fields.Selection( document_type = fields.Selection(
string="Type of document", string="Type of document",
selection=[ selection=[
("contract", "Contract"), ("contract", _("Contract")),
("annex", "Annex"), ("annex", _("Annex")),
("addition", "Addition"), ("addition", _("Addition")),
] ]
) )
document_type_name = fields.Selection( document_type_name = fields.Selection(
string="Document", string="Document",
selection=[ selection=[
("specification", "Specification"), ("specification", _("Specification")),
("approval_list", "Approval List"), ("approval_list", _("Approval List")),
("act_at", "Act of Acceptance and Transfer"), ("act_at", _("Act of Acceptance and Transfer")),
("act_ad", "Act of Acceptance and Delivery"), ("act_ad", _("Act of Acceptance and Delivery")),
] ]
) )
company_type = fields.Selection( company_type = fields.Selection(

View File

@ -156,14 +156,14 @@ class ContractWizard(models.TransientModel):
if self.target._name == "res.partner.contract": if self.target._name == "res.partner.contract":
contract = self.target contract = self.target
attachment_name = _("{type} {number} from {date}").format( 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, number=contract.name,
date=contract.get_date().strftime("%d.%m.%Y"), date=contract.get_date().strftime("%d.%m.%Y"),
) )
elif self.target._name == "res.partner.contract.annex": elif self.target._name == "res.partner.contract.annex":
annex = self.target annex = self.target
attachment_name = "{type}{name}".format( 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={ name={
"specification": "{number} {type} {name}", "specification": "{number} {type} {name}",
"approval_list": "{number}.1 {type} {name}-1", "approval_list": "{number}.1 {type} {name}-1",
@ -171,7 +171,7 @@ class ContractWizard(models.TransientModel):
"act_ad": "{number}.3 {type} {name}-3", "act_ad": "{number}.3 {type} {name}-3",
}.get(self.document_template.document_type_name).format( }.get(self.document_template.document_type_name).format(
number=annex.number, 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, name=annex.name,
) )
) )