-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
8.0 port module stock_reserve #8
Conversation
Can't you do this with reserved quants? |
@pedrobaeza Here we want to be able to reserve a quantity of products manually and release them. Here we want to be able to reserve some products from a specific location for a specific duration. |
…e test pass as it isn't a dependancy.
97d1cc1
to
1c131d9
Compare
don't use half the quantity so that the reserved qty is different from available qty
* check that multiple reservations are handled correctly * check that various UOM are handled correctly
test that reservations will trigger orderpoint procurements
fix a bug in the code to make the tests green
b9ca443
to
f475283
Compare
I've given the addon a good shake, added some tests and fixed an issue found on the way LGTM 👍 |
|
||
@api.multi | ||
def action_view_reservations(self): | ||
assert len(self._ids) == 1, "Expected 1 ID, got %r" % self._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.
Is the assertion necessary with the new api?
Also, if self._ids
is a tuple, it will fail the string substitution so it should be put in a tuple (I don't know what self._ids
is supposed to be so do not take my remark into account if it is irrelevant).
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 use the official self.ids
instead.
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.
in fact shouldn't it be @api.one
?
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, it can be, although the meaning maybe it's not the same if he wants to limit the operation to one record each time.
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.
@api.one would return a list of returned results I'll check if it works for an 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.
Yeah, that's true, so the behaviour changes. It must be this way then
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.
Just tested it, button action calling a method with decorator @api.one does nothing.
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.
maybe this should be reported as an odoo bug, don't you think?
c53d3fd
to
a4e8885
Compare
Effectivly it looks like a bug:
Maybe action button are explicitly decortated with multi and adding one has no effect. AFAIK there is not mutex test on those decorators. |
The discussion on the decorator doesn't seem me to be this module's fault. So 👍, thanks! |
Hi @pedrobaeza do you agree it's a problem in odoo and we can merge that one? thanks a lot! |
Yeah, sure. 👍 |
thanks! |
8.0 port module stock_reserve
…mpletion_info Rely on stock_move_common_dest as dependency
No description provided.