changeset 409ed6796a4a in modules/purchase:default details: https://hg.tryton.org/modules/purchase?cmd=changeset&node=409ed6796a4a description: Use product record name for supplier product without name nor code
issue11532 review433201003 diffstat: product.py | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diffs (31 lines): diff -r d5fed246f6bf -r 409ed6796a4a product.py --- a/product.py Tue May 31 23:57:32 2022 +0200 +++ b/product.py Tue Jun 21 23:40:00 2022 +0200 @@ -360,14 +360,20 @@ self.currency, = row def get_rec_name(self, name): - if self.name: - name = self.name - elif self.product: - name = self.product.name + if not self.name and not self.code: + if self.product: + name = self.product.rec_name + else: + name = self.template.rec_name else: - name = self.template.name - if self.code: - name = '[' + self.code + '] ' + name + if self.name: + name = self.name + elif self.product: + name = self.product.name + else: + name = self.template.name + if self.code: + name = '[' + self.code + ']' + name return name @classmethod