Use source of translation in the unique_key of Translation objects

Closes #12467
This commit is contained in:
Nicolas Évrard
2023-08-11 18:40:32 +02:00
parent 9bd694e6bc
commit fbc05e3d22
+2 -4
View File
@@ -731,11 +731,9 @@ class Translation(ModelSQL, ModelView):
@property
def unique_key(self):
if self.type in {
'report', 'view', 'wizard_button', 'selection'}:
return (self.name, self.res_id, self.type, self.src)
elif self.type in ('field', 'model', 'help'):
if self.type == 'model':
return (self.name, self.res_id, self.type)
return (self.name, self.res_id, self.type, self.src)
@classmethod
def from_poentry(cls, entry):