changeset 0450247ff6fb in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset;node=0450247ff6fb
description:
Use _get_for_product_domain to search revision in get_for_product
Otherwise the revisions are not limited to the company.
issue9310
review313541002
diffstat:
product.py | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diffs (23 lines):
diff -r 08a6c42e6430 -r 0450247ff6fb product.py
--- a/product.py Thu May 14 23:52:43 2020 +0200
+++ b/product.py Tue May 19 18:43:47 2020 +0200
@@ -850,11 +850,14 @@
@classmethod
def get_for_product(cls, product):
- revisions = cls.search(['OR',
- ('product', '=', product.id),
- [
- ('template', '=', product.template.id),
- ('product', '=', None),
+ revisions = cls.search([
+ cls._get_for_product_domain(),
+ ['OR',
+ ('product', '=', product.id),
+ [
+ ('template', '=', product.template.id),
+ ('product', '=', None),
+ ],
],
],
order=[('date', 'ASC'), ('id', 'ASC')])