Commit d8746243 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_invoicing: allow passing some activate_kw for the credit note creation

parent 9fea292f
Pipeline #11542 failed with stage
in 0 seconds
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
This script is supposed to be the common denominator for invoice reversing operations. This script is supposed to be the common denominator for invoice reversing operations.
Instead of extending it, call it from project-specific script and edit returned document (or its lines). Instead of extending it, call it from project-specific script and edit returned document (or its lines).
""" """
if activate_kw is None:
activate_kw = {}
def recursiveCopyLine(to_document, from_document): def recursiveCopyLine(to_document, from_document):
newContent = to_document.newContent newContent = to_document.newContent
for line in from_document.objectValues(portal_type='Invoice Line'): for line in from_document.objectValues(portal_type='Invoice Line'):
...@@ -25,6 +29,7 @@ reverse_invoice = context.getParentValue().newContent( ...@@ -25,6 +29,7 @@ reverse_invoice = context.getParentValue().newContent(
# Copy over all Arrow-ish relations # Copy over all Arrow-ish relations
# XXX: it would be cleaner to query property sheet definition and check it applies to context # XXX: it would be cleaner to query property sheet definition and check it applies to context
category_list=[x for x in context.getCategoryList() if x.startswith('source') or x.startswith('destination')], category_list=[x for x in context.getCategoryList() if x.startswith('source') or x.startswith('destination')],
activate_kw=activate_kw,
) )
# Separate edit to have stable outcome WRT category_list # Separate edit to have stable outcome WRT category_list
reverse_invoice.edit( reverse_invoice.edit(
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>activate_kw=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
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