India

ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171

   .

ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254

  UAE

Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466

  Germany​

ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

Reply to comment

Contact Form


sahya's picture

Reference field in Odoo

Reference field in Odoo can be used for storing an arbitrary reference to a model.

This field allows us to select a model and adding a reference to that model. Reference fields are mainly used for showing different model's records as reference in your record.

For example, if you have a model contains various fields and if the records of that model are created from existing models such as Sales order, Purchase Order, Invoice, Project, Voucher etc. and if you need a reference of the model from which your record has been created in your model, then you can use a field of type reference which stores a link to the model from which your record is created.

Reference field stores both the model name and the selected reference id. Reference field have a selection list which is a list of tuples with model and name and list of records of the selected model.

Second area of reference field allows us to select a record of the selected model.

Reference field act like a many2one to the model selected. 

In the db reference field stores both the model name and the id of the record selected. 

<model name>,id

For the above example reference field value will be ‘sale.order,<id>’

We can access the data of a reference field as like from normal many2one field.

For example:  ‘field_name.name’ can be used for getting the name of the record selected if field_name is the name of field of type reference.

A reference field can be declared as below.

Above declaration allows us to select models that have added as referencable models. We can also modify the selection of reference field to select the models as per our requirement.

Referencable Models can be added using the menu Settings -> Technical -> Database Structure -> Referencable Models. We can also give the priority of the model in the reference selection. 

We can also define the list of models in the reference selection.

Above function lists all the models in the selection of reference rather than the models added in Referenceable Models menu.

Hope my presentation was usefull for you . 

Thank you

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo], [[foo]]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.