Creating a new field in the sale order model

At the top of the form, you can see that the Model Description for the sale.order model is Quotation. For the purposes of this chapter, we will refer to the model not the model description. Let's go ahead and start adding our custom fields to the sale.order model. Please be aware that it can be easy to accidently click Create and create an entirely new model. We don't want a new model, but instead we want to add fields to the existing model. Click Edit to edit the sale.order model, and then scroll to the bottom of the field list and click Add an Item:

In the preceding example, we have specified our Date Required custom field.

The x_ prefix is already specified in the Field Name, by default, to encourage the use of good naming conventions. We have filled in the other data required for the field, including setting the Field Name to x_daterequired, the Field Label to Date Required, and the Field Type to date.

Click on Save & New to finish adding a new field to the sale.order model and proceed to enter the remaining x_rush field:

x_rush field

You should notice that this field is very similar to the date required field, except that we specified the field type as Boolean. This will tell Odoo's framework to display the field as a checkbox.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.79.20