-
-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add partner_base_multicompany_default_queue
- Loading branch information
Showing
7 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) | ||
|
||
{ | ||
"name": "Partner Base Multi-Company Default Queue", | ||
"summary": "Glue module between partner_base_multicompany and queue_job", | ||
"version": "16.0.0.1.0", | ||
"development_status": "Alpha", | ||
"category": "Technical", | ||
"website": "https://github.com/OCA/multi-company", | ||
"author": "Camptocamp, Odoo Community Association (OCA)", | ||
"maintainers": ["camptocamp"], | ||
"license": "LGPL-3", | ||
"depends": [ | ||
"partner_base_multicompany_default", | ||
"queue_job", | ||
], | ||
"data": [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import base | ||
from . import partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2024 Camptocamp | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html) | ||
|
||
import functools | ||
|
||
from odoo import api, models | ||
|
||
from ..delay import Delayable | ||
from ..job import DelayableRecordset | ||
from ..utils import must_run_without_delay | ||
|
||
|
||
class Base(models.AbstractModel): | ||
|
||
@api.model | ||
def _job_prepare_context_before_enqueue_keys(self): | ||
"""Keys to keep in context of stored jobs | ||
Empty by default for backward compatibility. | ||
""" | ||
return super()._job_prepare_context_before_enqueue_keys() + ("property_propagation",) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) | ||
import logging | ||
from collections import defaultdict | ||
from functools import reduce | ||
from itertools import groupby | ||
from operator import itemgetter, or_ | ||
|
||
from odoo import _, api, models | ||
from odoo.exceptions import UserError | ||
from odoo.osv import expression | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
class Partner(models.Model): | ||
|
||
_inherit = "res.partner" | ||
|
||
def _propagate_property_fields(self): | ||
# Adding a call with_delay() make an aync propagation of the property fields | ||
return super().with_delay()._propagate_property_fields() |
1 change: 1 addition & 0 deletions
1
partner_base_multicompany_default_queue/readme/CONTRIBUTORS.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Denis Leemann <[email protected]> |
6 changes: 6 additions & 0 deletions
6
partner_base_multicompany_default_queue/readme/DESCRIPTION.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Glue module inbetween `partner_base_multicompany` and `queue_job`. | ||
|
||
The propagation of the fields can be costly given the amount of fields to be propagated | ||
and the amount of companies. | ||
|
||
With this module, we want to make the propagation of the fields asynchronous with the creation of queue_jobs. |