yml one2many records not deleted on uninstall
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Wishlist
|
OpenERP's Framework R&D |
Bug Description
If a module's yml !record creates additional one2many related records,
like this example creates both a res.partner record and a related res.partner.
the related record is not given a module ref id (ir_model_
thus will not be deleted upon module uninstall.
-
!record {model: res.partner, id: res_partner_
address:
- city: paris
country_id: base.fr
name: Mark Johnson
street: 1 rue Rockfeller
type: invoice
zip: '75016'
name: Mark Johnson
-
When YamlInterpreter
it does the _create_record,
but fails to follow with a ir.model.data create/update,
like the parent record's process_record does properly.
___
class YamlInterpreter
# ...
def _eval_field(self, model, field_name, expression):
# ...
elif column._type == "one2many":
value = [(0, 0, self._create_
### Should be code here to create ir.model.data ... ###
# ...
def process_
...
id = self.pool.
### ... like this does correctly ###
___
I don't know if it's legal to create an ir.model.data with a blank ir_model_data.name,
If not, perhaps it could be an enumerated suffix could be added to the parent record's ir_model_data.name?
Or perhaps this could be handled using cascading deletes? Not?
Workaround: don't use the automatic one2many facility; created all !records individually and relate using module ref id's.
I volunteer to propose a patch, if assigned a mentor.
Hello,
Thanks for your support! It is a very good idea. Unfortunately prior to complexity of the problem, we will not consider it for current version. But we will definitely consider it as feature for future road maps.
Thanks.