-
Notifications
You must be signed in to change notification settings - Fork 41
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
12.0 split beesdoo product product main supplier #411
12.0 split beesdoo product product main supplier #411
Conversation
b9eb927
to
402fc16
Compare
@carmenbianca Could you review this commit c43d439? It merges the changes from your PR #320 |
status: waiting for #320 to be merged and then backport it |
todo:
|
ea8948c
to
44812ed
Compare
Done |
Codecov Report
@@ Coverage Diff @@
## 12.0 #411 +/- ##
=======================================
Coverage 39.26% 39.26%
=======================================
Files 44 44
Lines 1541 1541
Branches 293 293
=======================================
Hits 605 605
Misses 933 933
Partials 3 3 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Todo : wait for #261 to be merged and rebase |
c2d2205
to
a2ba475
Compare
a2ba475
to
b97190b
Compare
@robinkeunen @carmenbianca @huguesdk @remytms ready for review |
@polchampion deployed in test, ready for testing |
b3de0ed
to
bfe27f2
Compare
@polchampion Voici les fonctionnalités affectées par le split: Module product_main_supplier
Module suggested_price
Module sale_adapt_price_wizard
|
07f9fec
to
ed9bed1
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.
@victor-champonnois Thanks a lot for the detailed functionalities, this makes it a lot easier to test.
Module product_main_supplier
- Adds a main supplier
- Allows searching a product given the product reference of the main
supplier (also known as the product_code of the product.supplierinfo
object).
Module suggested_price
- Adds a 'Suggested Price' field on products templates
- Adds a 'Product Margin' field on Partners (Vendors) and Product Categories.
- The first margin is used if set, otherwise the second margin (which has a default value) is used.
- The reference price on which this margin is applied (supplier price or sale price) can be selected in the general settings. --> Somebody please explain to me the sense of the "applied on sale price" computation, cause I never understood that piece of maths.
- (Not tested) Also, sale and supplier taxes that are of type 'percentage' and that are marked as 'included in price' are taken into account when computing the suggested price.
- Round suggested price to 5 cents --> NOK - What should I test?
Module sale_adapt_price_wizard
- Adds "Edit Price" submenu on Point Of Sale, Purchase and Sale modules --> NOK on POS app - ALSO : please move the "Edit Price" menu item before the "Configuration" menu item.
- The user lands on an editable List View with the following columns :
Name (name)
Main Seller (main_seller_id)
Purchase Price (purchase_price)
Purchase Unit of Measure (uom_po_id)
Suggested Price (suggested_price)
Sales Price (list_price)
Unit of Measure (uom_id)
--> AND Sales price last updated - The only editable field is Purchase Price.
- Through "Action > Adapt Sales Price", the user can, on the selected products, adapt the Sales Price according to the Suggested Price. --> NOK see error copied below
- Alternatively, 'Automatically write suggested price' can be enabled to make
this last step automatic. --> NOK doesn't work
Odoo Server Error
Traceback (most recent call last):
File "/home/odoo12/src/odoo/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/odoo12/src/odoo/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/home/odoo12/src/odoo/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/home/odoo12/src/odoo/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/home/odoo12/src/odoo/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/odoo12/src/odoo/odoo/service/model.py", line 98, in wrapper
return f(dbname, *args, **kwargs)
File "/home/odoo12/src/odoo/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/home/odoo12/src/odoo/odoo/http.py", line 941, in __call__
return self.method(*args, **kw)
File "/home/odoo12/src/odoo/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/home/odoo12/src/odoo/addons/web/controllers/main.py", line 971, in call_button
action = self._call_kw(model, method, args, {})
File "/home/odoo12/src/odoo/addons/web/controllers/main.py", line 959, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/odoo12/src/odoo/odoo/api.py", line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/home/odoo12/src/odoo/odoo/api.py", line 746, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/home/odoo12/src/coopiteasy/obeesdoo/sale_adapt_price_wizard/wizard/adapt_sales_price_wizard.py", line 25, in adapt_sales_price
product.adapt_list_price(vals)
AttributeError: 'product.template' object has no attribute 'adapt_list_price'```
@polchampion on which DB did you test ? |
5611068
to
542d7be
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.
Some remarks. But very good work. :) Thanks
@@ -0,0 +1 @@ | |||
Use either "seller" or "supplier", not both. |
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 don't understand this comment. Can you point me where supplier
is used instead of seller
? Except for the object supplierinfo
but that's an Odoo choice. And changing the name of this object is not into our hands.
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.
Is there a real difference in english about supplier
and seller
?
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.
How I see now that the name of the module is product_main_supplier
, is that what you point 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.
No I though supplier and seller could be used interchangeably, and that we should harmonize, but from what you said above, they are not the same. So the comment can indeed be removed. Is that right ?
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 found that the code is well named like this. So for me that's ok. But someone else may have other point of view. I don't think it really important.
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.
OK removing it then, let's discuss about this in the issue and then decide what to do
sale_suggested_price/__manifest__.py
Outdated
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "sale_suggested_price", |
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.
Use Sale Suggested Price
as name. :)
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.
@victor-champonnois Did you forget this point or is there a reason for the name of this module with _
?
542d7be
to
35b20e6
Compare
@remytms thx for the review, ready for re-review ! |
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.
It seams there is a small change needed. :)
sale_suggested_price/__manifest__.py
Outdated
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "sale_suggested_price", |
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.
@victor-champonnois Did you forget this point or is there a reason for the name of this module with _
?
@victor-champonnois The change of |
96f47bc
to
f305451
Compare
@remytms all fixed ! |
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.
3 readme to be regenerated than it will be totally good. :)
f305451
to
30fd945
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.
Yeah ! :)
Please note that this model makes assumptions when computing the suggested price: | ||
|
||
- It supposes that each product has only one supplier and that products coming from multiple suppliers | ||
occur as duplicated products with one supplier each. |
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.
Can you add to this file the new modules you created ?
This PR has the |
30fd945
to
16068d1
Compare
Functionally validated on bees-test and spp-test: Module
Module
Module
|
into: - product_main_supplier - sale_suggested_price - sale_adapt_price_wizard [REF] split beesdoo_product -> product_main_supplier [FIX] sale_suggested_price dep on product_main_supplier [ADD] module sale_edit_price_wizard [REF] rename sale_edit_price_wizard -> sale_adapt_price_wizard [REF] move rounding_method to sale_suggested_price [REF] refactor following PR 320 [REF] search product_code -> product_main_seller [FIX] bug adapt_sales_price [IMP] use float_compare to compare prices [REF] move list_price_write_date to sale_adapt_price_wizard [FIX] beesdoo_product: main_seller_id search [FIX] run precommit fix
16068d1
to
fa8695a
Compare
/ocabot merge nobump |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at c36ba0c. Thanks a lot for contributing to beescoop. ❤️ |
fix #392
fix #409
fix #391
Split part of beesdoo_product into:
The dependency graph is the following :
sale_edit_price_wizard
->sale_suggested_price
->product_main_supplier
Todo : merge #320
Migration is done in modules with this method