Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
erp5
Commits
6be8364d
Commit
6be8364d
authored
Sep 23, 2013
by
Gabriel Monnerat
Committed by
Sebastien Robin
Apr 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve code to generate movements for each Group Presence Period according to the period
parent
db19a367
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
18 deletions
+10
-18
bt5/erp5_calendar/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
...portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
+1
-1
product/ERP5/Document/PresencePeriod.py
product/ERP5/Document/PresencePeriod.py
+9
-17
No files found.
bt5/erp5_calendar/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
View file @
6be8364d
...
@@ -114,7 +114,7 @@ WHERE\n
...
@@ -114,7 +114,7 @@ WHERE\n
getSourceSectionUid[loop_item],\n
getSourceSectionUid[loop_item],\n
getSourceUid[loop_item],\n
getSourceUid[loop_item],\n
getResourceUid[loop_item],\n
getResourceUid[loop_item],\n
getInventoriatedQuantity[loop_item]
,\n
-(mov_item.getInventoriatedQuantity() or 0)
,\n
isCancellationAmount[loop_item],\n
isCancellationAmount[loop_item],\n
isAccountable[loop_item],\n
isAccountable[loop_item],\n
mov_item.getStopDate(),\n
mov_item.getStopDate(),\n
...
...
product/ERP5/Document/PresencePeriod.py
View file @
6be8364d
...
@@ -71,20 +71,6 @@ class PresencePeriod(Movement, PeriodicityMixin):
...
@@ -71,20 +71,6 @@ class PresencePeriod(Movement, PeriodicityMixin):
"""
"""
return
1
return
1
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getDestinationUid'
)
def
getDestinationUid
(
self
,
*
args
,
**
kw
):
"""
Return the destination uid
"""
# XXX Should be configurable via acquisition
destination_value
=
self
.
getParentValue
().
getDestinationValue
()
if
destination_value
is
not
None
:
destination_uid
=
destination_value
.
getUid
()
else
:
destination_uid
=
self
.
getParentUid
()
return
destination_uid
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getInventoriatedQuantity'
)
'getInventoriatedQuantity'
)
def
getInventoriatedQuantity
(
self
,
default
=
None
,
*
args
,
**
kw
):
def
getInventoriatedQuantity
(
self
,
default
=
None
,
*
args
,
**
kw
):
...
@@ -116,9 +102,15 @@ class PresencePeriod(Movement, PeriodicityMixin):
...
@@ -116,9 +102,15 @@ class PresencePeriod(Movement, PeriodicityMixin):
single destination.
single destination.
"""
"""
result
=
[]
result
=
[]
for
from_date
,
to_date
in
self
.
_getDatePeriodList
():
if
self
.
getDestinationUid
()
is
None
:
result
.
append
(
self
.
asContext
(
self
,
start_date
=
to_date
,
return
result
stop_date
=
from_date
))
group_calendar
=
self
.
getParentValue
()
presence_period_list
=
group_calendar
.
objectValues
(
portal_type
=
"Group Presence Period"
)
for
presence_period
in
presence_period_list
:
for
from_date
,
to_date
in
presence_period
.
_getDatePeriodList
():
if
from_date
.
greaterThanEqualTo
(
self
.
getStartDate
())
and
to_date
.
lessThanEqualTo
(
self
.
getStopDate
()
or
group_calendar
.
getStopDate
()):
result
.
append
(
self
.
asContext
(
self
,
start_date
=
to_date
,
stop_date
=
from_date
))
return
result
return
result
def
_getDatePeriodList
(
self
):
def
_getDatePeriodList
(
self
):
...
...
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