← Back to team overview

openupgrade-drivers team mailing list archive

Policy for deleted views of renamed modules ?

 

Hi,

I was wondering exactly how to deal correctly in pre-migrations.py script with deleted views that inherits other views.

For example:

- "google_base_account" module has created a view
"res.users.google.form1" which uses the "gmail_user" field
- Meanwhile, in the current evolution of the code, this view gets removed and the module "google_base_account" is renamed to "google_account". - When launching the migration process, it fails while processing the "knowledge" module with this error:

ParseError: "ValidateError
The field(s) `arch` failed against a constraint: Invalid view definition

Error details:
Field `gmail_user` does not exist

Error context:
View `res.users.groups`
[view_id: 159, xml_id: base.user_groups_view, model: res.users, parent_id: 156]" while parsing /home/vaab/dev/python/0k-o
e/addons/knowledge/security/knowledge_security.xml:5, near
<record id="base.group_document_user" model="res.groups">
        <field name="name">User</field>
<field name="category_id" ref="base.module_category_knowledge_management"/>
        <field name="users" eval="[(4, ref('base.user_root'))]"/>
    </record>


Not to be mistaken, the only view that actually mention gmail_user field in its arch is the "google_base_account" one.

I can remove it by hand, but if I want to put it in the migration script, where can I do it ? in which module ? Why the hell this bogus view gets loaded if its module is not loaded yet ?

I feel I'm missing something...

I have to add that I'm on code that is a merge between saas-3 and openupgrade/trunk ...

--
Valentin LAB
Ingénieur Développement

tel:  +33 6 71 39 62 13
mail: valentin.lab@xxxxxxxxxxx


Follow ups