跳至內容
選單
此問題已被標幟

I have two different views on the same model purchase.order.shipment


view 1:
 <notebook><pagestring="Products"><fieldname="shipment_lines"attrs="{'readonly': [('state', '!=', 'draft')]}"widget="section_and_note_one2many"mode="tree">
<treecreate="false"string="Shipment Order Lines"editable="bottom"><fieldname="shipment_id"invisible="1"/><fieldname="product_id"readonly='1'force_save="1"/><fieldname="product_uom"invisible='1'force_save="1"/><fieldname="product_qty"readonly='1'force_save="1"/><fieldname="qty_received"readonly='1'force_save="1"/><fieldname="remaining_qty"readonly='1'force_save="1"/>
<fieldname="shipment_qty_received"required='1'force_save="1"/>
tree>field>page>notebook>

view 2: <pagestring="Assesment"name="assesment"><fieldname="shipment_lines"><treename="assesment"create="false"editable="bottom"><fieldname="shipment_id"invisible="1"/><fieldname="product_id"readonly='1'/><fieldname="hs_code"readonly='1'/><fieldname="shipment_qty_pieces"readonly='1'/><fieldname="product_qty"invisible="1"/><fieldname="price_unit"invisible="1"/><fieldname="net_weight"readonly='1'/><fieldname="price_subtotal"readonly='1'/><fieldname="mav"/><fieldname="assessable_value_bdt"/><fieldname="cd"/><fieldname="rd"/><fieldname="sd"/><fieldname="vat"/><fieldname="ait"/><fieldname="at"/><fieldname="psi"/><fieldname="total_duty_tax"/>tree>field>page>
but view 2 is overlaping view 1



For view 1 i was expecting this view:


頭像
捨棄
最佳答案

Hi, 

Here the issue is that in some cases we couldn't add multiple tree views for the same one2many field, When we add like that it will always overlap the first view. So try to add another one2many field with the same functionalities as the field 'shipment_lines' and add that one2many field to the second view.

Python:// Add the new one2many field

shipment_lines = fields.One2many( ) //Existing field
new_shipment_lines_ids = fields.One2many( ) // New field with same functionalioties of field 'shipment_lines'

XML View:

View 1

<record id="action_task_generation" model="ir.cron">
    <field name="name">Auto Task Generation</field>
    <field name="model_id" ref="model_crm_lead"/>
    <field name="state">code</field>
    <field name="code">model.action_generate_task()</field>
    <field name="interval_number">1</field>
    <field name="interval_type">days</field>
    <field name="numbercall">-1</field>
    <field name="active" eval="True"/>
    <field name="doall" eval="True"/>
</record>


View 2:

<pagestring="Assesment"name="assesment">

<fieldname="new_shipment_lines_ids">

<treename="assesment"create="false"editable="bottom">

<fieldname="shipment_id"invisible="1"/>

<fieldname="product_id"readonly='1'/>

<fieldname="hs_code"readonly='1'/>

<fieldname="shipment_qty_pieces"readonly='1'/>

<fieldname="product_qty"invisible="1"/>

<fieldname="price_unit"invisible="1"/>

<fieldname="net_weight"readonly='1'/>

<fieldname="price_subtotal"readonly='1'/>

<fieldname="mav"/>

<fieldname="assessable_value_bdt"/>

<fieldname="cd"/><fieldname="rd"/>

<fieldname="sd"/><fieldname="vat"/>

<fieldname="ait"/><fieldname="at"/>

<fieldname="psi"/><fieldname="total_duty_tax"/>tree>field>page>


Hope it helps

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
7月 25
1943
2
7月 23
1866
2
9月 23
5800
0
3月 23
2226
0
4月 22
3727