Skip to content

Commit

Permalink
[IMP] Allow users to define their default behaviour and printer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain GARANCHER authored and schout-it committed Sep 30, 2019
1 parent aa3b0e1 commit cb1440f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions base_report_to_printer/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ def _user_available_action_types(self):
)
printing_printer_id = fields.Many2one(comodel_name='printing.printer',
string='Default Printer')

@api.model
def _register_hook(self):
self.SELF_WRITEABLE_FIELDS.extend([
'printing_action',
'printing_printer_id',
])
self.SELF_READABLE_FIELDS.extend([
'printing_action',
'printing_printer_id',
])
4 changes: 2 additions & 2 deletions base_report_to_printer/views/res_users.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<field name="arch" type="xml">
<footer position="before">
<group string="Printing" name="printing">
<field name="printing_action"/>
<field name="printing_printer_id" options="{'no_create': True}"/>
<field name="printing_action" readonly="0"/>
<field name="printing_printer_id" readonly="0" options="{'no_create': True}"/>
</group>
</footer>
</field>
Expand Down

0 comments on commit cb1440f

Please sign in to comment.