akretion / ooor

Odoo Ruby JSON client. Emulates ActiveRecord enough (as much as Mongoid; Implements ActiveModel) to make Rails development with an Odoo datastore straightforward
MIT License
198 stars 59 forks source link

like OpenERP save should include the loaded related models cascade by default #3

Closed rvalyi closed 14 years ago

rvalyi commented 14 years ago

In the following script provided by Joël Grand-Guillaume from CampToCamp:

a=ResPartnerAddress.find(:first) a.partner_id.supplier=true a.save a.partner_id.supplier -> false

a.save doesn't save the related partner address. OpenERP ORM is able do do it and that would be the default using the OpenERP client (change a sale order and it will save lines and all other many2one/one2many related records.

From now on, many2one loaded relation are cached in @loaded_relations. If those relations are many2one and one2many fields, let's give them to the OpenERP save method too.

rvalyi commented 14 years ago

see an ActiveRecord like library that does it optionnaly: http://www.themidnightcoders.com/fileadmin/docs/flexclient/weborb/data/ActiveRecord.html

Still, I think this should be the default for us in OOOR as OpenERP clients does it be default and OpenERP ORM supports it

rvalyi commented 14 years ago

fixed for the in line one2many relations in OOOR 1.2.0 (so it's iso-functionnal with the GTK client, see details in the up to date README).