Use getattr instead of testing origin id

Since changeset b8d76b07910f, the reference value of a negative id is a string
so testing the id does not work. It is safer to call getattr with a default
empty string value.

issue9500
review304611002
This commit is contained in:
Cédric Krier committed 2020-10-25 11:02:23 +01:00
1 parent ce942fc067
commit 450ebfbf20
1 file changed
+1 -1
+1 -1
View File
@@ -964,7 +964,7 @@
<text:p text:style-name="P10"><text:placeholder text:placeholder-type="text">&lt;line.description or &apos;&apos;&gt;</text:placeholder><text:line-break/><text:placeholder text:placeholder-type="text">&lt;line.move_description or &apos;&apos;&gt;</text:placeholder></text:p>
</table:table-cell>
<table:table-cell table:style-name="Table3.G11" office:value-type="string">
<text:p text:style-name="P10"><text:placeholder text:placeholder-type="text">&lt;line.origin.rec_name if line.origin and line.origin.id &gt;= 0 else &apos;&apos;&gt;</text:placeholder></text:p>
<text:p text:style-name="P10"><text:placeholder text:placeholder-type="text">&lt;getattr(line.origin, &apos;rec_name&apos;, &apos;&apos;)&gt;</text:placeholder></text:p>
</table:table-cell>
<table:table-cell table:style-name="Table3.H11" office:value-type="string">
<text:p text:style-name="P10"><text:placeholder text:placeholder-type="text">&lt;line.state_string&gt;</text:placeholder></text:p>