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
Klaus Wölfel
erp5
Commits
a18b493a
Commit
a18b493a
authored
Dec 04, 2024
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_interface_cxml: .
parent
285343a1
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
396 additions
and
50 deletions
+396
-50
bt5/erp5_interface_cxml/ModuleComponentTemplateItem/portal_components/document.erp5.CxmlConnector.py
...lateItem/portal_components/document.erp5.CxmlConnector.py
+1
-1
bt5/erp5_interface_cxml/ModuleComponentTemplateItem/portal_components/document.erp5.CxmlOrderRequest.py
...eItem/portal_components/document.erp5.CxmlOrderRequest.py
+2
-2
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getCxmlStatusItem.py
...nterface_cxml/SaleInvoiceTransaction_getCxmlStatusItem.py
+4
-4
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getCxmlStatusItem.xml
...terface_cxml/SaleInvoiceTransaction_getCxmlStatusItem.xml
+1
-1
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getExeptDetail.py
...5_interface_cxml/SaleInvoiceTransaction_getExeptDetail.py
+1
-0
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getExeptDetail.xml
..._interface_cxml/SaleInvoiceTransaction_getExeptDetail.xml
+62
-0
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getInvoiceDetailRequest.zpt
...e_cxml/SaleInvoiceTransaction_getInvoiceDetailRequest.zpt
+13
-2
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getSupplierBankAccount.py
...ace_cxml/SaleInvoiceTransaction_getSupplierBankAccount.py
+8
-0
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getSupplierBankAccount.xml
...ce_cxml/SaleInvoiceTransaction_getSupplierBankAccount.xml
+62
-0
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_sendInvoiceDetailRequest.py
...e_cxml/SaleInvoiceTransaction_sendInvoiceDetailRequest.py
+1
-6
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_sendInvoiceDetailRequestAction.py
.../SaleInvoiceTransaction_sendInvoiceDetailRequestAction.py
+8
-0
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_sendInvoiceDetailRequestAction.xml
...SaleInvoiceTransaction_sendInvoiceDetailRequestAction.xml
+62
-0
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleOrder_checkCxmlOrderRequestConsistency.py
...erface_cxml/SaleOrder_checkCxmlOrderRequestConsistency.py
+18
-11
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_getCxmlStatusItem.py
.../erp5_interface_cxml/SalePackingList_getCxmlStatusItem.py
+4
-4
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_getCxmlStatusItem.xml
...erp5_interface_cxml/SalePackingList_getCxmlStatusItem.xml
+1
-1
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_sendShipNoticeRequest.py
...5_interface_cxml/SalePackingList_sendShipNoticeRequest.py
+3
-0
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_sendShipNoticeRequest.xml
..._interface_cxml/SalePackingList_sendShipNoticeRequest.xml
+62
-0
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_sendShipNoticeRequestAction.py
...rface_cxml/SalePackingList_sendShipNoticeRequestAction.py
+8
-0
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_sendShipNoticeRequestAction.xml
...face_cxml/SalePackingList_sendShipNoticeRequestAction.xml
+62
-0
bt5/erp5_interface_cxml/WorkflowTemplateItem/portal_workflow/cxml_interaction_workflow/interaction_SaleInvoiceTransaction_stop.xml
...tion_workflow/interaction_SaleInvoiceTransaction_stop.xml
+1
-1
bt5/erp5_interface_cxml/WorkflowTemplateItem/portal_workflow/cxml_interaction_workflow/script_SaleInvoiceTransaction_sendInvoiceDetailRequest.py
...script_SaleInvoiceTransaction_sendInvoiceDetailRequest.py
+5
-8
bt5/erp5_interface_cxml/WorkflowTemplateItem/portal_workflow/cxml_interaction_workflow/script_SalePackingList_sendShipNoticeRequest.py
..._workflow/script_SalePackingList_sendShipNoticeRequest.py
+5
-8
bt5/erp5_interface_cxml/WorkflowTemplateItem/portal_workflow/cxml_validation_workflow/script_CxmlOrderRequest_doValidateAction.py
...tion_workflow/script_CxmlOrderRequest_doValidateAction.py
+2
-1
No files found.
bt5/erp5_interface_cxml/ModuleComponentTemplateItem/portal_components/document.erp5.CxmlConnector.py
View file @
a18b493a
...
@@ -90,7 +90,7 @@ class CxmlConnector(XMLObject):
...
@@ -90,7 +90,7 @@ class CxmlConnector(XMLObject):
except
AssertionError
:
except
AssertionError
:
self
.
log
(
text_content
)
self
.
log
(
text_content
)
self
.
log
(
response
.
content
)
self
.
log
(
response
.
content
)
error_message
=
"Unexepected Response Status in response %s"
%
response_document
.
getRelativeUrl
()
error_message
=
et
.
xpath
(
'/cXML/Response/Status'
)[
0
].
text
raise
AssertionError
(
error_message
)
raise
AssertionError
(
error_message
)
return
response_document
return
response_document
...
...
bt5/erp5_interface_cxml/ModuleComponentTemplateItem/portal_components/document.erp5.CxmlOrderRequest.py
View file @
a18b493a
...
@@ -136,8 +136,8 @@ class CxmlOrderRequest(CxmlDocument):
...
@@ -136,8 +136,8 @@ class CxmlOrderRequest(CxmlDocument):
bill_to
=
order_request_header
.
find
(
'BillTo'
)
bill_to
=
order_request_header
.
find
(
'BillTo'
)
address
=
bill_to
.
find
(
'Address'
)
address
=
bill_to
.
find
(
'Address'
)
bill_to_name
=
get_text
(
address
,
'Name'
)
bill_to_name
=
get_text
(
address
,
'Name'
)
sold_to_name
=
''
.
join
(
order_request_header
.
xpath
(
'//BusinessPartner[@role="soldTo"]/Address/Name/text()'
))
sold_to_name
=
s
(
''
.
join
(
order_request_header
.
xpath
(
'//BusinessPartner[@role="soldTo"]/Address/Name/text()'
)
))
buyer_vat_id
=
''
.
join
(
order_request_header
.
xpath
(
'//Extrinsic[@name="buyerVatID"]/text()'
))
buyer_vat_id
=
s
(
''
.
join
(
order_request_header
.
xpath
(
'//Extrinsic[@name="buyerVatID"]/text()'
)
))
property_dict
[
'destination_section'
]
=
{
'portal_type'
:
'Organisation'
,
'corporate_name'
:
sold_to_name
or
bill_to_name
}
property_dict
[
'destination_section'
]
=
{
'portal_type'
:
'Organisation'
,
'corporate_name'
:
sold_to_name
or
bill_to_name
}
if
buyer_vat_id
:
if
buyer_vat_id
:
property_dict
[
'destination_section_vat_code'
]
=
buyer_vat_id
property_dict
[
'destination_section_vat_code'
]
=
buyer_vat_id
...
...
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getCxmlStatus
Text
.py
→
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getCxmlStatus
Item
.py
View file @
a18b493a
...
@@ -7,7 +7,7 @@ for start_date, cxml_document in reversed(sorted([(x.getStartDate(), x) for x in
...
@@ -7,7 +7,7 @@ for start_date, cxml_document in reversed(sorted([(x.getStartDate(), x) for x in
# a status code 2xx. Only then we had a successfull
# a status code 2xx. Only then we had a successfull
# ConfirmationRequest
# ConfirmationRequest
if
response
.
getStatusCode
().
startswith
(
"2"
):
if
response
.
getStatusCode
().
startswith
(
"2"
):
return
"
Invoice accepted"
return
"
accepted"
,
context
.
Base_translateString
(
"Invoice accepted"
)
return
"
Invoice not accepted"
return
"
not_accepted"
,
context
.
Base_translateString
(
"Invoice not accepted"
)
return
"
Invoice sent but no reply"
return
"
not_reply"
,
context
.
Base_translateString
(
"Invoice sent but no reply"
)
return
"
Invoice not sent"
return
"
not_sent"
,
context
.
Base_translateString
(
"Invoice not sent"
)
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getCxmlStatus
Text
.xml
→
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getCxmlStatus
Item
.xml
View file @
a18b493a
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleInvoiceTransaction_getCxmlStatus
Text
</string>
</value>
<value>
<string>
SaleInvoiceTransaction_getCxmlStatus
Item
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getExeptDetail.py
0 → 100644
View file @
a18b493a
return
''
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getExeptDetail.xml
0 → 100644
View file @
a18b493a
<?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></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleInvoiceTransaction_getExeptDetail
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getInvoiceDetailRequest.zpt
View file @
a18b493a
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
order python:here.getCausalityValue(portal_type='Sale Order');
order python:here.getCausalityValue(portal_type='Sale Order');
order_request order/Order_getRelatedOrderRequestValue;
order_request order/Order_getRelatedOrderRequestValue;
data_dict here/Invoice_getODTDataDict;
data_dict here/Invoice_getODTDataDict;
supplier_bank_account here/SaleInvoiceTransaction_getSupplierBankAccount;
connector here/Base_getCxmlConnectorValueForSale;"
>
connector here/Base_getCxmlConnectorValueForSale;"
>
<cXML
tal:attributes=
"xml:lang language; payloadID connector/getPayloadId; timestamp python:DateTime().ISO8601(); version connector/getCxmlVersion"
>
<cXML
tal:attributes=
"xml:lang language; payloadID connector/getPayloadId; timestamp python:DateTime().ISO8601(); version connector/getCxmlVersion"
>
<Header>
<Header>
...
@@ -90,6 +91,16 @@
...
@@ -90,6 +91,16 @@
</PostalAddress>
</PostalAddress>
</Contact>
</Contact>
</InvoicePartner>
</InvoicePartner>
<InvoicePartner>
<Contact
role=
"wireReceivingBank"
>
<Name
xml:lang=
"en-US"
tal:content=
"python: supplier_bank_account['bank_name']"
></Name>
</Contact>
<IdReference
domain=
"accountName"
tal:attributes=
"identifier python: supplier_bank_account['title']"
/>
<IdReference
domain=
"accountType"
tal:attributes=
"identifier python: supplier_bank_account['account_type']"
/>
<IdReference
domain=
"swiftID"
tal:attributes=
"identifier python: supplier_bank_account['bic_code']"
/>
<IdReference
domain=
"accountID"
tal:attributes=
"identifier python: supplier_bank_account['iban']"
/>
<IdReference
domain=
"ibanID"
tal:attributes=
"identifier python: supplier_bank_account['iban']"
/>
</InvoicePartner>
<InvoicePartner
tal:content=
"structure order_request/getContactSoldToXml"
/>
<InvoicePartner
tal:content=
"structure order_request/getContactSoldToXml"
/>
<InvoiceDetailShipping>
<InvoiceDetailShipping>
<Contact
role=
"shipFrom"
>
<Contact
role=
"shipFrom"
>
...
@@ -170,7 +181,7 @@
...
@@ -170,7 +181,7 @@
<Tax>
<Tax>
<Money
tal:attributes=
"currency here/getPriceCurrencyId"
tal:content=
"line_tax/total_price"
></Money>
<Money
tal:attributes=
"currency here/getPriceCurrencyId"
tal:content=
"line_tax/total_price"
></Money>
<Description
xml:lang =
"en-US"
></Description>
<Description
xml:lang =
"en-US"
></Description>
<TaxDetail
category=
"vat"
tal:attributes=
"percentageRate python: float(line_tax['base_price'] or 0) *100; taxPointDate python:here.getStartDate().ISO8601()"
>
<TaxDetail
category=
"vat"
tal:attributes=
"
exemptDetail python: here.SaleInvoiceTransaction_getExeptDetail() or nothing;
percentageRate python: float(line_tax['base_price'] or 0) *100; taxPointDate python:here.getStartDate().ISO8601()"
>
<TaxableAmount>
<TaxableAmount>
<Money
tal:attributes=
"currency here/getPriceCurrencyId"
tal:content=
"line_tax/total_quantity"
></Money>
<Money
tal:attributes=
"currency here/getPriceCurrencyId"
tal:content=
"line_tax/total_quantity"
></Money>
</TaxableAmount>
</TaxableAmount>
...
...
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getSupplierBankAccount.py
0 → 100644
View file @
a18b493a
supplier
=
context
.
getSourceSectionValue
()
supplier_bank_account
=
[
x
for
x
in
supplier
.
objectValues
(
portal_type
=
'Bank Account'
)
if
x
.
getValidationState
()
==
'validated'
][
0
]
return
dict
(
title
=
supplier_bank_account
.
getTitle
(),
iban
=
supplier_bank_account
.
getIban
(),
bic_code
=
supplier_bank_account
.
getBicCode
(),
account_type
=
supplier_bank_account
.
getBankAccountType
(),
bank_name
=
supplier_bank_account
.
getSourceFreeText
()
)
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_getSupplierBankAccount.xml
0 → 100644
View file @
a18b493a
<?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></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleInvoiceTransaction_getSupplierBankAccount
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_sendInvoiceDetailRequest.py
View file @
a18b493a
#context = state_change['object']
text_content
=
context
.
SaleInvoiceTransaction_getInvoiceDetailRequest
().
encode
(
'utf-8'
)
# only send ShipNoticeRequest if the Sale Packing List is related to
# a Sale Order which is related to a valid Cxml Order Request
if
not
context
.
Base_isCxmlRelated
():
return
text_content
=
context
.
SaleInvoiceTranaction_getInvoiceDetailRequest
().
encode
(
'utf-8'
)
connector
=
context
.
Base_getCxmlConnectorValueForSale
()
connector
=
context
.
Base_getCxmlConnectorValueForSale
()
connector
.
sendOutgoingRequest
(
text_content
,
follow_up
=
context
.
getRelativeUrl
())
connector
.
sendOutgoingRequest
(
text_content
,
follow_up
=
context
.
getRelativeUrl
())
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_sendInvoiceDetailRequestAction.py
0 → 100644
View file @
a18b493a
try
:
context
.
SaleInvoiceTransaction_sendInvoiceDetailRequest
()
except
AssertionError
as
e
:
context
.
Base_redirect
(
keep_items
=
{
"portal_status_message"
:
str
(
e
),
"portal_status_level"
:
"error"
})
else
:
context
.
Base_redirect
(
keep_items
=
{
"portal_status_message"
:
context
.
Base_translateString
(
'Cxml Invoice sent.'
)})
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleInvoiceTransaction_sendInvoiceDetailRequestAction.xml
0 → 100644
View file @
a18b493a
<?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></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleInvoiceTransaction_sendInvoiceDetailRequestAction
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SaleOrder_checkCxmlOrderRequestConsistency.py
View file @
a18b493a
...
@@ -50,15 +50,18 @@ if destination_section_network_id != order_request_value.getFrom().rstrip("-Test
...
@@ -50,15 +50,18 @@ if destination_section_network_id != order_request_value.getFrom().rstrip("-Test
mapping
=
dict
(
destination_section_network_id
=
destination_section_network_id
,
from_network_id
=
order_request_value
.
getFrom
().
rstrip
(
"-Test"
))
mapping
=
dict
(
destination_section_network_id
=
destination_section_network_id
,
from_network_id
=
order_request_value
.
getFrom
().
rstrip
(
"-Test"
))
))
))
try
:
if
context
.
getPortalType
()
in
(
"Sale Packing List"
,
"Sale Invoice Transaction"
):
try
:
source_address
=
context
.
Delivery_getSourceAddressText
()[
0
]
source_address
=
context
.
Delivery_getSourceAddressText
()[
0
]
except
AttributeError
:
except
AttributeError
:
source_address
=
None
source_address
=
None
if
source_address
is
None
:
if
source_address
is
None
:
error_list
.
append
(
translate
(
error_list
.
append
(
translate
(
"Sender Address must be defined"
))
"Sender Address must be defined"
,
mapping
=
dict
(
destination_section_network_id
=
destination_section_network_id
,
from_network_id
=
order_request_value
.
getFrom
().
rstrip
(
"-Test"
))
if
context
.
getPortalType
()
==
"Sale Invoice Transaction"
:
))
supplier_tax_id
=
context
.
SaleInvoiceTransaction_getSupplierTaxId
()
if
not
supplier_tax_id
:
error_list
.
append
(
translate
(
"Supplier VAT Code must be defined."
))
property_title_dict
=
{
property_title_dict
=
{
""
:
""
,
""
:
""
,
...
@@ -154,6 +157,8 @@ def createSaleOrderLine(property_dict):
...
@@ -154,6 +157,8 @@ def createSaleOrderLine(property_dict):
'validation_state'
:
'validated'
,
'validation_state'
:
'validated'
,
})
})
property_dict
[
'portal_type'
]
=
'Sale Order Line'
property_dict
[
'portal_type'
]
=
'Sale Order Line'
if
property_dict
.
get
(
'title'
)
and
not
property_dict
.
get
(
'description'
):
property_dict
[
'description'
]
=
property_dict
.
get
(
'title'
)
context
.
newContent
(
**
property_dict
)
context
.
newContent
(
**
property_dict
)
def
compare
(
document
,
property_dict
,
context_key
=
''
,
context_title
=
''
,
parent_context_title
=
''
,
set_property
=
False
):
def
compare
(
document
,
property_dict
,
context_key
=
''
,
context_title
=
''
,
parent_context_title
=
''
,
set_property
=
False
):
...
@@ -163,12 +168,14 @@ def compare(document, property_dict, context_key='', context_title='', parent_co
...
@@ -163,12 +168,14 @@ def compare(document, property_dict, context_key='', context_title='', parent_co
for
key
,
value
in
sorted
(
property_dict
.
items
()):
for
key
,
value
in
sorted
(
property_dict
.
items
()):
if
context
.
getCxmlChanges
():
if
context
.
getCxmlChanges
():
continue
continue
if
contex
t
.
getPortalType
()
in
(
"Sale Packing List"
,
"Sale Invoice Transaction"
)
and
key
in
(
'order_date'
,
'int_index'
):
if
documen
t
.
getPortalType
()
in
(
"Sale Packing List"
,
"Sale Invoice Transaction"
)
and
key
in
(
'order_date'
,
'int_index'
):
continue
continue
if
document
.
getPortalType
()
==
"Invoice Line"
and
key
in
(
'start_date'
,
'stop_date'
):
if
document
.
getPortalType
()
==
"Invoice Line"
and
key
in
(
'start_date'
,
'stop_date'
):
continue
continue
if
contex
t
.
getPortalType
()
in
(
"Sale Order"
,
"Sale Packing List"
)
and
key
==
"destination_section_vat_code"
:
if
documen
t
.
getPortalType
()
in
(
"Sale Order"
,
"Sale Packing List"
)
and
key
==
"destination_section_vat_code"
:
continue
continue
if
document
.
getPortalType
()
==
"Sale Order Line"
and
key
==
"title"
and
set_property
and
not
document
.
getDescription
():
document
.
setDescription
(
value
)
if
isinstance
(
value
,
dict
):
if
isinstance
(
value
,
dict
):
category
=
document
.
getProperty
(
key
)
category
=
document
.
getProperty
(
key
)
if
not
category
:
if
not
category
:
...
...
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_getCxmlStatus
Text
.py
→
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_getCxmlStatus
Item
.py
View file @
a18b493a
...
@@ -7,7 +7,7 @@ for start_date, cxml_document in reversed(sorted([(x.getStartDate(), x) for x in
...
@@ -7,7 +7,7 @@ for start_date, cxml_document in reversed(sorted([(x.getStartDate(), x) for x in
# a status code 2xx. Only then we had a successfull
# a status code 2xx. Only then we had a successfull
# ConfirmationRequest
# ConfirmationRequest
if
response
.
getStatusCode
().
startswith
(
"2"
):
if
response
.
getStatusCode
().
startswith
(
"2"
):
return
"
ASN accepted"
return
"
accepted"
,
context
.
Base_translateString
(
"ASN accepted"
)
return
"
ASN not accepted"
return
"
not_accepted"
,
context
.
Base_translateString
(
"ASN not accepted"
)
return
"
ASN sent but no reply"
return
"
no_reply"
,
context
.
Base_translateString
(
"ASN sent but no reply"
)
return
"
ASN not sent"
return
"
not_sent"
,
context
.
Base_translateString
(
"ASN not sent"
)
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_getCxmlStatus
Text
.xml
→
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_getCxmlStatus
Item
.xml
View file @
a18b493a
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
SalePackingList_getCxmlStatus
Text
</string>
</value>
<value>
<string>
SalePackingList_getCxmlStatus
Item
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_sendShipNoticeRequest.py
0 → 100644
View file @
a18b493a
text_content
=
context
.
SalePackingList_getShipNoticeRequest
().
encode
(
'utf-8'
)
connector
=
context
.
Base_getCxmlConnectorValueForSale
()
connector
.
sendOutgoingRequest
(
text_content
,
follow_up
=
context
.
getRelativeUrl
())
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_sendShipNoticeRequest.xml
0 → 100644
View file @
a18b493a
<?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></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SalePackingList_sendShipNoticeRequest
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_sendShipNoticeRequestAction.py
0 → 100644
View file @
a18b493a
try
:
context
.
SalePackingList_sendShipNoticeRequest
()
except
AssertionError
as
e
:
context
.
Base_redirect
(
keep_items
=
{
"portal_status_message"
:
str
(
e
),
"portal_status_level"
:
"error"
})
else
:
context
.
Base_redirect
(
keep_items
=
{
"portal_status_message"
:
context
.
Base_translateString
(
'Cxml Ship Notice sent.'
)})
bt5/erp5_interface_cxml/SkinTemplateItem/portal_skins/erp5_interface_cxml/SalePackingList_sendShipNoticeRequestAction.xml
0 → 100644
View file @
a18b493a
<?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></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SalePackingList_sendShipNoticeRequestAction
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_interface_cxml/WorkflowTemplateItem/portal_workflow/cxml_interaction_workflow/interaction_SaleInvoiceTransaction_stop.xml
View file @
a18b493a
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<key>
<string>
categories
</string>
</key>
<key>
<string>
categories
</string>
</key>
<value>
<value>
<tuple>
<tuple>
<string>
after
_script/portal_workflow/cxml_interaction_workflow/script_SaleInvoiceTransaction_sendInvoiceDetailRequest
</string>
<string>
before_commit
_script/portal_workflow/cxml_interaction_workflow/script_SaleInvoiceTransaction_sendInvoiceDetailRequest
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
...
bt5/erp5_interface_cxml/WorkflowTemplateItem/portal_workflow/cxml_interaction_workflow/script_SaleInvoiceTransaction_sendInvoiceDetailRequest.py
View file @
a18b493a
return
context
=
state_change
[
'object'
]
context
=
state_change
[
'object'
]
# only send ShipNoticeRequest if the Sale Packing List is related to
# only send if object is related to a valid Cxml Order Request
# a Sale Order which is related to a valid Cxml Order Request
if
not
context
.
Base_isCxmlRelated
():
if
not
context
.
Base_isCxmlRelated
():
return
return
text_content
=
context
.
SaleInvoiceTransaction_getInvoiceDetailRequest
().
encode
(
'utf-8'
)
# call must be done in an activity which NEVER retries.
connector
=
context
.
Base_getCxmlConnectorValueForSale
()
context
.
activate
(
# calling sendOutgoingRequest should be done in an activity
# which NEVER retries.
connector
.
activate
(
activity
=
'SQLQueue'
,
activity
=
'SQLQueue'
,
conflict_retry
=
False
,
conflict_retry
=
False
,
max_retry
=
0
,
max_retry
=
0
,
).
sendOutgoingRequest
(
text_content
,
follow_up
=
context
.
getRelativeUrl
()
)
).
SaleInvoiceTransaction_sendInvoiceDetailRequest
(
)
bt5/erp5_interface_cxml/WorkflowTemplateItem/portal_workflow/cxml_interaction_workflow/script_SalePackingList_sendShipNoticeRequest.py
View file @
a18b493a
return
context
=
state_change
[
'object'
]
context
=
state_change
[
'object'
]
# only send ShipNoticeRequest if the Sale Packing List is related to
# only send if object is related to a valid Cxml Order Request
# a Sale Order which is related to a valid Cxml Order Request
if
not
context
.
Base_isCxmlRelated
():
if
not
context
.
Base_isCxmlRelated
():
return
return
text_content
=
context
.
SalePackingList_getShipNoticeRequest
().
encode
(
'utf-8'
)
# call must be done in an activity which NEVER retries.
connector
=
context
.
Base_getCxmlConnectorValueForSale
()
context
.
activate
(
# calling sendOutgoingRequest should be done in an activity
# which NEVER retries.
connector
.
activate
(
activity
=
'SQLQueue'
,
activity
=
'SQLQueue'
,
conflict_retry
=
False
,
conflict_retry
=
False
,
max_retry
=
0
,
max_retry
=
0
,
).
sendOutgoingRequest
(
text_content
,
follow_up
=
context
.
getRelativeUrl
()
)
).
SalePackingList_sendShipNoticeRequest
(
)
bt5/erp5_interface_cxml/WorkflowTemplateItem/portal_workflow/cxml_validation_workflow/script_CxmlOrderRequest_doValidateAction.py
View file @
a18b493a
...
@@ -35,6 +35,7 @@ else:
...
@@ -35,6 +35,7 @@ else:
raise
ValidationFailed
(
Message
(
'erp5_ui'
,
error
))
raise
ValidationFailed
(
Message
(
'erp5_ui'
,
error
))
clone_order
=
sale_order_value
.
Order_cloneAndUpdateVersion
()
clone_order
=
sale_order_value
.
Order_cloneAndUpdateVersion
()
previous_order_request
.
setFollowUpValue
(
clone_order
)
previous_order_request
.
setFollowUpValue
(
clone_order
)
if
portal
.
portal_workflow
.
isTransitionPossible
(
sale_order_value
,
'update'
):
sale_order_value
.
update
()
sale_order_value
.
update
()
break
break
else
:
else
:
...
...
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