Creating a development branch

You can create development branches directly from the browser. Click on the plus (+) button next to the development section. This will show two types of input. One is the branch to fork, and the other is the name of the development branch. After filling in the input, hit the Enter key.

This will create a new branch by forking the given branch, as shown in the following screenshot:

If you don't want to create a development branch from the user interface, you can create it directly from GitHub. If you add a new branch in the GitHub repository, Odoo.sh will create a new development branch automatically.

Branches in development are usually new feature branches. As an example, we will add a new field in the library.book model. Follow these steps to add a new HTML field in the books model:

  1. Increase the module version in the manifest file:
...
'version': '12.0.2',
...
  1. Add a new field in the library.book model:
...
color = fields.Integer()
description = fields.Html()

def make_available(self):
...
  1. Add a description field in the book's form view:
...
</group>
<notebook>
<page string="Description">
<field name="description"/>
</page>
</notebook>
</sheet>
...
  1. Push the changes in the feature branch by executing the following command in the Terminal:
git commit -am"Added book description"
git push origin feature-branch

This will create a new build on Odoo.sh. After a successful build, you can test this new feature by accessing the instance. You will be able to see a new HTML field in the book's form view. Note that this branch is the development branch, so the new feature is only available to this branch. Your production branch is not changed.

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

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