[tryton-commits] changeset in modules/notification_email:default Do not migrate l...

2021-10-13 Thread Adrià Tarroja Caubet
changeset 789a2cf40077 in modules/notification_email:default
details: 
https://hg.tryton.org/modules/notification_email?cmd=changeset=789a2cf40077
description:
Do not migrate log if it has resource

issue10855
review364201002
diffstat:

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

diffs (12 lines):

diff -r 267cc29073b7 -r 789a2cf40077 notification.py
--- a/notification.py   Sun Sep 26 23:11:21 2021 +0200
+++ b/notification.py   Wed Oct 13 18:27:52 2021 +0200
@@ -403,7 +403,7 @@
 cursor.execute(*table.update(
 [table.notification, table.resource],
 [notification, resource],
-where=table.trigger != Null))
+where=(table.trigger != Null) & (table.resource == Null)))
 table_h.not_null_action('trigger', 'remove')
 
 def get_date(self, name):



[tryton-commits] changeset in modules/notification_email:default Do not migrate l...

2021-08-12 Thread Cédric Krier
changeset 1b99cee3a0fd in modules/notification_email:default
details: 
https://hg.tryton.org/modules/notification_email?cmd=changeset=1b99cee3a0fd
description:
Do not migrate log without trigger

The notification and resource columns are required so they can not be 
updated
with NULL value when there is no trigger linked.

issue10622
review369341002
diffstat:

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

diffs (21 lines):

diff -r f8724016634c -r 1b99cee3a0fd notification.py
--- a/notification.py   Mon Jul 12 23:12:23 2021 +0200
+++ b/notification.py   Thu Aug 12 18:36:32 2021 +0200
@@ -8,6 +8,7 @@
 from email.mime.nonmultipart import MIMENonMultipart
 from email.utils import getaddresses
 
+from sql import Null
 from sql.operators import Concat
 from genshi.template import TextTemplate
 
@@ -399,7 +400,8 @@
 where=trigger.id == table.trigger))
 cursor.execute(*table.update(
 [table.notification, table.resource],
-[notification, resource]))
+[notification, resource],
+where=table.trigger != Null))
 table_h.not_null_action('trigger', 'remove')
 
 def get_date(self, name):