Add lazy_loading.diff

This commit is contained in:
Albert Cervera i Areny 2020-03-26 00:53:52 +01:00
parent 1983c527a0
commit 0c1fcef841
2 changed files with 31 additions and 0 deletions

29
lazy_loading.diff Normal file
View File

@ -0,0 +1,29 @@
diff --git a/trytond/model/fields/many2one.py b/trytond/model/fields/many2one.py
index a086447d..0321bb6d 100644
--- a/trytond/trytond/model/fields/many2one.py
+++ b/trytond/trytond/model/fields/many2one.py
@@ -23,7 +23,7 @@ class Many2One(Field):
ondelete='SET NULL', datetime_field=None, target_search='join',
help='', required=False, readonly=False, domain=None, states=None,
select=False, on_change=None, on_change_with=None, depends=None,
- context=None, loading='eager'):
+ context=None, loading='lazy'):
'''
:param model_name: The name of the target model.
:param left: The name of the field to store the left value for
diff --git a/trytond/model/modelstorage.py b/trytond/model/modelstorage.py
index 32d6a531..1f9c5cc2 100644
--- a/trytond/trytond/model/modelstorage.py
+++ b/trytond/trytond/model/modelstorage.py
@@ -45,9 +45,9 @@ class ModelStorage(Model):
"""
create_uid = fields.Many2One('res.user', 'Create User', readonly=True)
- create_date = fields.Timestamp('Create Date', readonly=True)
+ create_date = fields.Timestamp('Create Date', readonly=True, loading='lazy')
write_uid = fields.Many2One('res.user', 'Write User', readonly=True)
- write_date = fields.Timestamp('Write Date', readonly=True)
+ write_date = fields.Timestamp('Write Date', readonly=True, loading='lazy')
rec_name = fields.Function(fields.Char('Name'), 'get_rec_name',
searcher='search_rec_name')

2
series
View File

@ -85,3 +85,5 @@ issue7856.diff # [stock] Can't move qty from a parent location to child location
issue8058.diff # [stock_supply_production] Can't create productions from request because exceeds digits limit
issue8252.diff # [account_tax_rule_country] Add subdivisiions to match account tax rule
account_statement_message_invoice.diff # [account_statement] Add invoice number in amount_greater_invoice_amount_to_pay error message
lazy_loading.diff