I have an 'election' model with 3 different one2many fields to other relatet model 'member'. The difference between those One2Many fields is that each of them has a different domain. The problem is that, when I tried to delete one member from one of the one2many fields using the election form (using the tree list) the aparently deleted record shows again when I click the 'save' button from the election form. Perhaps it has something to do with the fact that there are 2 different one2many relations and when you delete an element (member) from one, The reference is intact in the other One2many fields. I am working with Odoo 17
member_ids = fields.One2many('elections.member', 'election_id', string='Members', domain=[('is_observer','=', False )])
observer_ids = fields.One2many('elections.member', 'election_id', string='Observers', domain=[('is_observer','=', True ), ('is_candidate','=', False )])
all_member_ids = fields.One2many('elections.member', 'election_id', string='All members (including observers and candidates)')
<notebook>
<page name="members" string="Members">
<field name="member_ids" readonly='state != "draft"' domain="[('is_observer','=', False ), ('is_candidate','=', False )]" context="{'default_is_observer': 0, 'default_is_candidate': 0, 'from_o2m': 1}">
<tree>
<field name="name" />
<field name="specialty_certificate" />
<field name="membership_status" />
<field name="is_candidate" />
<button name="action_send_email_with_qr_code" type="object" string="Email with QR"
invisible="membership_status!='college'"
icon="fa-envelope"/>
<button name="viixoo_cmim_elections.small_qr_report" type="action" string="Print QR"
invisible="membership_status != 'college'"
icon="fa-print"/>
</tree>
</field>
</page>
<page name="observers" string="Observers">
<field name="observer_ids" readonly='state != "draft"' string="Observer" domain="[('is_observer','=', True ), ('is_candidate','=', False )]" context="{'default_is_observer': 1, 'default_is_candidate': 0, 'from_o2m': 1}">
<tree>
<field name="name" />
<field name="specialty_certificate" />
<field name="membership_status" />
<field name="is_president" />
<button name="action_send_email_with_qr_code" type="object" string="Email with QR"
invisible="membership_status!='college'"
icon="fa-envelope"/>
<button name="viixoo_cmim_elections.small_qr_report" type="action" string="Print QR"
invisible="membership_status!='college'"
icon="fa-print"/>
</tree>
</field>
</page>
</notebook>
could you clarify your action of "trying to delete" one member from the field...
Do you mean "DELETE MEMBER" or do you mean "UNLINK MEMBER FROM FIELD"?