-
-
Notifications
You must be signed in to change notification settings - Fork 339
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
[14.0][IMP] product_barcode_constraint_per_company: simplify logic #537
[14.0][IMP] product_barcode_constraint_per_company: simplify logic #537
Conversation
bed05b5
to
cddf5eb
Compare
cddf5eb
to
e879582
Compare
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.
Do not add new dependency to multi barcode module.
@legalsylvain Do you think we need to create a bridge module for that, or is there possibly another solution? |
e879582
to
524392e
Compare
multi barcode module is a module that is really changing a lot of things. The feature is not desired in some implementation. So in that case, indeed glue module looks a good solution, if you want to make the module product_barcode_constraint_per_company working with that module. |
supersedes #526 |
524392e
to
7722d53
Compare
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.
except the deletion of the README.rst file, LGTM. Thanks !
bbb5f35
to
33bd632
Compare
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.
nitpicking : still changes in product_barcode_constraint_per_company/README.rst !
No need to change this file, it will be generated automatically, when mergin the PR, by the bot.
regards.
a206cd3
to
df61843
Compare
df61843
to
5431e29
Compare
60bfe4b
to
30a8ce8
Compare
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.
Please fix comments
@api.constrains("name") | ||
def _check_duplicates(self): | ||
for record in self: | ||
barcodes = self.search( |
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.
Why you use search function here?
And why you call super
in cycle?
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.
Thanks, I'll fix it
|
||
def test_create_different_company(self): | ||
"""Verify creating a product with the same barcode for different companies""" | ||
super().test_create_different_company() |
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.
You deactivate parent function. Why do you use super
here?
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.
Thanks, I'll fix it
|
||
def test_create_same_company(self): | ||
"""Verifying the Existence of a Product with the Same Barcode within a Single Company""" | ||
super().test_create_same_company() |
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.
You deactivate parent function. Why do you use super
here?
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.
Thanks, I'll fix it
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.
Code review, LGTM
@simahawk good for you? |
@simahawk waiting for your blessing :) |
@simahawk help me Orsi-Wan Kenobi, you're my only hope |
@pedrobaeza can this be merged based on existing reviews? |
@@ -87,4 +87,4 @@ promote its widespread use. | |||
|
|||
This module is part of the `OCA/stock-logistics-barcode <https://github.com/OCA/stock-logistics-barcode/tree/14.0/product_barcode_constraint_per_company>`_ project on GitHub. | |||
|
|||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. | |||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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.
Remove this change.
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.
still here
"summary": "Change the product barcode constraint" | ||
", allowing the same barcode for differents companies", | ||
"summary": """Change the product barcode constraint, | ||
allowing the same barcode for differents companies""", |
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.
Don't change this. It was correct. Now, it isn't, as the spaces are included.
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.
Thanks for review!)
I'll fix it
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.
pls check Pedro's remarks
@@ -6,13 +6,13 @@ | |||
"name": "Product Barcode Constraint per Company", | |||
"version": "14.0.1.0.1", |
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.
Detail: as you added a new module in the same PR you should change the version manually here, unless you don't care that the new module will have version 1.1.0 too when we'll bump w/ minor
.
if barcode and ( | ||
not record.product_id.company_id | ||
or ( | ||
barcode.sudo().product_id.company_id == record.product_id.company_id |
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.
I'd move sudo
to for record in self.sudo()
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.
Thanks for review!)
I'll fix it
e2713a1
to
92adfe2
Compare
@pedrobaeza @simahawk kind reminder :) |
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.
minor remark, pre-approving
@@ -87,4 +87,4 @@ promote its widespread use. | |||
|
|||
This module is part of the `OCA/stock-logistics-barcode <https://github.com/OCA/stock-logistics-barcode/tree/14.0/product_barcode_constraint_per_company>`_ project on GitHub. | |||
|
|||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. | |||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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.
still here
c6f40a7
to
fed1a4c
Compare
Update oca_dependencies file Fix tests
fed1a4c
to
f1b5832
Compare
@pedrobaeza please check, I have corrected your comments) |
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.
/ocabot merge nobump
On my way to merge this fine PR! |
Congratulations, your PR was merged at 67df8ca. Thanks a lot for contributing to OCA. ❤️ |
Change old method
Update oca_dependencies file
Fix tests