Community mailing list archives

community@mail.odoo.com

Re: Add data to Many2many using search in XML

by
Holger Brunn
- 06/02/2016 02:05:16
> it is not possible to use a 'search' in xml.

yes it is:
https://github.com/odoo/odoo/blob/9.0/openerp/tools/convert.py#L97

A syntax in the lines of



should do what you want.

But it's nearly never a good idea to do this. Better declare the records
in question in XML anyways, and write a pre-migration script that
creates the XML ids in question. An example can be found here:
https://github.com/OCA/OpenUpgrade/blob/8.0/addons/stock/migrations/8.0.1.1/post-migration.py#L488


-- 
Therp - Maatwerk in open ontwikkeling

Holger Brunn - Ontwerp en implementatie

mail: holger@therp.nl
web: http://therp.nl
phone: +31 (0)20 3093096