[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

@@ -125,6 +125,23 @@
<field name="name">Update printer wizard</field> <field name="name">Update printer wizard</field>
<field name="model_id" ref="model_printing_printer_update_wizard" /> <field name="model_id" ref="model_printing_printer_update_wizard" />
<field name="group_id" ref="printing_group_manager" /> <field name="group_id" ref="printing_group_manager" />
<field eval="1" name="perm_read" />
<field eval="1" name="perm_unlink" />
<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_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" />

View File

@@ -42,14 +42,12 @@ 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 ]
]
)
) )
} }