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
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
Leo Le Bouter
erp5
Commits
d8746243
Commit
d8746243
authored
Sep 18, 2020
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_invoicing: allow passing some activate_kw for the credit note creation
parent
9fea292f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_createCreditNoteInvoice.py
...l_skins/erp5_invoicing/Invoice_createCreditNoteInvoice.py
+5
-0
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_createCreditNoteInvoice.xml
..._skins/erp5_invoicing/Invoice_createCreditNoteInvoice.xml
+1
-1
No files found.
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_createCreditNoteInvoice.py
View file @
d8746243
...
@@ -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
(
...
...
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_createCreditNoteInvoice.xml
View file @
d8746243
...
@@ -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>
...
...
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