[ADD] access right for wizrard print attachment and fix trans format

This commit is contained in:
sonhd
2022-01-21 10:19:14 +07:00
committed by John Herholz
parent 96153bc6b1
commit c97706d549
2 changed files with 23 additions and 8 deletions

View File

@@ -128,6 +128,23 @@
<field eval="1" name="perm_read" /> <field eval="1" name="perm_read" />
<field eval="1" name="perm_unlink" /> <field eval="1" name="perm_unlink" />
<field eval="1" name="perm_write" /> <field eval="1" name="perm_write" />
</record>
<record id="access_wizard_print_attachment_user" model="ir.model.access">
<field name="name">Print Attachment User</field>
<field name="model_id" ref="model_wizard_print_attachment" />
<field name="group_id" ref="printing_group_user" />
<field eval="1" name="perm_read" />
<field eval="1" name="perm_unlink" />
<field eval="1" name="perm_write" />
<field eval="1" name="perm_create" />
</record>
<record id="access_wizard_print_attachment_line_user" model="ir.model.access">
<field name="name">Print Attachment Line User</field>
<field name="model_id" ref="model_wizard_print_attachment_line" />
<field name="group_id" ref="printing_group_user" />
<field eval="1" name="perm_read" />
<field eval="1" name="perm_unlink" />
<field eval="1" name="perm_write" />
<field eval="1" name="perm_create" /> <field eval="1" name="perm_create" />
</record> </record>
</odoo> </odoo>

View File

@@ -42,15 +42,13 @@ class PrintAttachment(models.TransientModel):
) )
if errors: if errors:
return { return {
"warning": _( "warning": _("Following attachments could not be printed:\n\n%s")
"Following attachments could not be printed:\n\n%s"
% "\n".join( % "\n".join(
[ [
_("%s (%s copies)") % (err.record_name, err.copies) _("%s (%s copies)") % (err.record_name, err.copies)
for err in errors for err in errors
] ]
) )
)
} }