-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][MIG] sale_pricelist_global_rule #3533
Open
LuciaMarchalFactorLibre
wants to merge
10
commits into
OCA:16.0
Choose a base branch
from
factorlibre:16.0-mig-sale_pricelist_global_rule
base: 16.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[16.0][MIG] sale_pricelist_global_rule #3533
LuciaMarchalFactorLibre
wants to merge
10
commits into
OCA:16.0
from
factorlibre:16.0-mig-sale_pricelist_global_rule
Conversation
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
… quantities across sales order lines - by product template - by product category
…onstraint conflicts The `product_variant_default_code` module adds a unique constraint, which causes test failures when installed alongside `sale_pricelist_global_rule`. This fix adjusts the tests in to avoid conflicts with this unique constraint, ensuring compatibility when both modules are installed.
If not, we get: ``` Traceback (most recent call last): File "/opt/odoo/custom/src/odoo/odoo/http.py", line 658, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 301, in _handle_exception raise exception.with_traceback(None) from new_cause psycopg2.errors.DatatypeMismatch: ARRAY types integer and boolean cannot be matched LINE 9: ...L OR item.global_product_tmpl_id = any(ARRAY[false,... ``` A little refactor for better code in the method is also done. TT51677
…putes complementary to commit 637c766
/ocabot migration sale_pricelist_global_rule |
LuciaMarchalFactorLibre
force-pushed
the
16.0-mig-sale_pricelist_global_rule
branch
from
January 15, 2025 15:14
d0c9dc5
to
423ca3c
Compare
LuciaMarchalFactorLibre
force-pushed
the
16.0-mig-sale_pricelist_global_rule
branch
from
January 16, 2025 12:00
423ca3c
to
5874049
Compare
mmequignon
requested changes
Jan 17, 2025
Comment on lines
+24
to
+48
self.env.cr.execute( | ||
""" | ||
SELECT | ||
item.id | ||
FROM | ||
product_pricelist_item AS item | ||
LEFT JOIN product_category AS categ ON item.categ_id = categ.id | ||
WHERE | ||
(item.product_tmpl_id IS NULL OR item.product_tmpl_id = any(%s)) | ||
AND (item.product_id IS NULL OR item.product_id = any(%s)) | ||
AND (item.categ_id IS NULL OR item.categ_id = any(%s)) | ||
AND (item.pricelist_id = %s) | ||
AND (item.date_start IS NULL OR item.date_start<=%s) | ||
AND (item.date_end IS NULL OR item.date_end>=%s) | ||
AND (item.active = TRUE) | ||
ORDER BY | ||
item.applied_on, item.min_quantity desc, categ.complete_name desc, item.id desc | ||
""", | ||
(prod_tmpl_ids, prod_ids, categ_ids, self.id, date, date), | ||
) | ||
# NOTE: if you change `order by` on that query, make sure it matches | ||
# _order from model to avoid inconstencies and undeterministic issues. | ||
|
||
item_ids = [x[0] for x in self.env.cr.fetchall()] | ||
items = self.env["product.pricelist.item"].browse(item_ids) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you re implementing the whole thing, and ignoring the recursion, or am I missing something?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migration of the sale_pricelist_global_rule module from version 15.0 to 16.0
FL-556-4652