changeset c73d8d1545e4 in modules/account:5.0 details: https://hg.tryton.org/modules/account?cmd=changeset;node=c73d8d1545e4 description: 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 (grafted from 64b7fe63694035a593bfb467408f9d1106d065f3) diffstat: general_ledger.fodt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 75cc45c523c1 -r c73d8d1545e4 general_ledger.fodt --- a/general_ledger.fodt Sun Oct 18 20:51:16 2020 +0200 +++ b/general_ledger.fodt Sun Oct 25 11:02:23 2020 +0100 @@ -894,7 +894,7 @@ <text:p text:style-name="P10"><text:placeholder text:placeholder-type="text"><line.description or ''></text:placeholder><text:line-break/><text:placeholder text:placeholder-type="text"><line.move_description or ''></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"><line.origin.rec_name if line.origin and line.origin.id >= 0 else ''></text:placeholder></text:p> + <text:p text:style-name="P10"><text:placeholder text:placeholder-type="text"><getattr(line.origin, 'rec_name', '')></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"><line.state_string></text:placeholder></text:p>