This question has been flagged
1 Reply
949 Views

Hey! In previous versions of odoo our collateral.owner model looked like this:


but now, in version 16. our view is showing additional records, i guess from base collateral.owner:


how do we limit so that only the three fields are showing?

this is the ir.ui.view:


<?xml version="1.0" encoding="UTF-8"?>
<
odoo>
<
record model="ir.ui.view" id="collateral_owner_list">
<
field name="name">Ägare</field>
<
field name="model">collateral.owner</field>
<
field name="arch" type="xml">
<
tree default_order="shares">
<
field name="name"/>
<
field name="shares" widget="percentage"/>
<
/tree>
<
/field>
<
/record>
<
/odoo>

model: 

class Owner(models.Model):
_name = "collateral.owner"
_description = "Owner who owns a collateral"
_inherit = ["mail.thread", "mail.activity.mixin"]

collateral_id = fields.Many2one("collateral.collateral")
name = fields.Char(string="Namn", required=True, tracking=True)
shares = fields.Float(string="Andel", required=True, tracking=True)

Avatar
Discard
Best Answer

You need to create a form view for this model, the view you mentioned is a tree view.
As you did not create any form view, so it is defaulting to a generic form that includes all the field in model. This model also inherits mail.thread and mail.activity fields too so those fields are also present in the default form view


Thanks & Regards, 

 

Brain Station 23 Ltd. 

Mobile: (+880) 1404055226 

Email: sales@brainstation-23.com 

Web: https://brainstation-23.com/ 

Address: (Building-1) 8th Floor, 2 Bir Uttam AK Khandakar Road, Mohakhali C/A, Dhaka 1212, Bangladesh 

Avatar
Discard