Commit a7f22749 authored by Łukasz Nowak's avatar Łukasz Nowak

Fixup.

Correct condition, it shall be inverted.
Fix wrong name open_order.
No need to archive - some other magic does it already.
parent fb401801
......@@ -77,13 +77,13 @@ if portal.portal_activities.countMessageWithTag(tag) == 0:\n
title="ViFiB Open Order",\n
**kw)\n
if remove_id is not None:\n
if open_sale_order is not None:\n
if open_sale_order is None:\n
open_sale_order = previous_open_sale_order.Base_createCloneDocument(batch_mode=1)\n
open_sale_order.deleteContent(remove_id, **kw)\n
if add_kw is not None:\n
add_tag = add_kw.pop(\'tag\', None)\n
add_kw.update(kw)\n
if open_sale_order is not None:\n
if open_sale_order is None:\n
open_sale_order = previous_open_sale_order.Base_createCloneDocument(batch_mode=1)\n
open_sale_order.newContent(**add_kw)\n
if add_tag is not None:\n
......@@ -97,18 +97,17 @@ if portal.portal_activities.countMessageWithTag(tag) == 0:\n
need_update = True\n
break\n
if need_update:\n
if open_sale_order is not None:\n
if open_sale_order is None:\n
open_sale_order = previous_open_sale_order.Base_createCloneDocument(batch_mode=1)\n
for line in open_sale_order.contentValues(portal_type=\'Open Sale Order Line\'):\n
if line.getStopDate() < stop_date:\n
line.setStopDate(stop_date, **kw)\n
if previous_open_sale_order is not None and open_sale_order is not None:\n
previous_open_sale_order.setExpirationDate(now, **kw)\n
previous_open_sale_order.archive(**kw)\n
if open_sale_order is not None:\n
open_order.setEffectiveDate(now, **kw)\n
open_order.order(**kw)\n
open_order.validate(**kw)\n
open_sale_order.setEffectiveDate(now, **kw)\n
open_sale_order.order(**kw)\n
open_sale_order.validate(**kw)\n
elif remove_id is not None or add_kw is not None or stop_date is not None:\n
raise NotImplemnetedError(\'Person %s open sale order is already being modified\' % person.getPath())\n
......
605
\ No newline at end of file
606
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment