mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-21 21:11:59 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
|
|
@ -3,18 +3,35 @@
|
|||
|
||||
from odoo import models
|
||||
|
||||
class BaseModel(models.AbstractModel):
|
||||
|
||||
class Base(models.AbstractModel):
|
||||
_inherit = 'base'
|
||||
|
||||
def get_field_translations(self, field_name, langs=None):
|
||||
""" get model/model_term translations for records with transifex url
|
||||
"""
|
||||
Get model/model_term translations for records with transifex url
|
||||
|
||||
:param str field_name: field name
|
||||
:param list langs: languages
|
||||
|
||||
:return: (translations, context) where
|
||||
translations: list of dicts like [{"lang": lang, "source": source_term, "value": value_term,
|
||||
"module": module, "transifexURL": transifex_url}]
|
||||
context: {"translation_type": "text"/"char", "translation_show_source": True/False}
|
||||
:return: a 2-items tuple ``(translations, context)`` where
|
||||
|
||||
translations:
|
||||
list of dicts like::
|
||||
|
||||
[{
|
||||
"lang": lang,
|
||||
"source": source_term,
|
||||
"value": value_term,
|
||||
"module": module,
|
||||
"transifexURL": transifex_url
|
||||
}]
|
||||
|
||||
context:
|
||||
dict like::
|
||||
|
||||
{"translation_type": "text"/"char",
|
||||
"translation_show_source": True/False}
|
||||
"""
|
||||
translations, context = super().get_field_translations(field_name, langs=langs)
|
||||
external_id = self.get_external_id().get(self.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue