Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
e9bd1cb3
Commit
e9bd1cb3
authored
1 year ago
by
OCA Git Bot
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'odoo/14.0' into 14.0
parents
11f66682
7bedae38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
addons/bus/models/bus.py
+11
-1
11 additions, 1 deletion
addons/bus/models/bus.py
doc/cla/corporate/ibm.md
+15
-0
15 additions, 0 deletions
doc/cla/corporate/ibm.md
with
26 additions
and
1 deletion
addons/bus/models/bus.py
+
11
−
1
View file @
e9bd1cb3
...
...
@@ -2,6 +2,7 @@
import
datetime
import
json
import
logging
import
os
import
random
import
select
import
threading
...
...
@@ -12,11 +13,16 @@ from odoo import api, fields, models, SUPERUSER_ID
from
odoo.tools.misc
import
DEFAULT_SERVER_DATETIME_FORMAT
from
odoo.tools
import
date_utils
from
psycopg2
import
sql
_logger
=
logging
.
getLogger
(
__name__
)
# longpolling timeout connection
TIMEOUT
=
50
# custom function to call instead of NOTIFY postgresql command (opt-in)
ODOO_NOTIFY_FUNCTION
=
os
.
environ
.
get
(
'
ODOO_NOTIFY_FUNCTION
'
)
#----------------------------------------------------------
# Bus
#----------------------------------------------------------
...
...
@@ -62,7 +68,11 @@ class ImBus(models.Model):
@self.env.cr.postcommit.add
def
notify
():
with
odoo
.
sql_db
.
db_connect
(
'
postgres
'
).
cursor
()
as
cr
:
cr
.
execute
(
"
notify imbus, %s
"
,
(
json_dump
(
list
(
channels
)),))
if
ODOO_NOTIFY_FUNCTION
:
query
=
sql
.
SQL
(
"
SELECT {}(
'
imbus
'
, %s)
"
).
format
(
sql
.
Identifier
(
ODOO_NOTIFY_FUNCTION
))
else
:
query
=
"
NOTIFY imbus, %s
"
cr
.
execute
(
query
,
(
json_dump
(
list
(
channels
)),
))
@api.model
def
sendone
(
self
,
channel
,
message
):
...
...
This diff is collapsed.
Click to expand it.
doc/cla/corporate/ibm.md
0 → 100644
+
15
−
0
View file @
e9bd1cb3
USA, 14 Sep 2023
IBM agrees to the terms of the Odoo Corporate Contributor License
Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this
declaration.
Signed,
Brad Topol btopol@us.ibm.com https://github.com/bradtopol
List of contributors:
Ludovic Gasc ludovic.gasc@be.ibm.com https://github.com/ludovic-gasc
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment