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
Xiaowu Zhang
erp5
Commits
b044d0bc
Commit
b044d0bc
authored
Jun 14, 2021
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade&core: use can define ceiling for a sale trade model line
parent
ae9dab7d
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
363 additions
and
8 deletions
+363
-8
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.TradeModelLine.py
...ateItem/portal_components/document.erp5.TradeModelLine.py
+1
-1
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.TradeModelLine.xml
...teItem/portal_components/document.erp5.TradeModelLine.xml
+24
-3
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewAggregatedAmountList.xml
...al_skins/erp5_trade/Delivery_viewAggregatedAmountList.xml
+1
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewAggregatedAmountList/listbox.xml
.../erp5_trade/Delivery_viewAggregatedAmountList/listbox.xml
+4
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewAggregatedAmountList/listbox_ceiling.xml
...ade/Delivery_viewAggregatedAmountList/listbox_ceiling.xml
+115
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view.xml
...plateItem/portal_skins/erp5_trade/TradeModelLine_view.xml
+1
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_ceiling.xml
...ortal_skins/erp5_trade/TradeModelLine_view/my_ceiling.xml
+178
-0
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.AmountGeneratorMixin.py
...Item/portal_components/mixin.erp5.AmountGeneratorMixin.py
+15
-1
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.AmountGeneratorMixin.xml
...tem/portal_components/mixin.erp5.AmountGeneratorMixin.xml
+24
-3
No files found.
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.TradeModelLine.py
View file @
b044d0bc
...
...
@@ -61,7 +61,7 @@ class TradeModelLine(AmountGeneratorLine):
return
result
# If quantity is defined, then tax works as transformed resource
if
self
.
_baseGetQuantity
(
None
)
is
not
None
:
return
(
'quantity'
,
'price'
,
'step'
)
return
(
'quantity'
,
'price'
,
'step'
,
'ceiling'
)
# Else tax provides only a ratio on amount
return
(
'price'
,)
...
...
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.TradeModelLine.xml
View file @
b044d0bc
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
TradeModelLine
</string>
</value>
...
...
@@ -53,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -72,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -81,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewAggregatedAmountList.xml
View file @
b044d0bc
...
...
@@ -97,6 +97,7 @@
<string>
listbox_quantity
</string>
<string>
listbox_base_contribution_title_list
</string>
<string>
listbox_use_title_list
</string>
<string>
listbox_ceiling
</string>
</list>
</value>
</item>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewAggregatedAmountList/listbox.xml
View file @
b044d0bc
...
...
@@ -106,6 +106,10 @@
<string>
total_price
</string>
<string>
Amount
</string>
</tuple>
<tuple>
<string>
ceiling
</string>
<string>
Ceiling
</string>
</tuple>
<tuple>
<string>
base_contribution_title_list
</string>
<string>
Base Contribution
</string>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewAggregatedAmountList/listbox_ceiling.xml
0 → 100644
View file @
b044d0bc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
default
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox_ceiling
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_view_mode_listbox_read_only_price
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewTradeFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: cell.getProperty(\'ceiling\', \'\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view.xml
View file @
b044d0bc
...
...
@@ -104,6 +104,7 @@
<string>
my_resource_title
</string>
<string>
my_price
</string>
<string>
my_quantity
</string>
<string>
my_ceiling
</string>
<string>
my_trade_phase
</string>
<string>
my_use
</string>
</list>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_ceiling.xml
0 → 100644
View file @
b044d0bc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
css_class
</string>
<string>
default
</string>
<string>
display_width
</string>
<string>
input_style
</string>
<string>
precision
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_ceiling
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
input_style
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
precision
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string>
figure
</string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<int>
20
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_float_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
input_style
</string>
</key>
<value>
<string>
-1 234.5
</string>
</value>
</item>
<item>
<key>
<string>
precision
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Ceiling
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: preferences.getPreference(\'preferred_money_quantity_field_width\', 10)
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: preferences.getPreference(\'preferred_money_quantity_style\', \'-1 234.5\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
here/getPricePrecision
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.AmountGeneratorMixin.py
View file @
b044d0bc
...
...
@@ -510,6 +510,20 @@ class AmountGeneratorMixin:
applicable to payroll, tax generation and BOMs. Return the
list of amounts with aggregation.
"""
return
self
.
getGeneratedAmountList
(
*
args
,
**
kw
).
aggregate
()
amount_list
=
self
.
getGeneratedAmountList
(
*
args
,
**
kw
).
aggregate
()
# adjust sm according to ceiling
if
self
.
getPortalType
()
==
'Simulation Movement'
:
explanation_value
=
self
.
getExplanationValue
()
if
explanation_value
.
getPortalType
()
in
(
'Sale Order'
,
'Sale Packing List'
,
'Sale Invoice Transaction'
):
explanation_amount_list
=
explanation_value
.
getAggregatedAmountList
()
for
explanation_amount
in
explanation_amount_list
:
ceiling
=
explanation_amount
.
getProperty
(
'ceiling'
,
None
)
if
ceiling
and
ceiling
<
explanation_amount
.
getTotalPrice
():
for
amount
in
amount_list
:
if
amount
.
getProperty
(
'resource'
)
==
explanation_amount
.
getProperty
(
'resource'
):
amount
.
edit
(
quantity
=
((
amount
.
getQuantity
()
/
explanation_amount
.
getQuantity
())
*
ceiling
)
/
amount
.
getPrice
()
)
return
amount_list
InitializeClass
(
AmountGeneratorMixin
)
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.AmountGeneratorMixin.xml
View file @
b044d0bc
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
AmountGeneratorMixin
</string>
</value>
...
...
@@ -53,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -72,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -81,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
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