官术网_书友最值得收藏!

  • Odoo Development Cookbook
  • Holger Brunn Alexandre Fayolle Daniel Reis
  • 366字
  • 2021-07-16 11:00:31

Applying changes to addons

Most addons available on GitHub are subject to change and do not follow the rules that Odoo enforces for its stable release. They may receive bug fixes or enhancements, including issues or feature requests that you submitted, and these changes may introduce database schema changes or updates in the data files and views. This recipe explains how to install the updated versions.

Getting ready

Suppose you reported an issue with partner_address_street3 and received a notification that the issue was solved in the lasted revision of the 9.0 branch of the partner-contact project, you will want to update your instance with this latest version.

How to do it…

To apply a source modification to your addon from GitHub, you need to perform the following steps:

  1. Stop the instance using that addon.
  2. Make a backup if it is a production instance (see the recipe Manage Odoo server databases in Chapter 1, Installing the Odoo Development Environment).
  3. Go to the directory where partner-contact was cloned:
    $ cd ~/odoo-dev/my-odoo/src
    
  4. Create a local tag for the project so that you can revert to that version in case things break:
    $ git checkout 9.0
    $ git tag 9.0-before-update-$(date --iso)
    
  5. Get the latest version of the source code:
    $ git pull --ff-only
    
  6. Update the partner_address_street3 addon in your databases (see previous recipe Install and upgrade local addon modules).
  7. Restart the instance.

How it works…

This is just a simple application of all the previous recipes we've seen; we get a new version of the addon and we update it in our instances.

If git pull --ff-only fails, you can revert to the previous version using this command:

$ git reset --hard 9.0-before-update-$(date --iso)

Then, you can try git pull (without --ff-only), which will cause a merge, but this means you have local changes on the addon.

Note

There is an entry in the Settings menu labeled Upgrade modules, but it does not work for our purpose.

See also

If the update step breaks, refer to the Updating Odoo from Source recipe in Chapter 1, Installing the Odoo Development Environment, for the recovery instructions. Remember to always test an update on a copy of a database production first.

主站蜘蛛池模板: 城市| 屯门区| 塔城市| 双牌县| 磐石市| 高安市| 惠来县| 长葛市| 丁青县| 隆昌县| 大同市| 衡东县| 原阳县| 内乡县| 陈巴尔虎旗| 南昌市| 调兵山市| 基隆市| 太康县| 扬中市| 沭阳县| 镇江市| 阜平县| 镇江市| 定远县| 洛阳市| 合水县| 新源县| 黔西| 龙游县| 梁山县| 同江市| 凤翔县| 咸宁市| 常熟市| 阳泉市| 濮阳市| 婺源县| 彰化县| 邓州市| 翁源县|