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

The purchase page tab on product pages now adds items inline.  Does anyone know how to open the form in a new window (pop up modal)?  This was the default in V13.  The advantages are more space to work from and most importantly, the product variants are limited to the product that is being edited. (i.e. you don't have to search through all product variants)

아바타
취소
베스트 답변

You need to remove the referenced tree view for the field.


Create your own View that inherits and overrides the base View:



<field name="seller_ids" position="replace">
<field name="seller_ids"
context="{'default_product_tmpl_id':context.get('product_tmpl_id',active_id), 'product_template_invisible_variant': True,}"
nolabel="1" attrs="{'invisible': [('product_variant_count','&gt;',1)]}"/>
</field>


The original View defines seller_ids with a context key of 'tree_view_ref':'purchase.product_supplierinfo_tree_view2'  so here we are removing this and keeping all other attributes of the field.

The popup Form View limits the selection of Variants to match those from the Product Template you are editing Vendor information for.

아바타
취소
작성자 베스트 답변

Thanks Ray!  This seems like a mistake by Odoo as it was working well in V13.  

UPDATE:

I tried this and it works well for products with only one variant. Once a product has multiple variants it reverts back to inline editing. I played with the attributes - changing the gt to lt - but it didn't work.

Any idea why?  Thanks for your help with this. 

UPDATE2

I have replaced the variant_seller_ids field as well, and now the form opens in a new window for products with variants.  But the variants are not passed in the context, so the variant field in the form is empty.  Here is what I have so far:

<field name="seller_ids" 
        context="{'default_product_tmpl_id':context.get('product_tmpl_id',active_id), 'product_template_invisible_variant': True,}" 
        nolabel="1" attrs="{'invisible': [('product_variant_count','&gt;',1)]}"/>
 <field name="variant_seller_ids" position="replace">
  <field name="variant_seller_ids" 
        context="{'default_product_tmpl_id':context.get('product_tmpl_id',active_id), 'product_template_invisible_variant': True,}" 
        nolabel="1" attrs="{'invisible': [('product_variant_count','&lt;',1)]}"/>
</field> 
아바타
취소
관련 게시물 답글 화면 활동
1
9월 21
2704
2
8월 24
1305
2
12월 23
2258
2
7월 23
7579
1
12월 22
2880