콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4354 화면

I have a schema:

tnij.org/schema1

There are not all tables included in that project, but this should be enough.

I have a problem. I want to make that user can choose an attribute and then choose value (connected with attribue).

For example Color: Red, Blue, Green, Yellow Size: 21, 22, 23, 24.

How can I do this with that schema? By now I added third function field to product_attribute_value that gives me all releated_attributes connected with value in which I am,. Problem is that in OpenErp cant make domain="[('related_attributes','=',attribute_id)] "lists"="int"

Have you any idea how to solve it?

아바타
취소
베스트 답변

Try this


SELECT
PP.ID,
PP.NAME_TEMPLATE,
STRING_AGG(AV.NAME, ' ' ORDER BY AV.ATTRIBUTE_ID) ATT
FROM
PRODUCT_PRODUCT PP
INNER JOIN PRODUCT_TEMPLATE PT ON PP.PRODUCT_TMPL_ID = PT.ID
LEFT JOIN PRODUCT_ATTRIBUTE_VALUE_PRODUCT_PRODUCT_REL PR ON PP.ID = PR.PROD_ID
LEFT JOIN PRODUCT_ATTRIBUTE_VALUE AV ON PR.ATT_ID = AV.ID
WHERE
PP.ACTIVE = TRUE
GROUP BY PP.ID, PP.NAME_TEMPLATE
ORDER BY PP.NAME_TEMPLATE

아바타
취소
관련 게시물 답글 화면 활동
2
6월 15
3970
0
9월 24
1508
2
5월 24
9655
1
4월 23
5474
7
4월 23
19501