[tryton-commits] changeset in www.tryton.org:default Do not lazy load first slide

2022-04-29 Thread Cédric Krier
changeset c6374ffd0d60 in www.tryton.org:default
details: https://hg.tryton.org/www.tryton.org?cmd=changeset=c6374ffd0d60
description:
Do not lazy load first slide
diffstat:

 templates/index.html |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (16 lines):

diff -r 8da8c19ab2c0 -r c6374ffd0d60 templates/index.html
--- a/templates/index.html  Sat Apr 09 11:40:10 2022 +0200
+++ b/templates/index.html  Sat Apr 30 00:59:49 2022 +0200
@@ -2,9 +2,9 @@
 {% set description = "TRYTON is business software, ideal for companies of any 
size, easy to use, complete and 100% Open Source." %}
 {% extends "layout.html" %}
 {% macro slide_img(i) %}
-
-
-
+{% if i != 1 %}{% endif %}
+
+{% if i != 1 %}{% endif %}
 {% endmacro %}
 {% block head %}
 {{ super() }}



[tryton-commits] changeset in modules/account_fr_chorus:default Create invoice to...

2022-04-29 Thread Hodei Navarro
changeset 00a9ee03419a in modules/account_fr_chorus:default
details: 
https://hg.tryton.org/modules/account_fr_chorus?cmd=changeset=00a9ee03419a
description:
Create invoice to send only for newly posted invoices

issue11434
review405301002
diffstat:

 account.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r e73f43aa1dcf -r 00a9ee03419a account.py
--- a/account.pySat Apr 16 18:30:16 2022 +0200
+++ b/account.pyFri Apr 29 23:42:52 2022 +0200
@@ -109,9 +109,11 @@
 def _post(cls, invoices):
 pool = Pool()
 InvoiceChorus = pool.get('account.invoice.chorus')
+posted_invoices = {
+i for i in invoices if i.state in {'draft', 'validated'}}
 super()._post(invoices)
 invoices_chorus = []
-for invoice in invoices:
+for invoice in posted_invoices:
 if invoice.type == 'out' and invoice.party.chorus:
 invoices_chorus.append(InvoiceChorus(invoice=invoice))
 InvoiceChorus.save(invoices_chorus)



[tryton-commits] changeset in modules/account_es_sii:default Create invoice to se...

2022-04-29 Thread Hodei Navarro
changeset 1fde2a54e45d in modules/account_es_sii:default
details: 
https://hg.tryton.org/modules/account_es_sii?cmd=changeset=1fde2a54e45d
description:
Create invoice to send only for newly posted invoices

issue11434
review405301002
diffstat:

 account.py |  7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 5182d3648b95 -r 1fde2a54e45d account.py
--- a/account.pyMon Apr 25 18:34:06 2022 +0200
+++ b/account.pyFri Apr 29 23:42:52 2022 +0200
@@ -212,9 +212,12 @@
 def _post(cls, invoices):
 pool = Pool()
 InvoiceSII = pool.get('account.invoice.sii')
+posted_invoices = {
+i for i in invoices if i.state in {'draft', 'validated'}}
 super()._post(invoices)
-InvoiceSII.save(
-[InvoiceSII(invoice=i) for i in invoices if i.es_send_to_sii])
+InvoiceSII.save([
+InvoiceSII(invoice=i) for i in posted_invoices
+if i.es_send_to_sii])
 
 @property
 def es_send_to_sii(self):



[tryton-commits] changeset in sao:default Use column instead of optional variable...

2022-04-29 Thread Cédric Krier
changeset 9915d18ef7e7 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset=9915d18ef7e7
description:
Use column instead of optional variable to loop over optionals

This was the original variable name before changeset 9efb7fa52876.

issue11441
diffstat:

 src/view/tree.js |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 7cae3ee7c17b -r 9915d18ef7e7 src/view/tree.js
--- a/src/view/tree.js  Mon Apr 25 23:22:20 2022 +0200
+++ b/src/view/tree.js  Fri Apr 29 23:25:36 2022 +0200
@@ -337,7 +337,7 @@
 },
 save_optional: function(store=true) {
 var fields = {};
-for (const optional of this.optionals) {
+for (const column of this.optionals) {
 fields[column.attributes.name] = !column.get_visible();
 }
 if (store) {



[tryton-commits] changeset in trytond:default Remove user login and user preferen...

2022-04-29 Thread Nicolas Évrard
changeset a18d951b647d in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset=a18d951b647d
description:
Remove user login and user preferences cache

The user login cache could result in an error when using trytond in a
multiprocess environment due to a delay in the broadcast of the cache
invalidation.

The user preferences cache was there only to set the context when 
validating
the records but it is useless since the context is now set from the
transaction.

review401251002
issue11430
diffstat:

 trytond/model/modelstorage.py |  12 +-
 trytond/res/__init__.py   |   2 -
 trytond/res/ir.py |  39 --
 trytond/res/user.py   |  49 ++
 4 files changed, 4 insertions(+), 98 deletions(-)

diffs (232 lines):

diff -r 633a31cb1026 -r a18d951b647d trytond/model/modelstorage.py
--- a/trytond/model/modelstorage.py Wed Apr 27 18:28:46 2022 +0200
+++ b/trytond/model/modelstorage.py Fri Apr 29 17:14:27 2022 +0200
@@ -1146,15 +1146,6 @@
 # also convert iterator to list
 records = cls.browse(records)
 
-ctx_pref = {}
-if Transaction().user:
-try:
-User = pool.get('res.user')
-except KeyError:
-pass
-else:
-ctx_pref = User.get_preferences(context_only=True)
-
 def is_pyson(test):
 if isinstance(test, PYSON):
 return True
@@ -1324,8 +1315,7 @@
 field_names = set(field_names)
 function_fields = {name for name, field in cls._fields.items()
 if isinstance(field, fields.Function)}
-ctx_pref['active_test'] = False
-with Transaction().set_context(ctx_pref):
+with Transaction().set_context(active_test=False):
 for field_name, field in cls._fields.items():
 if (field_name not in field_names
 and not (field.validation_depends & field_names)
diff -r 633a31cb1026 -r a18d951b647d trytond/res/__init__.py
--- a/trytond/res/__init__.py   Wed Apr 27 18:28:46 2022 +0200
+++ b/trytond/res/__init__.py   Fri Apr 29 17:14:27 2022 +0200
@@ -30,10 +30,8 @@
 ir.ModelButtonRule,
 ir.ModelButtonClick,
 ir.RuleGroupGroup,
-ir.Lang,
 ir.SequenceType,
 ir.SequenceTypeGroup,
-ir.ModuleConfigWizardItem,
 ir.Export,
 ir.Export_Group,
 ir.Export_Write_Group,
diff -r 633a31cb1026 -r a18d951b647d trytond/res/ir.py
--- a/trytond/res/ir.py Wed Apr 27 18:28:46 2022 +0200
+++ b/trytond/res/ir.py Fri Apr 29 17:14:27 2022 +0200
@@ -176,16 +176,6 @@
 select=True, required=True)
 
 
-class Lang(metaclass=PoolMeta):
-__name__ = 'ir.lang'
-
-@classmethod
-def write(cls, langs, values, *args):
-super(Lang, cls).write(langs, values, *args)
-# Restart the cache for get_preferences
-Pool().get('res.user')._get_preferences_cache.clear()
-
-
 class SequenceType(metaclass=PoolMeta):
 __name__ = 'ir.sequence.type'
 groups = fields.Many2Many('ir.sequence.type-res.group', 'sequence_type',
@@ -224,35 +214,6 @@
 Rule._domain_get_cache.clear()
 
 
-class ModuleConfigWizardItem(metaclass=PoolMeta):
-__name__ = 'ir.module.config_wizard.item'
-
-@classmethod
-def create(cls, vlist):
-pool = Pool()
-User = pool.get('res.user')
-result = super(ModuleConfigWizardItem, cls).create(vlist)
-# Restart the cache for get_preferences
-User._get_preferences_cache.clear()
-return result
-
-@classmethod
-def write(cls, items, values, *args):
-pool = Pool()
-User = pool.get('res.user')
-super(ModuleConfigWizardItem, cls).write(items, values, *args)
-# Restart the cache for get_preferences
-User._get_preferences_cache.clear()
-
-@classmethod
-def delete(cls, items):
-pool = Pool()
-User = pool.get('res.user')
-super(ModuleConfigWizardItem, cls).delete(items)
-# Restart the cache for get_preferences
-User._get_preferences_cache.clear()
-
-
 class Export(metaclass=PoolMeta):
 __name__ = 'ir.export'
 
diff -r 633a31cb1026 -r a18d951b647d trytond/res/user.py
--- a/trytond/res/user.py   Wed Apr 27 18:28:46 2022 +0200
+++ b/trytond/res/user.py   Fri Apr 29 17:14:27 2022 +0200
@@ -155,9 +155,7 @@
 warnings = fields.One2Many('res.user.warning', 'user', 'Warnings')
 sessions = fields.Function(fields.Integer('Sessions'),
 'get_sessions')
-_get_preferences_cache = Cache('res_user.get_preferences')
 _get_groups_cache = Cache('res_user.get_groups', context=False)
-_get_login_cache = Cache('res_user._get_login', context=False)
 
 @classmethod
 def __setup__(cls):
@@ -374,10 +372,7 @@
 @classmethod
 def 

[tryton-commits] changeset in modules/company_work_time:default Remove user login...

2022-04-29 Thread Nicolas Évrard
changeset 4a857556b923 in modules/company_work_time:default
details: 
https://hg.tryton.org/modules/company_work_time?cmd=changeset=4a857556b923
description:
Remove user login and user preferences cache

The user login cache could result in an error when using trytond in a
multiprocess environment due to a delay in the broadcast of the cache
invalidation.

The user preferences cache was there only to set the context when 
validating
the records but it is useless since the context is now set from the
transaction.

review401251002
issue11430
diffstat:

 company.py |  7 ---
 1 files changed, 0 insertions(+), 7 deletions(-)

diffs (14 lines):

diff -r bfbd2c379a74 -r 4a857556b923 company.py
--- a/company.pySat Apr 16 18:30:17 2022 +0200
+++ b/company.pyFri Apr 29 17:14:27 2022 +0200
@@ -37,10 +37,3 @@
 @staticmethod
 def default_hours_per_work_year():
 return 1920
-
-@classmethod
-def write(cls, *args):
-pool = Pool()
-User = pool.get('res.user')
-super(Company, cls).write(*args)
-User._get_preferences_cache.clear()



[tryton-commits] changeset in tryton-tools:default Update email addresses for new...

2022-04-29 Thread Cédric Krier
changeset 28c5e9522d06 in tryton-tools:default
details: https://hg.tryton.org/tryton-tools?cmd=changeset=28c5e9522d06
description:
Update email addresses for new rietveld instance

issue11445
diffstat:

 reviewbot.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (14 lines):

diff -r 364fc1aeefaf -r 28c5e9522d06 reviewbot.py
--- a/reviewbot.py  Mon Apr 04 22:14:47 2022 +0200
+++ b/reviewbot.py  Fri Apr 29 09:46:53 2022 +0200
@@ -25,8 +25,8 @@
 REPOSITORY_URL = 'https://hg.tryton.org/'
 MODULE_REPOSITORY_URL = REPOSITORY_URL + 'modules/'
 DB_PATH = os.path.expanduser('~/.reviewbot.db')
-TO = 're...@tryton-rietveld-hrd.appspotmail.com'
-TO_ROUNDUP = 'issue_trac...@tryton.org'
+TO = 're...@tryton-review.appspotmail.com'
+TO_ROUNDUP = 'b...@tryton.org'
 COMMENT_TEMPLATE = """\
 %(url)s/%(issue_id)s/diff/%(patchset)s/%%(path)s#newcode%%(row)s
 %%(path)s:%%(row)s: