Commit a0fda35a authored by Jérome Perrin's avatar Jérome Perrin

Use corporate name instead of title for organisations when printing orders /...

Use corporate name instead of title for organisations when printing orders / packing list / invoice etc

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23770 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e42ea363
......@@ -195,6 +195,8 @@ class EmptyOrganisation:\n
"""\n
def getTitle(self):\n
return \'\'\n
def getCorporateName(self):\n
return \'\'\n
def getDefaultAddressText(self):\n
return \'\'\n
def getDefaultAddressRegionTitle(self):\n
......@@ -202,6 +204,16 @@ class EmptyOrganisation:\n
def getProperty(self, prop, d=\'\'):\n
return d\n
\n
source_section = context.getSourceSectionValue(\n
portal_type=\'Organisation\')\n
if source_section is None:\n
source_section = EmptyOrganisation()\n
\n
destination_section = context.getDestinationSectionValue(\n
portal_type=\'Organisation\')\n
if destination_section is None:\n
destination_section = EmptyOrganisation()\n
\n
source_administration = context.getSourceAdministrationValue(\n
portal_type=\'Organisation\')\n
if source_administration is None:\n
......@@ -216,8 +228,10 @@ if destination_administration is None:\n
if destination_administration is None:\n
destination_administration = EmptyOrganisation()\n
\n
\n
data_dict = {\n
\'source_section_title\': context.getSourceSectionTitle() or \'\',\n
\'source_section_title\': source_section.getCorporateName() or\\\n
source_section.getTitle(),\n
\'source_section_image_path\': context.getSourceSectionValue() is not None\\\n
and context.getSourceSectionValue().getDefaultImagePath() or \'\',\n
\'source_section_image_width\': context.getSourceSectionValue() is not None\\\n
......@@ -244,7 +258,8 @@ data_dict = {\n
is not None and\\\n
context.getSourceSectionValue().getVatCode() or \'\'),\n
\n
\'source_administration_title\': source_administration.getTitle(),\n
\'source_administration_title\': source_administration.getCorporateName()\\\n
or source_administration.getTitle(),\n
\'source_administration_address\': getOneLineAddress(\n
source_administration.getDefaultAddressText(),\n
source_administration.getDefaultAddressRegionTitle()),\n
......@@ -312,9 +327,9 @@ data_dict = {\n
\'destination_vatid\': getVatId(context.getDestination() and\n
context.getDestinationValue().getProperty(\'vat_code\', \'\') or \'\'),\n
\n
\'destination_section_title\': context.getDestinationSectionTitle() or \'\',\n
\'destination_section_image_path\': context.getDestinationSectionValue() is not None \\\n
and context.getDestinationSectionValue().getDefaultImagePath() or \'\',\n
\'destination_section_title\': destination_section.getCorporateName() or \\\n
destination_section.getTitle(),\n
\'destination_section_image_path\': destination_section.getDefaultImagePath(),\n
\'destination_section_image_width\': context.getDestinationSectionValue() is not None\\\n
and context.getDestinationSectionValue().getDefaultImageWidth() is not None\\\n
and context.getDestinationSectionValue().getDefaultImageWidth() * inch_cm_ratio or \'\',\n
......@@ -331,7 +346,8 @@ data_dict = {\n
\'destination_section_vatid\': getVatId(context.getDestinationSection() and\n
context.getDestinationSectionValue().getProperty(\'vat_code\') or \'\'),\n
\n
\'destination_administration_title\': destination_administration.getTitle(),\n
\'destination_administration_title\': destination_administration.getCorporateName() or \\\n
destination_administration.getTitle(),\n
\'destination_administration_address\': getOneLineAddress(\n
destination_administration.getDefaultAddressText(),\n
destination_administration.getDefaultAddressRegionTitle()),\n
......@@ -442,6 +458,8 @@ return unicodeDict(data_dict)\n
<string>_inplacevar_</string>
<string>inch_cm_ratio</string>
<string>EmptyOrganisation</string>
<string>source_section</string>
<string>destination_section</string>
<string>source_administration</string>
<string>destination_administration</string>
<string>data_dict</string>
......
427
\ No newline at end of file
429
\ 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