Discussion:
[Erp5-dev] MovementGroup - stopped by more complicated problem
Łukasz Nowak
2007-01-23 11:58:41 UTC
Permalink
Hello,

I've made some movement groups myself, for properties/values associated
to Sale Order (eg. incoterm, shipper, etc). They are working fine, I've
even made test for them ;)

But I do not have idea how to create movement group, which will split
deliveries (sale_packing_list_builder) if order has different
default_payment_condition_* values, eg. trade_date, payment_mode,
payment_term.

I cannot find any documentation related to MovementGroups nor example
which will be more complicated (like mine).

Code, which is attached, works only if builder is invoked for many Sale
Orders. But when I'll try to glue more SPLs it won't work.

Well - all the time I'm trying to analyze code of
{Order,Delivery}Builder and MovementGroup modules, but without working
example similar to mine, I'm event not sure, if it is possible...

Thank in advance for any suggestions,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...''
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DefaultPaymentConditionMovementGroup.py
Type: text/x-python
Size: 3236 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20070123/f345857d/attachment.py>
Łukasz Nowak
2007-03-12 14:56:08 UTC
Permalink
Hello,

I'm responding to myself. Maybe someone in future will get on same path
as mine, and my response will solve her/his problem. Of course solution
provided by me is not perfect, but it (a) works, (b) it is easy, (c) it
is simple to unit test.
Post by Łukasz Nowak
Hello,
(...)

I modified ERP5 system to "glue" many Sale Order into one Sale Packing
List. But my Sale Packing List portal type hadn't TradeCondition
portal_type associated, as well Payment Condition in allowed content
types. So my MovementGroup class wasn't able to find
default_payment_condition_* on Sale Packing List, so it was reverting to
getCausality object. Well, I still do not understand MovementGroup
system good enough, but it was always splitting.

To solve it I added Trade Condition Property Sheet to Sale Packing List,
Payment Condition to allowed content type to Sale Packing List and
sale_packing_list_builder was instructed to copy Payment Condition
related values from Sale Order do Sale Packing List, and then Movement
Group was able to compare simulation movements.

I *think* that it is possible to resolved this issue without
coping/adding Payment Condition related values from Sale Order to Sale
Packing List, but I see that such simple solution is more generic and
easier to understand. Besides I've seen on MovementGroup class, that
other movement groups are using same scenario.

End of transmission,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...''
Loading...