Odoo attrs x2many Types of filtering

Source: Internet
Author: User

There are children's shoes in the group asked the attrs in the Many2many type of field how to do domain filtering, in fact, very simple:

The Many2many field gets the value in JS in the format [[6,false,[]].

So the judgment of Many2many in Attrs can be written in the following format:

attrs="{' Invisible ': [(' category_id ', ' = ', [[6, False, []]]]}".

The various meanings of Many2many are as follows:

Domain calculations are calculated in the Compute_domain method of the View_form.js.

(0,0,{}): Create a new record

(1,id,{}): Record of update ID

(2,id): The object of the cascade delete ID

(3,id): Deleting relationships between objects and not deleting associated objects

(4,id): Add an association relationship

(5,id): Delete all

(6,?, IDs): Delete all associated relationships and associate records of IDs. Equivalent to performing 5 first, in loop execution 4.

Odoo attrs x2many Types of filtering

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.