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
296679c3
Commit
296679c3
authored
Dec 01, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! pdm/trade: Support supply line for a product_line
Accept subcategories correctly
parent
c11b988c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyCell_asPredicate.xml
...lateItem/portal_skins/erp5_pdm/SupplyCell_asPredicate.xml
+3
-0
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyLine_asPredicate.xml
...lateItem/portal_skins/erp5_pdm/SupplyLine_asPredicate.xml
+3
-0
product/ERP5/tests/testResource.py
product/ERP5/tests/testResource.py
+14
-0
No files found.
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyCell_asPredicate.xml
View file @
296679c3
...
@@ -67,6 +67,9 @@ if context.getDestination():\n
...
@@ -67,6 +67,9 @@ if context.getDestination():\n
base_category_tuple += (\'destination\',)\n
base_category_tuple += (\'destination\',)\n
\n
\n
if context.hasProductLine():\n
if context.hasProductLine():\n
category_list = context.getCategoryList() + [\n
pl.getRelativeUrl() for pl in context.getProductLineValue().getCategoryChildValueList()]\n
context = context.asContext(categories=category_list)\n
base_category_tuple += (\'product_line\', )\n
base_category_tuple += (\'product_line\', )\n
\n
\n
if context.getParentValue().getParentValue().getPortalType() in (\n
if context.getParentValue().getParentValue().getPortalType() in (\n
...
...
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyLine_asPredicate.xml
View file @
296679c3
...
@@ -69,6 +69,9 @@ if context.getDestination():\n
...
@@ -69,6 +69,9 @@ if context.getDestination():\n
base_category_tuple += (\'destination\',)\n
base_category_tuple += (\'destination\',)\n
\n
\n
if context.hasProductLine():\n
if context.hasProductLine():\n
category_list = context.getCategoryList() + [\n
pl.getRelativeUrl() for pl in context.getProductLineValue().getCategoryChildValueList()]\n
context = context.asContext(categories=category_list)\n
base_category_tuple += (\'product_line\', )\n
base_category_tuple += (\'product_line\', )\n
\n
\n
if context.getParentValue().getPortalType() in (\n
if context.getParentValue().getPortalType() in (\n
...
...
product/ERP5/tests/testResource.py
View file @
296679c3
...
@@ -192,6 +192,9 @@ class TestResource(ERP5TypeTestCase):
...
@@ -192,6 +192,9 @@ class TestResource(ERP5TypeTestCase):
product_line
.
newContent
(
product_line
.
newContent
(
id
=
'a'
,
id
=
'a'
,
portal_type
=
'Category'
)
portal_type
=
'Category'
)
product_line
.
a
.
newContent
(
id
=
'a1'
,
portal_type
=
'Category'
)
if
product_line
.
_getOb
(
'b'
,
None
)
is
None
:
if
product_line
.
_getOb
(
'b'
,
None
)
is
None
:
product_line
.
newContent
(
product_line
.
newContent
(
id
=
'b'
,
id
=
'b'
,
...
@@ -1092,6 +1095,9 @@ class TestResource(ERP5TypeTestCase):
...
@@ -1092,6 +1095,9 @@ class TestResource(ERP5TypeTestCase):
resource_a
=
self
.
portal
.
getDefaultModule
(
self
.
product_portal_type
)
\
resource_a
=
self
.
portal
.
getDefaultModule
(
self
.
product_portal_type
)
\
.
newContent
(
portal_type
=
self
.
product_portal_type
)
.
newContent
(
portal_type
=
self
.
product_portal_type
)
resource_a
.
setProductLineValue
(
self
.
portal
.
portal_categories
.
product_line
.
a
)
resource_a
.
setProductLineValue
(
self
.
portal
.
portal_categories
.
product_line
.
a
)
resource_a_1
=
self
.
portal
.
getDefaultModule
(
self
.
product_portal_type
)
\
.
newContent
(
portal_type
=
self
.
product_portal_type
)
resource_a_1
.
setProductLineValue
(
self
.
portal
.
portal_categories
.
product_line
.
a
.
a1
)
resource_b
=
self
.
portal
.
getDefaultModule
(
self
.
product_portal_type
)
\
resource_b
=
self
.
portal
.
getDefaultModule
(
self
.
product_portal_type
)
\
.
newContent
(
portal_type
=
self
.
product_portal_type
)
.
newContent
(
portal_type
=
self
.
product_portal_type
)
resource_b
.
setProductLineValue
(
self
.
portal
.
portal_categories
.
product_line
.
b
)
resource_b
.
setProductLineValue
(
self
.
portal
.
portal_categories
.
product_line
.
b
)
...
@@ -1105,6 +1111,14 @@ class TestResource(ERP5TypeTestCase):
...
@@ -1105,6 +1111,14 @@ class TestResource(ERP5TypeTestCase):
# resource_a is member of product_line/a, so our supply line applies.
# resource_a is member of product_line/a, so our supply line applies.
self
.
assertEqual
(
1000
,
sale_order_line
.
getPrice
())
self
.
assertEqual
(
1000
,
sale_order_line
.
getPrice
())
sale_order_line
=
self
.
portal
.
getDefaultModule
(
"Sale Order"
).
newContent
(
portal_type
=
'Sale Order'
).
newContent
(
portal_type
=
self
.
sale_order_line_portal_type
,
resource_value
=
resource_a_1
,
quantity
=
1
)
# resource_a_1 is member of product_line/a/a1, so our supply line applies.
self
.
assertEqual
(
1000
,
sale_order_line
.
getPrice
())
sale_order_line
=
self
.
portal
.
getDefaultModule
(
"Sale Order"
).
newContent
(
sale_order_line
=
self
.
portal
.
getDefaultModule
(
"Sale Order"
).
newContent
(
portal_type
=
'Sale Order'
).
newContent
(
portal_type
=
'Sale Order'
).
newContent
(
portal_type
=
self
.
sale_order_line_portal_type
,
portal_type
=
self
.
sale_order_line_portal_type
,
...
...
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