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
Carlos Ramos Carreño
slapos.core
Commits
934b0fe4
Commit
934b0fe4
authored
Nov 25, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: Include view tab for list related invoices
parent
bc076c3e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
667 additions
and
0 deletions
+667
-0
master/bt5/slapos_subscription_request/ActionTemplateItem/portal_types/Subscription%20Request/accounting_list.xml
...m/portal_types/Subscription%20Request/accounting_list.xml
+85
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_getRelatedAccountingTransactionList.py
...ubscriptionRequest_getRelatedAccountingTransactionList.py
+75
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_getRelatedAccountingTransactionList.xml
...bscriptionRequest_getRelatedAccountingTransactionList.xml
+62
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_viewAccountingTransactionList.xml
...est/SubscriptionRequest_viewAccountingTransactionList.xml
+137
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_viewAccountingTransactionList/listbox.xml
...criptionRequest_viewAccountingTransactionList/listbox.xml
+206
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_viewAccountingTransactionList/my_title.xml
...riptionRequest_viewAccountingTransactionList/my_title.xml
+101
-0
master/bt5/slapos_subscription_request/bt/template_action_path_list
.../slapos_subscription_request/bt/template_action_path_list
+1
-0
No files found.
master/bt5/slapos_subscription_request/ActionTemplateItem/portal_types/Subscription%20Request/accounting_list.xml
0 → 100644
View file @
934b0fe4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_view
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_view
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
accounting_list
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
2.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Transactions
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/SubscriptionRequest_viewAccountingTransactionList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_getRelatedAccountingTransactionList.py
0 → 100644
View file @
934b0fe4
portal
=
context
.
getPortalObject
()
from
Products.ERP5Type.Document
import
newTempBase
subscription_trade_condition
=
portal
.
portal_preferences
.
getPreferredAggregatedSubscriptionSaleTradeCondition
()
if
subscription_trade_condition
is
not
None
:
specialise_uid
=
portal
.
restrictedTraverse
(
subscription_trade_condition
).
getUid
()
else
:
raise
ValueError
(
"Preferences are unconfigured, please update it"
)
business_process_uid_list
=
[
portal
.
business_process_module
.
slapos_subscription_business_process
.
getUid
()]
subscription_delivery_specialise_uid_list
=
[
q
.
getUid
()
for
q
in
portal
.
portal_catalog
(
specialise_uid
=
business_process_uid_list
,
portal_type
=
'Sale Trade Condition'
)]
# Recover all Aggregated Sale Packing Lists
aggregated_spl_list
=
portal
.
portal_catalog
(
causality_uid
=
context
.
getUid
(),
portal_type
=
"Sale Packing List"
,
simulation_state
=
"delivered"
,
# Hardcoded Value to only recover recent values
# Replace to acquite value from the template
source_section_uid
=
context
.
organisation_module
.
rapidspace
.
getUid
(),
destination_section_uid
=
context
.
getDestinationSectionUid
(),
default_specialise_uid
=
specialise_uid
)
temp_invoice_list
=
[]
for
aggregated_sale_packing_list
in
aggregated_spl_list
:
related_invoice_list
=
aggregated_sale_packing_list
.
getCausalityRelatedValueList
(
portal_type
=
"Sale Invoice Transaction"
)
assert
len
(
related_invoice_list
)
==
1
,
aggregated_sale_packing_list
.
absolute_url
()
invoice
=
related_invoice_list
[
0
]
invoice_dict
=
dict
(
title
=
invoice
.
getTitle
(),
reference
=
invoice
.
getReference
(),
start_date
=
invoice
.
getStartDate
().
strftime
(
"%d/%m/%Y"
),
creation_date
=
invoice
.
getCreationDate
().
strftime
(
"%d/%m/%Y"
),
total_price
=
invoice
.
getTotalPrice
())
search_kw
=
{
'portal_type'
:
'Sale Packing List Line'
,
'simulation_state'
:
'delivered'
,
# Default Aggregate UID to the hosting subscription?
"parent_specialise_uid"
:
subscription_delivery_specialise_uid_list
,
"default_aggregate_uid"
:
context
.
getAggregateUid
(),
'grouping_reference'
:
aggregated_sale_packing_list
.
getReference
()}
min_start_date
=
None
max_stop_date
=
None
quantity
=
0
for
sale_packing_list_line
in
portal
.
portal_catalog
(
**
search_kw
):
if
not
min_start_date
:
min_start_date
=
sale_packing_list_line
.
getStartDate
()
else
:
min_start_date
=
min
(
min_start_date
,
sale_packing_list_line
.
getStartDate
())
if
not
max_stop_date
:
max_stop_date
=
sale_packing_list_line
.
getStopDate
()
else
:
max_stop_date
=
max
(
max_stop_date
,
sale_packing_list_line
.
getStopDate
())
quantity
+=
sale_packing_list_line
.
getQuantity
()
invoice_dict
.
update
({
"begin_date"
:
min_start_date
.
strftime
(
"%d/%m/%Y"
),
"end_date"
:
max_stop_date
.
strftime
(
"%d/%m/%Y"
),
"quantity"
:
quantity
})
temp_invoice_list
.
append
(
newTempBase
(
context
.
accounting_module
,
invoice
.
getId
(),
**
invoice_dict
))
return
temp_invoice_list
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_getRelatedAccountingTransactionList.xml
0 → 100644
View file @
934b0fe4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SubscriptionRequest_getRelatedAccountingTransactionList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_viewAccountingTransactionList.xml
0 → 100644
View file @
934b0fe4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ERP5 Form"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
Base_edit
</string>
</value>
</item>
<item>
<key>
<string>
action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
edit_order
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
enctype
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
group_list
</string>
</key>
<value>
<list>
<string>
left
</string>
<string>
right
</string>
<string>
center
</string>
<string>
bottom
</string>
<string>
hidden
</string>
</list>
</value>
</item>
<item>
<key>
<string>
groups
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
bottom
</string>
</key>
<value>
<list>
<string>
listbox
</string>
</list>
</value>
</item>
<item>
<key>
<string>
center
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
left
</string>
</key>
<value>
<list>
<string>
my_title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
right
</string>
</key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SubscriptionRequest_viewAccountingTransactionList
</string>
</value>
</item>
<item>
<key>
<string>
method
</string>
</key>
<value>
<string>
POST
</string>
</value>
</item>
<item>
<key>
<string>
name
</string>
</key>
<value>
<string>
SubscriptionRequest_viewAccountingTransactionList
</string>
</value>
</item>
<item>
<key>
<string>
pt
</string>
</key>
<value>
<string>
form_view
</string>
</value>
</item>
<item>
<key>
<string>
row_length
</string>
</key>
<value>
<int>
4
</int>
</value>
</item>
<item>
<key>
<string>
stored_encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Transactions
</string>
</value>
</item>
<item>
<key>
<string>
unicode_mode
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
update_action
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
update_action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_viewAccountingTransactionList/listbox.xml
0 → 100644
View file @
934b0fe4
<?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>
columns
</string>
<string>
list_method
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox
</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>
columns
</string>
</key>
<value>
<string></string>
</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>
list_method
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</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>
Base_viewSearchResultList
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
all_editable_columns
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
columns
</string>
</key>
<value>
<list>
<tuple>
<string>
reference
</string>
<string>
Invoice No.
</string>
</tuple>
<tuple>
<string>
creation_date
</string>
<string>
Issued Date
</string>
</tuple>
<tuple>
<string>
start_date
</string>
<string>
Due Date
</string>
</tuple>
<tuple>
<string>
begin_date
</string>
<string>
Begin
</string>
</tuple>
<tuple>
<string>
end_date
</string>
<string>
End
</string>
</tuple>
<tuple>
<string>
quantity
</string>
<string>
Quantity
</string>
</tuple>
<tuple>
<string>
total_price
</string>
<string>
Total Price
</string>
</tuple>
</list>
</value>
</item>
<item>
<key>
<string>
editable_permission
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
editable_role
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_view_mode_listbox
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
list_method
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
not_viewable
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
read_only
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Transactions Related to this Subscription Request
</string>
</value>
</item>
<item>
<key>
<string>
viewable_permission
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
viewable_role
</string>
</key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Method"
module=
"Products.Formulator.MethodField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
method_name
</string>
</key>
<value>
<string>
SubscriptionRequest_getRelatedAccountingTransactionList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_viewAccountingTransactionList/my_title.xml
0 → 100644
View file @
934b0fe4
<?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>
description
</string>
<string>
editable
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_title
</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>
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>
description
</string>
</key>
<value>
<string>
The usual name of the person or the organisation.
</string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_title
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Person_viewFieldLibrary
</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>
</ZopeData>
master/bt5/slapos_subscription_request/bt/template_action_path_list
View file @
934b0fe4
...
...
@@ -5,6 +5,7 @@ Subscription Condition Module | view
Subscription Condition | view
Subscription Request Module | rss_view
Subscription Request Module | view
Subscription Request | accounting_list
Subscription Request | view
Trial Condition Module | view
Trial Condition | slaposjs_view
...
...
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