Commit 8b4bc795 authored by Łukasz Nowak's avatar Łukasz Nowak

slapos_crm/slapos_jio: Support unpaid invoices in attention list

parent f3b88846
catalog = context.getPortalObject().portal_catalog
payment_list = catalog(
portal_type='Payment Transaction',
simulation_state=simulation_state,
limit=limit
)
invoice_list = []
for payment in payment_list:
if payment.getSimulationState() == simulation_state:
invoice_list.extend(payment.getCausalityValueList(portal_type='Sale Invoice Transaction'))
return invoice_list
<?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>limit=None, simulation_state=\'started\'</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getPendingInvoiceList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -15,5 +15,10 @@ if context.getPortalType() == "Hosting Subscription":
attention_point_list.append(
{"text": "Please Upgrade this service",
"link": ticket.getRelativeUrl()})
elif context.getPortalType() == 'Accounting Transaction Module':
for invoice in context.Base_getPendingInvoiceList(limit=3):
attention_point_list.append(
{"text": "Invoice to pay",
"link": invoice.getRelativeUrl()}
)
return dumps(attention_point_list)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment