-
-
Notifications
You must be signed in to change notification settings - Fork 733
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
[13.0][ADD] product_quantity_update_force_inventory #846
[13.0][ADD] product_quantity_update_force_inventory #846
Conversation
6d3275e
to
719c020
Compare
|
||
def post_load_hook(): | ||
@api.model | ||
def _new_get_quants_action(self, domain=None, extend=False): |
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'm not really in favor of such things as you lose all the inheritance mechanism.
Isn't there any other mean doing the same thing ?
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.
Create a new action and overwrite on views. What is preferable?
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.
And in this case, why not overriding original method directly with normal inheritance ???
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.
At this point, it is a matter of design, or am I missing anything?
This way it will also work! 😺
# Copyright 2018-20 ForgeFlow <http://www.forgeflow.com>
from odoo import api, models
class StockQuant(models.Model):
_inherit = 'stock.quant'
@api.model
def _get_quants_action(self, domain=None, extend=False):
action = super()._get_quants_action(domain=domain, extend=extend)
action['view_id'] = self.env.ref('stock.view_stock_quant_tree').id
# Enables form view in readonly list
action.update({
'view_mode': 'tree,form',
'views': [
(action['view_id'], 'list'),
(self.env.ref('stock.view_stock_quant_form').id, 'form'),
],
})
return action
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 changed the override for that code again, it should perform the same, could we move it forward?
9a7ba0c
to
e30a20f
Compare
95d093c
to
a3eb958
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.
LGTM 👍
Could you clean the commits, I think you have some unwanted commits there
a3eb958
to
c422d8c
Compare
This is great! Indeed I would change module name in order to let people understand what this do. |
Any suggestion for module name change? |
product_quantity_update_force_inventory or something like that. More functional oriented. |
fd625be
to
f1568d8
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.
LGTM 👍
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 works as it says
This PR has the |
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.
Nice one. Functional review 👍
f1568d8
to
00e23a8
Compare
00e23a8
to
14ecfe2
Compare
14ecfe2
to
fe3e246
Compare
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at e494f7d. Thanks a lot for contributing to OCA. ❤️ |
Product Quantity Update Force Inventory
This module forces users to create inventory adjustments instead of updating quantities on product card.
It could be considered as a work around to manage Stock Accounting properly combining:
CC @ForgeFlow