How to do it...

We write into the already existing records to demonstrate how to use cross-module references:

  1. Add a data file to your module manifest:
    'data': [ 
        'data/res_partner.xml', 
    ], 
  1. Change the name of our main company:
<record id="base.main_company" model="res.company"> 
    <field name="name">Packt publishing</field> 
</record> 
  1. Set our main company's partner as publisher:
<record id="book_cookbook" model="library.book"> 
    <field name="publisher_id" ref="base.main_partner" /> 
</record> 

On installation of this module, the company will be renamed and the book from the next recipe will be assigned to our partner. On subsequent updates of our module, only the publisher will be assigned, but the company's name will be left untouched.

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

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