Merging parties

35 views
Skip to first unread message

Albert Cervera i Areny

unread,
Feb 6, 2015, 6:42:53 AM2/6/15
to tryton-...@googlegroups.com
Yesterday we created our own version [1] of OpenLab's party_merge [2]
module. The module allows merging several parties into another one and
we improved it by:

- Validating records so we ensure related data and the target record
are all consistent
- Moving most of the logic to a MergeMixin

As it seems a pretty usual need, is there an interest on moving this
mixin somewhere else so it can be easily used to provide similar
functionality to other places such as Products?

Probably the wizard could also be generalized.

[1] https://bitbucket.org/nantic/trytond-party_merge
[2] https://github.com/openlabs/trytond-party-merge

--
Albert Cervera i Areny
Tel. 93 553 18 03
@albertnan
www.NaN-tic.com

Sharoon Thomas

unread,
Feb 6, 2015, 6:49:38 AM2/6/15
to Albert Cervera i Areny, tryton-...@googlegroups.com
Dear Albert,

On Fri, Feb 6, 2015 at 5:12 PM, Albert Cervera i Areny <alb...@nan-tic.com> wrote:
Yesterday we created our own version [1] of OpenLab's party_merge [2]
module. The module allows merging several parties into another one and
we improved it by:

- Validating records so we ensure related data and the target record
are all consistent
- Moving most of the logic to a MergeMixin

As it seems a pretty usual need, is there an interest on moving this
mixin somewhere else so it can be easily used to provide similar
functionality to other places such as Products?

Probably the wizard could also be generalized.

[1] https://bitbucket.org/nantic/trytond-party_merge
[2] https://github.com/openlabs/trytond-party-merge

Why don't you send a pull request to our repo ? I think the changes 
could live in one place unless you see the goals of the two diverging.
In addition, the module version can be bumped and a new version can
be released on PYPI.

PS: If the license is an issue, we are open to change.

Thanks & Regards
--
--
Sharoon Thomas
Openlabs Technologies & Consulting (P) Limited

w: http://www.openlabs.co.in
m: +1 813.793.6736 (OPEN) Extn. 200
t: @sharoonthomas

- We Win When our Customers Win

Albert Cervera i Areny

unread,
Feb 6, 2015, 7:22:32 AM2/6/15
to Sharoon Thomas, tryton-...@googlegroups.com
2015-02-06 12:49 GMT+01:00 Sharoon Thomas <sharoon...@openlabs.co.in>:
> Dear Albert,
>
> On Fri, Feb 6, 2015 at 5:12 PM, Albert Cervera i Areny <alb...@nan-tic.com>
> wrote:
>>
>> Yesterday we created our own version [1] of OpenLab's party_merge [2]
>> module. The module allows merging several parties into another one and
>> we improved it by:
>>
>> - Validating records so we ensure related data and the target record
>> are all consistent
>> - Moving most of the logic to a MergeMixin
>>
>> As it seems a pretty usual need, is there an interest on moving this
>> mixin somewhere else so it can be easily used to provide similar
>> functionality to other places such as Products?
>>
>> Probably the wizard could also be generalized.
>>
>> [1] https://bitbucket.org/nantic/trytond-party_merge
>> [2] https://github.com/openlabs/trytond-party-merge
>
>
> Why don't you send a pull request to our repo ? I think the changes
> could live in one place unless you see the goals of the two diverging.
> In addition, the module version can be bumped and a new version can
> be released on PYPI.

Ok with the pull request.

It was more that I needed it quickly and had to save it somewhere and
bitbucket it was just easier for me.

>
> PS: If the license is an issue, we are open to change.

No issue there.

>
> Thanks & Regards
> --
> --
> Sharoon Thomas
> Openlabs Technologies & Consulting (P) Limited
>
> w: http://www.openlabs.co.in
> m: +1 813.793.6736 (OPEN) Extn. 200
> t: @sharoonthomas
>
> - We Win When our Customers Win



Cédric Krier

unread,
Feb 6, 2015, 7:25:02 AM2/6/15
to tryton-...@googlegroups.com
On 06 Feb 12:42, Albert Cervera i Areny wrote:
> Yesterday we created our own version [1] of OpenLab's party_merge [2]
> module. The module allows merging several parties into another one and
> we improved it by:
>
> - Validating records so we ensure related data and the target record
> are all consistent
> - Moving most of the logic to a MergeMixin
>
> As it seems a pretty usual need, is there an interest on moving this
> mixin somewhere else so it can be easily used to provide similar
> functionality to other places such as Products?

I doubt about such functionality to be generalized. But any way, there
are some issue with the code:

- use SQL query
- wrong identification of table_query

and also about the real need, I don't think it exists because there are
possible cases:

- You have a lot of entry generated by many people (usually external
user like webshop). In such case you have to accept to have
duplicates and live with it.

- You don't have a lot of entry but user made a mistake. So you have
to manually merge both because valid data is on both sides.

Also you don't have to change the referencial all over the place. You
just have to deactivate the duplica. For example, on a posted invoice,
you can not change the party without breaking the integrity of the
history.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
Reply all
Reply to author
Forward
0 new messages