Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
d2c17920
Commit
d2c17920
authored
Apr 08, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove not used InventoryBrain
parent
5ee20444
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
57 deletions
+3
-57
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Base_zGetNotGroupedMovementList.xml
...skins/erp5_accounting/Base_zGetNotGroupedMovementList.xml
+3
-1
product/ERP5/Extensions/InventoryBrain.py
product/ERP5/Extensions/InventoryBrain.py
+0
-56
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Base_zGetNotGroupedMovementList.xml
View file @
d2c17920
...
@@ -38,7 +38,7 @@ at_date</string> </value>
...
@@ -38,7 +38,7 @@ at_date</string> </value>
</item>
</item>
<item>
<item>
<key>
<string>
class_name_
</string>
</key>
<key>
<string>
class_name_
</string>
</key>
<value>
<string>
Inventory
Brain
</string>
</value>
<value>
<string>
MovementHistoryList
Brain
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
connection_hook
</string>
</key>
<key>
<string>
connection_hook
</string>
</key>
...
@@ -85,6 +85,7 @@ XXX now that grouping_date exists, this script will become useless.\n
...
@@ -85,6 +85,7 @@ XXX now that grouping_date exists, this script will become useless.\n
mirror_section.relative_url as mirror_section_relative_url,\n
mirror_section.relative_url as mirror_section_relative_url,\n
mirror_section.title as mirror_section_title,\n
mirror_section.title as mirror_section_title,\n
stock.date as date,\n
stock.date as date,\n
stock.node_uid as node_uid,\n
IFNULL(stock.total_price, 0) as total_price,\n
IFNULL(stock.total_price, 0) as total_price,\n
IFNULL(stock.quantity, 0) as total_quantity\n
IFNULL(stock.quantity, 0) as total_quantity\n
\n
\n
...
@@ -115,6 +116,7 @@ XXX now that grouping_date exists, this script will become useless.\n
...
@@ -115,6 +116,7 @@ XXX now that grouping_date exists, this script will become useless.\n
mirror_section.relative_url as mirror_section_relative_url,\n
mirror_section.relative_url as mirror_section_relative_url,\n
mirror_section.title as mirror_section_title,\n
mirror_section.title as mirror_section_title,\n
stock.date as date,\n
stock.date as date,\n
stock.node_uid as node_uid,\n
IFNULL(stock.total_price, 0) as total_price,\n
IFNULL(stock.total_price, 0) as total_price,\n
IFNULL(stock.quantity, 0) as total_quantity\n
IFNULL(stock.quantity, 0) as total_quantity\n
\n
\n
...
...
product/ERP5/Extensions/InventoryBrain.py
View file @
d2c17920
...
@@ -47,62 +47,6 @@ class ComputedAttributeGetItemCompatibleMixin(ZSQLBrain):
...
@@ -47,62 +47,6 @@ class ComputedAttributeGetItemCompatibleMixin(ZSQLBrain):
return
item
.
__of__
(
self
)
return
item
.
__of__
(
self
)
return
item
return
item
class
InventoryBrain
(
ZSQLBrain
):
"""
Global analysis (all variations and categories)
"""
# Stock management
def
getInventory
(
self
,
at_date
=
None
,
ignore_variation
=
0
,
simulation_state
=
None
,
**
kw
):
if
isinstance
(
simulation_state
,
str
):
simulation_state
=
[
simulation_state
]
result
=
self
.
Resource_zGetInventory
(
resource_uid
=
[
self
.
resource_uid
],
to_date
=
at_date
,
omit_simulation
=
0
,
section_category
=
self
.
getPortalDefaultSectionCategory
(),
simulation_state
=
simulation_state
)
inventory
=
None
if
len
(
result
)
>
0
:
inventory
=
result
[
0
].
inventory
if
inventory
is
None
:
return
0.0
else
:
return
inventory
def
getCurrentInventory
(
self
):
return
self
.
getInventory
(
simulation_state
=
self
.
getPortalCurrentInventoryStateList
(),
ignore_variation
=
1
)
def
getFutureInventory
(
self
):
return
self
.
getInventory
(
ignore_variation
=
1
,
simulation_state
=
\
list
(
self
.
getPortalFutureInventoryStateList
())
+
\
list
(
self
.
getPortalReservedInventoryStateList
())
+
\
list
(
self
.
getPortalCurrentInventoryStateList
()))
def
getAvailableInventory
(
self
):
current
=
self
.
getCurrentInventory
()
result
=
self
.
Resource_zGetInventory
(
resource_uid
=
[
self
.
resource_uid
],
ignore_variation
=
1
,
omit_simulation
=
1
,
omit_input
=
1
,
section_category
=
self
.
getPortalDefaultSectionCategory
(),
simulation_state
=
\
self
.
getPortalReservedInventoryStateList
())
reserved_inventory
=
None
if
len
(
result
)
>
0
:
reserved_inventory
=
result
[
0
].
inventory
if
reserved_inventory
is
None
:
reserved_inventory
=
0.0
return
current
+
reserved_inventory
def
getQuantityUnit
(
self
,
**
kw
):
resource
=
self
.
portal_catalog
.
getObject
(
self
.
resource_uid
)
if
resource
is
not
None
:
return
resource
.
getQuantityUnit
()
class
InventoryListBrain
(
ComputedAttributeGetItemCompatibleMixin
):
class
InventoryListBrain
(
ComputedAttributeGetItemCompatibleMixin
):
"""
"""
Lists each variation
Lists each variation
...
...
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