On 2017-09-26 17:34, Jon Levy wrote: > We use the trytonspain's party_communication module, which basically uses > Addresses to model individuals associated with the Party, and makes Contact > Mechanism many2one on Addresses. (party_relationship may be the more > recommended solution, but we found it not as helpful.) > > Now we want to be able to move Addresses from one Party to another. Digging > into the Party module, there is an odd implementation for preventing changing > an Address's, or Contact Mechanism's, Party. Instead of just making the > field readonly, there are UserError calls in overwritten write methods.[1] > If this a legacy implementation (something that today would just be handled > with readonly)? > > Is anyone aware of traps lurking if I allow change of the Addresses' party > field (by making it read/write and removing the hooks in the overridden write > methods)? (This would also involve overloading Address's write to ensure > that all of the Address's Contact Mechanisms move along with it.)
This is there on purpose to keep the data integrity. Everywhere there is a constraint on address Many2One to be linked to a specific party. So we manage the address has been part of the party. We could not use 'readonly' attribute because it is not yet an enforced constraint [1]. I really think that you should use the party_relationship module and never use an address as a party. [1] https://bugs.tryton.org/issue4207 -- Cédric Krier - B2CK SPRL Email/Jabber: [email protected] Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ -- You received this message because you are subscribed to the Google Groups "tryton" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/20170927063117.GA3626%40kei.
