Store the ignore search limit option of export

Closes #13601
This commit is contained in:
Cédric Krier
2024-12-12 23:16:41 +01:00
parent 76cdf889a2
commit 65d3f86149
6 changed files with 33 additions and 8 deletions
+7 -2
View File
@@ -2053,8 +2053,9 @@
Sao.rpc({
'method': 'model.ir.export.get',
'params': [
this.screen.model_name,
['name', 'header', 'records', 'export_fields.name'],
this.screen.model_name, [
'name', 'header', 'records', 'ignore_search_limit',
'export_fields.name'],
this.context,
],
}, this.session).done(exports => {
@@ -2106,6 +2107,8 @@
'records': (
JSON.parse(this.selected_records.val()) ?
'selected' : 'listed'),
'ignore_search_limit': this.ignore_search_limit.is(
':checked'),
};
if (!pref_id) {
values.name = name;
@@ -2185,6 +2188,8 @@
this.selected_records.val(
JSON.stringify(export_.values.records == 'selected'));
this.selected_records.change();
this.ignore_search_limit.prop(
'checked', export_.values.ignore_search_limit);
},
_traverse: function(fields, prefix, parents, i) {
var field, item;
+6 -2
View File
@@ -238,8 +238,9 @@ class WinExport(WinCSV, InfoBar):
def fill_predefwin(self):
try:
exports = RPCExecute(
'model', 'ir.export', 'get', self.model,
['name', 'header', 'records', 'export_fields.name'],
'model', 'ir.export', 'get', self.model, [
'name', 'header', 'records', 'ignore_search_limit',
'export_fields.name'],
context=self.context)
except RPCException:
return
@@ -282,6 +283,7 @@ class WinExport(WinCSV, InfoBar):
'records': (
'selected' if self.selected_records.get_active()
else 'listed'),
'ignore_search_limit': self.ignore_search_limit.get_active(),
}
if not pref_id:
values.update({
@@ -350,6 +352,8 @@ class WinExport(WinCSV, InfoBar):
self.add_field_names.set_active(values.get('header'))
self.selected_records.set_active(
int(values.get('records') == 'selected'))
self.ignore_search_limit.set_active(
values.get('ignore_search_limit'))
def sel_field(self, name):
string_, relation = self.fields[name]
+1
View File
@@ -1,3 +1,4 @@
* Store the ignore search limit option of export
* Make field_names optional in Model.default_get
* Remove check_xml_record from ModelStorage
* Always synchronize XML data with database
+9
View File
@@ -52,6 +52,11 @@ class Export(_ClearCache, ModelSQL, ModelView):
('listed', "Listed"),
], "Records",
help="The records on which the export runs.")
ignore_search_limit = fields.Boolean(
"Ignore Search Limit",
states={
'invisible': Eval('records') != 'listed',
})
export_fields = fields.One2Many('ir.export.line', 'export',
'Fields')
@@ -87,6 +92,10 @@ class Export(_ClearCache, ModelSQL, ModelView):
def default_records(cls):
return 'selected'
@classmethod
def default_ignore_search_limit(cls):
return False
@classmethod
def get(cls, resource, fields_names):
pool = Pool()
+6 -2
View File
@@ -7,10 +7,14 @@ this repository contains the full copyright notices and license terms. -->
<label name="resource"/>
<field name="resource"/>
<label name="header"/>
<field name="header"/>
<label name="records"/>
<field name="records"/>
<group col="-1" colspan="2" id="checkboxes">
<label name="header"/>
<field name="header" xexpand="0" width="25"/>
<label name="ignore_search_limit"/>
<field name="ignore_search_limit" xexpand="0" width="25"/>
</group>
<label name="user"/>
<field name="user"/>
+4 -2
View File
@@ -363,8 +363,10 @@ class ModelView(Model):
prints = Action.get_keyword('form_print', (cls.__name__, -1))
actions = Action.get_keyword('form_action', (cls.__name__, -1))
relates = Action.get_keyword('form_relate', (cls.__name__, -1))
exports = Export.search_read(
[('resource', '=', cls.__name__)],
exports = Export.search_read([
('resource', '=', cls.__name__),
('ignore_search_limit', '=', False),
],
fields_names=['name', 'header', 'records', 'export_fields.name'])
emails = Email.search_read(
[('model.name', '=', cls.__name__)],