Commit 27b08a00 authored by Alexandre Boeglin's avatar Alexandre Boeglin

* OrderLine_viewFieldLibrary, PurchaseOrder_view: hide some fields if the line has sublines

* PurchaseOrder_viewODTPrintDialog: add your_format field, using oood for conversion
* PurchaseOrder_view: add edit_order to form
* PurchaseOrder_getODTDataDict, PurchaseOrder_getODTStyleSheet, PurchaseOrder_viewAsODT: add (simple) support for hierarchical orders

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20040 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ffc27259
......@@ -15,6 +15,7 @@
<list>
<string>title</string>
<string>items</string>
<string>enabled</string>
</list>
</value>
</item>
......@@ -56,6 +57,12 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -67,7 +74,7 @@
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -85,6 +92,10 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_category</string> </value>
......@@ -114,6 +125,22 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>not: here/hasLineContent</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
......
......@@ -16,6 +16,7 @@
<string>title</string>
<string>portal_type</string>
<string>items</string>
<string>enabled</string>
</list>
</value>
</item>
......@@ -57,6 +58,12 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -68,13 +75,13 @@
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
......@@ -92,6 +99,10 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_relation_field</string> </value>
......@@ -142,12 +153,28 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>REQUEST/relation_item_list</string> </value>
<value> <string>not: here/hasLineContent</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>REQUEST/relation_item_list</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
......
......@@ -15,6 +15,7 @@
<list>
<string>title</string>
<string>portal_type</string>
<string>enabled</string>
</list>
</value>
</item>
......@@ -56,6 +57,12 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -64,10 +71,18 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_type</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>
......@@ -75,6 +90,10 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_multi_relation_field</string> </value>
......@@ -108,4 +127,20 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>not: here/hasLineContent</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -150,10 +150,33 @@ line_list = []\n
total_price = 0.0\n
total_vat = 0.0\n
\n
for line in context.getMovementList(sort_on=\'int_index\'):\n
def getSubLineList(obj):\n
sub_list = []\n
for x in obj.searchFolder(portal_type=context.getPortalOrderMovementTypeList(), sort_on=\'int_index\'):\n
sub_list.append(x)\n
sub_list.extend(getSubLineList(x))\n
return sub_list\n
\n
for line in getSubLineList(context):\n
prod_desc = line.getResource() is not None and line.getResourceValue().getDescription() or \'\'\n
desc = getProductAndLineDesc(prod_desc, line.getDescription())\n
if line.hasLineContent() or line.hasCellContent():\n
# summary\n
line_dict = {\n
\'style_name\': \'Item_20_Table_20_Title\',\n
\'index\': line.getIntIndex(),\n
\'source_reference\': getSourceReference(line),\n
\'reference\': line.getResource() is not None and line.getResourceValue().getReference() or \'\',\n
\'description\': desc,\n
\'total_quantity\': \'\',\n
\'quantity_unit\': \'\',\n
\'stop_date\': \'\',\n
\'base_price\': \'\',\n
\'total_price\': \'\',\n
}\n
else:\n
line_dict = {\n
\'style_name\': \'Table_20_Contents\',\n
\'index\': line.getIntIndex(),\n
\'source_reference\': getSourceReference(line),\n
\'reference\': line.getResource() is not None and line.getResourceValue().getReference() or \'\',\n
......@@ -190,15 +213,15 @@ data_dict = {\n
context.getDestination() and context.getDestinationValue().getFaxText() or \'\'),\n
\'destination_email\': getEmail(context.getDestination() and context.getDestinationValue().getEmailText() or \'\'),\n
\n
\'destination_section_title\': context.getDestinationSectionTitle() or \'\',\n
\'destination_section_address\': getOneLineAddress(\n
\'destination_section_title\': unicode(context.getDestinationSectionTitle() or \'\', \'utf8\'),\n
\'destination_section_address\': unicode(getOneLineAddress(\n
context.getDestinationSection() and context.getDestinationSectionValue().getDefaultAddressText() or \'\',\n
context.getDestinationSection() and context.getDestinationSectionValue().getRegionTitle() or \'\'),\n
\'destination_section_telfax\': getPhoneAndFax(\n
context.getDestinationSection() and context.getDestinationSectionValue().getRegionTitle() or \'\'), \'utf8\'),\n
\'destination_section_telfax\': unicode(getPhoneAndFax(\n
context.getDestinationSection() and context.getDestinationSectionValue().getTelephoneText() or \'\',\n
context.getDestinationSection() and context.getDestinationSectionValue().getTelephoneText() or \'\'),\n
\'destination_section_email\': getEmail(context.getDestinationSection() and context.getDestinationSectionValue().getEmailText() or \'\'),\n
\'destination_section_vatid\': getVatId(context.getDestinationSection() and context.getDestinationSectionValue().getVatCode() or \'\'),\n
context.getDestinationSection() and context.getDestinationSectionValue().getTelephoneText() or \'\'), \'utf8\'),\n
\'destination_section_email\': unicode(getEmail(context.getDestinationSection() and context.getDestinationSectionValue().getEmailText() or \'\'), \'utf8\'),\n
\'destination_section_vatid\': unicode(getVatId(context.getDestinationSection() and context.getDestinationSectionValue().getVatCode() or \'\'), \'utf8\'),\n
\n
\'destination_decision_title\': context.getDestinationDecisionTitle() or \'\',\n
\'destination_decision_telfax\': getPhoneAndFax(context.getDestinationDecision() and context.getDestinationDecisionValue().getTelephoneText() or \'\',\n
......@@ -284,6 +307,7 @@ return data_dict\n
<string>line_list</string>
<string>total_price</string>
<string>total_vat</string>
<string>getSubLineList</string>
<string>_getiter_</string>
<string>line</string>
<string>None</string>
......@@ -291,6 +315,7 @@ return data_dict\n
<string>desc</string>
<string>line_dict</string>
<string>_inplacevar_</string>
<string>unicode</string>
<string>data_dict</string>
</tuple>
</value>
......
......@@ -50,6 +50,15 @@
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list>
<string>title</string>
<string>reference</string>
</list>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
......
......@@ -20,6 +20,7 @@
<value>
<list>
<string>items</string>
<string>enabled</string>
</list>
</value>
</item>
......@@ -61,6 +62,12 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>extra_context</string> </key>
<value> <string></string> </value>
......@@ -76,7 +83,7 @@
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -90,6 +97,10 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra_context</string> </key>
<value>
......@@ -117,6 +128,22 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>not: cell/hasLineContent</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
......
......@@ -88,7 +88,9 @@
<item>
<key> <string>right</string> </key>
<value>
<list/>
<list>
<string>your_format</string>
</list>
</value>
</item>
</dictionary>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>items</string>
<string>enabled</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_format</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>enabled</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>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_format</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewDialogFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Base_getConversionFormatItemList(base_content_type=\'application/vnd.oasis.opendocument.text\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
194
\ No newline at end of file
195
\ No newline at end of file
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