Skip to content

Commit

Permalink
[IMP] base: rename action multi tool-tip and remove it from reports
Browse files Browse the repository at this point in the history
The tool-tip for the action multi field had an incorrect string and tool-tip. This commit clears up its behavior.

This option is necessary especially for actions (window) such as "merge" where 2 records are needed and selecting only one record will raise an exception.

However it is unnecessary to keep this option for print reports as there should be no such multiple record limitation. This commit also removes it from the reports.

Task ID: 1819329
PR: #25904
  • Loading branch information
seb-odoo committed Aug 14, 2018
1 parent 61a6347 commit e5e0557
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion odoo/addons/base/models/ir_actions.py
Expand Up @@ -277,7 +277,7 @@ class IrActionsActWindowView(models.Model):
view_id = fields.Many2one('ir.ui.view', string='View')
view_mode = fields.Selection(VIEW_TYPES, string='View Type', required=True)
act_window_id = fields.Many2one('ir.actions.act_window', string='Action', ondelete='cascade')
multi = fields.Boolean(string='On Multiple Doc.', help="If set to true, the action will not be displayed on the right toolbar of a form view.")
multi = fields.Boolean(string='Restrict to lists', help="If checked and the action is bound to a model, it will only appear in the More menu on list views")

@api.model_cr_context
def _auto_init(self):
Expand Down
1 change: 0 additions & 1 deletion odoo/addons/base/models/ir_actions_report.py
Expand Up @@ -96,7 +96,6 @@ class IrActionsReport(models.Model):
report_file = fields.Char(string='Report File', required=False, readonly=False, store=True,
help="The path to the main report file (depending on Report Type) or empty if the content is in another field")
groups_id = fields.Many2many('res.groups', 'res_groups_report_rel', 'uid', 'gid', string='Groups')
multi = fields.Boolean(string='On Multiple Doc.', help="If set to true, the action will not be displayed on the right toolbar of a form view.")

paperformat_id = fields.Many2one('report.paperformat', 'Paper Format')
print_report_name = fields.Char('Printed Report Name',
Expand Down
3 changes: 1 addition & 2 deletions odoo/addons/base/tests/test_reports.py
Expand Up @@ -24,8 +24,7 @@ def test_reports(self):
report_records = report_model.search([], limit=10)
if not report_records:
_logger.info("no record found skipping report %s", report.report_name)
if not report.multi:
report_records = report_records[:1]
report_records = report_records[:1]

# Test report generation
report.render_qweb_html(report_records.ids)
Expand Down
1 change: 0 additions & 1 deletion odoo/addons/base/views/ir_actions_views.xml
Expand Up @@ -84,7 +84,6 @@
</page>
<page name='advanced' string="Advanced Properties">
<group>
<field name="multi"/>
<field name="attachment_use"/>
<field name="attachment"/>
</group>
Expand Down
4 changes: 2 additions & 2 deletions odoo/models.py
Expand Up @@ -3486,8 +3486,8 @@ def create(self, vals_list):
data_list.append(data)

if unknown_names:
_logger.warning("%s.create() with unknown fields: %s",
self._name, ', '.join(sorted(unknown_names)))
_logger.warning("%s.create() with unknown fields: %s | vals: %s",
self._name, ', '.join(sorted(unknown_names)), vals)

# create or update parent records
for model_name, parent_name in self._inherits.items():
Expand Down
2 changes: 0 additions & 2 deletions odoo/tools/convert.py
Expand Up @@ -300,8 +300,6 @@ def _tag_report(self, rec, data_node=None, mode=None):
if rec.get('header'):
res['header'] = safe_eval(rec.get('header','False'))

res['multi'] = rec.get('multi') and safe_eval(rec.get('multi','False'))

xml_id = rec.get('id','')
self._test_xml_id(xml_id)

Expand Down

0 comments on commit e5e0557

Please sign in to comment.