[Erp5-dev] Username lost when installing a Person object from bt5 file

Yoshinori Okuji yo at nexedi.com
Mon Jan 8 13:52:59 CET 2007


On Monday 08 January 2007 13:16, Ivan Tyagov wrote:
> I encountered the following bug:
> When a 'Person' object is contained inside a business template file and
> this Person object has set an username ('reference' property) after
> installing this bt5 file this properly is set to 'None' and thus it's
> not a valid ERP5 user. What happens is that in business template
> installation 'manage_afterClone()' is applied to every installed object
> including 'Person' which is fine.
> But the default behavior for 'Person' is to reset reference in
> 'Person_afteClone()'.
> Because manage_afterClone() --> Person_afterClone() chain is normally
> called when a Person object is copied/pasted and by exception when a
> business template is installed I would like to introduce this patch that
> will restore 'reference' when a 'Person' objects is installed from bt5
> file.
> Any ideas how this can be done in a more elegant way/place are welcome.

We need a generic solution. It is unmaintainable to work around for every 
specific case.

The first question is whether it is required to call manager_afterClone for an 
object copied from a business template. I guess this is not necessary. If I 
am correct, you can simply remove the calling. But I may be wrong.

If you cannot remove it, we need a way to bypass reseting properties (i.e. not 
to call a script specified by a portal type), by passing a parameter to the 
method, for example.

YO
-- 
Yoshinori Okuji, Nexedi CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org



More information about the Erp5-dev mailing list