[FIX] product,stock: allow label printing w/o doc layout
The default behavior of report_action() is to check if the currently selected company has their document layout configured. The product labels do NOT depend on this layout at all though, so let's make it so the configuration never pops up when product/lot labels are being printed. Discovered during task: 3046178 Part-of: odoo/odoo#126791
This commit is contained in:
@@ -72,6 +72,6 @@ class ProductLabelLayout(models.TransientModel):
|
||||
xml_id, data = self._prepare_report_data()
|
||||
if not xml_id:
|
||||
raise UserError(_('Unable to find report template for %s format', self.print_format))
|
||||
report_action = self.env.ref(xml_id).report_action(None, data=data)
|
||||
report_action = self.env.ref(xml_id).report_action(None, data=data, config=False)
|
||||
report_action.update({'close_on_report_download': True})
|
||||
return report_action
|
||||
|
||||
@@ -37,6 +37,6 @@ class ProductLabelLayout(models.TransientModel):
|
||||
docids = []
|
||||
for lot_id, qty in quantity_by_lot.items():
|
||||
docids.append([lot_id] * qty)
|
||||
report_action = self.env.ref(xml_id).report_action(docids)
|
||||
report_action = self.env.ref(xml_id).report_action(docids, config=False)
|
||||
report_action.update({'close_on_report_download': True})
|
||||
return report_action
|
||||
|
||||
Reference in New Issue
Block a user