Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hardik Juneja
slapos.core
Commits
ff40b534
Commit
ff40b534
authored
Mar 12, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set stop date according to start date.
It shall be extended always by one month.
parent
29f4194b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
19 deletions
+25
-19
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_updatePersonOpenOrder.xml
...m/portal_skins/vifib_slap/Alarm_updatePersonOpenOrder.xml
+1
-5
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Person_updateOpenOrder.xml
...teItem/portal_skins/vifib_slap/Person_updateOpenOrder.xml
+23
-13
master/bt5/vifib_slap/bt/revision
master/bt5/vifib_slap/bt/revision
+1
-1
No files found.
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_updatePersonOpenOrder.xml
View file @
ff40b534
...
...
@@ -57,7 +57,6 @@ if params is None:\n
kw = {}\n
\n
from DateTime import DateTime\n
from Products.ERP5Type.DateUtils import getNumberOfDayInMonth\n
\n
last_active_process = context.getLastActiveProcess()\n
if last_active_process is not None and params.get(\'full\', False):\n
...
...
@@ -67,12 +66,9 @@ if last_active_process is not None and params.get(\'full\', False):\n
# register active process in order to have "windows" of last indexed objects\n
context.newActiveProcess()\n
\n
now = DateTime()\n
params.setdefault(\'stop_date\', now + getNumberOfDayInMonth(now))\n
\n
context.getPortalObject().portal_catalog.searchAndActivate(\n
method_id=\'Person_storeOpenOrderJournal\',\n
method_kw={\'indexation_timestamp\': kw.get(\'indexation_timestamp\'), \'tag\': tag, \'stop_date\': params
[\'stop_date\']
},\n
method_kw={\'indexation_timestamp\': kw.get(\'indexation_timestamp\'), \'tag\': tag, \'stop_date\': params
.get(\'stop_date\')
},\n
activate_kw={\'tag\': tag, \'priority\': 10},\n
portal_type=\'Person\'\n
)\n
...
...
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Person_updateOpenOrder.xml
View file @
ff40b534
...
...
@@ -53,6 +53,7 @@
<value>
<string
encoding=
"cdata"
>
<![CDATA[
from DateTime import DateTime\n
from Products.ERP5Type.DateUtils import getNumberOfDayInMonth\n
\n
person = context\n
portal = person.getPortalObject()\n
...
...
@@ -114,19 +115,28 @@ for start_date_tuple in start_date_tuple_list:\n
line.setStartDate(start_date_tuple[1])\n
\n
if stop_date is not None:\n
# check if needed to update\n
need_update = False\n
order = previous_open_sale_order or open_sale_order\n
for line in order.contentValues(portal_type=\'Open Sale Order Line\'):\n
if line.getStopDate()
< stop_date:
\n
need_update =
True\n
break\n
if
need_update:\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,
activate_kw=
activate_kw)\n
next_month = stop_date\n
else:\n
next_month = DateTime() + getNumberOfDayInMonth(DateTime())\n
\n
order = previous_open_sale_order or open_sale_order\n
need_update = False\n
for line in order.contentValues(portal_type=\'Open Sale Order Line\'):\n
if line.getStopDate() is not None and line.getStopDate()
< next_month:
\n
need_update =
True\n
break\n
\n
if
need_update:\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
old_stop_date =
line.getStopDate()\n
if
old_stop_date
is
not
None
and
old_stop_date
<
next_month:\n
if
stop_date
is
not
None:\n
new_stop_date =
stop_date\n
else:\n
new_stop_date =
old_stop_date
+
getNumberOfDayInMonth(old_stop_date)
\n
line.setStopDate(new_stop_date,
activate_kw=
activate_kw)\n
\n
for
remove_hosting
in
remove_hosting_list:\n
if
remove_hosting
in
just_added_hosting_kw:\n
...
...
master/bt5/vifib_slap/bt/revision
View file @
ff40b534
633
\ No newline at end of file
634
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment