コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
4145 ビュー

using Odoo 13 Community, can someone tell me why this is not working?


<page string="Servicios">
<field name="servicios" context="{'default_albaran': active_id}">
      <tree editable="bottom">
          <field name="prenda" domain="[('albaran','=',default_albaran)]"/>
      </tree>
    </field>
</page>


I get an error saying that 'default_albaran' that is used in the attributes must be present in the view, and it's not...

アバター
破棄
著作者 最善の回答

got it working, took out the context and just referenced the parent.id of the form:


<page string="Servicios">
<field name="servicios" options='{"no_open": True}'>
<tree editable="bottom">
<!-- <field name="prenda" options="{'no_quick_create':True,'no_create_edit':True,'no_open': True,}"/>-->
<field name="prenda" domain="[('albaran','=', parent.id)]"/>
<field name="product_category"/>
<field name="servicio" domain="[('categ_id', '=' , product_category)]" options="{'no_quick_create':True,'no_create_edit':True,'no_open': True,}"/>
<field name="cantidad"/>
</tree>
</field>
</page>
アバター
破棄

Hi Asis,

Make sure "albaran" field is present at your module. If yes then firstly restart your Odoo server then upgrade your module after that check .

Thanks

最善の回答

Hi, Asis

You are getting this issue because "default_albaran" is not present inside your view. Kindly add it on your view. If you don't want to show that field in your view then you can make this field invisible like below code,

<page string="Servicios">
<field name="servicios" context="{'default_albaran': active_id}">
      <tree editable="bottom">
          <field name="default_albaran" invisible="1"/>
          <field name="prenda" domain="[('albaran','=',default_albaran)]"/>
      </tree>
    </field>
</page>

Feel free to ask in case you have any doubt related to the above point.


Thanks,
Ashish Singh (Team Lead)
Webkul Software Private Limited


アバター
破棄
最善の回答

[Edited] Your domain should be something like this:

domain="[('albaran','=', active_id)]"/>

The "default_" is part of the syntax for the Context (there's no field default_albaran). 

(More on Context)

アバター
破棄