Skip to Content
Menú
This question has been flagged

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:


Avatar
Descartar
Best Answer

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

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de jul. 25
1931
2
de jul. 23
1850
2
de set. 23
5779
0
de març 23
2213
0
d’abr. 22
3719