Review: Needs Information
How about that one?
--
https://code.launchpad.net/~yann-papouin/ocb-addons/6.1-bug-1267845-product-and-category-search-improved-usability/+merge/201192
Your team OpenERP Community Backports Team is subscribed to branch
lp:ocb-addons/6.1.
--
Mailing list:
which gives the same result as the original regex
re.compile('(\[(.*?)\])').search('[Code[A][B][C]] Product name').group(2)
'Code[A'
and the code path you added would search for 'Code[A][B][C' which doesn't seem
that much better to me.
Don't you think that's a quite theoretical case?
--
You're right. This one should cover them all:
re.compile('(\[([^]]+)\]?)')
--
https://code.launchpad.net/~yann-papouin/ocb-addons/6.1-bug-1267845-product-and-category-search-improved-usability/+merge/201192
Your team OpenERP Community Backports Team is subscribed to branch
lp:ocb-addons/6.1.
--
Indeed, it covers previous cases, but it fails if a close bracket exists in
'default_code' or 'name'.
re.compile('(\[([^]]+)\]?)').search('[Code[A][B][C]] Product name').group(2)
'Code[A'
--
I'm getting following results:
re.compile('(\[(.*?)\]?)').search('[bla').group(1)
'['
re.compile('(\[(.*?)\]?)').search('[bla').group(2)
''
re.compile('(\[(.*?)\]?)').search('[bla] bob').group(1)
'['
re.compile('(\[(.*?)\]?)').search('[bla] bob').group(2)
''
Yes, letting postgres do that is simpler and faster I guess.
Concerning the regex:
import re
re.compile('(\[(.*?)\]?)').search('[bla')
_sre.SRE_Match object at 0x7f0be1590558
That seems to work for me.
Looks good otherwise!
--
Thank you for your advices.
There is no more duplicates since ids are filtered by postgresql.
I added a manual result reorder because OpenERP read function does not return
results in the ids order. This reordering is only necessary when a
concatenation exists (via classics_ids)
About the
Review: Needs Fixing
18: add spaces between operators
21: this seems to be one line too much
33: that's not safe against searching for ' / ' or the like, I'd wrap that
into an
if category_names:
33, 36: shouldn't strip(product_category_separator + ' ') be enough? (the space
just to be safe
Yann Papouin has proposed merging
lp:~yann-papouin/ocb-addons/6.1-bug-1267845-product-and-category-search-improved-usability
into lp:ocb-addons/6.1.
Requested reviews:
OpenERP Community Backports Team (ocb)
Related bugs:
Bug #1267845 in OpenERP Community Backports (Addons):
9 matches
Mail list logo