From 865a6f5193775f5f744c4b33db57f30f8826cba9 Mon Sep 17 00:00:00 2001 From: Jakkrich Changgon Date: Mon, 18 Mar 2019 16:32:02 +0700 Subject: [PATCH 1/2] =?UTF-8?q?FIX=20CSS=20=E0=B9=83=E0=B8=AB=E0=B9=89?= =?UTF-8?q?=E0=B8=AA=E0=B8=B2=E0=B8=A1=E0=B8=B2=E0=B8=A3=E0=B8=96=E0=B8=81?= =?UTF-8?q?=E0=B8=94=E0=B8=9B=E0=B8=B8=E0=B9=88=E0=B8=A1=E0=B9=81=E0=B8=9B?= =?UTF-8?q?=E0=B8=A5=E0=B8=A0=E0=B8=B2=E0=B8=A9=E0=B8=B2=E0=B9=84=E0=B8=94?= =?UTF-8?q?=E0=B9=89=E0=B8=87=E0=B9=88=E0=B8=B2=E0=B8=A2=E0=B8=82=E0=B8=B6?= =?UTF-8?q?=E0=B9=89=E0=B8=99=20FIX=20=E0=B8=9F=E0=B8=B4=E0=B8=A5=20Respon?= =?UTF-8?q?sible=20=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B9=81=E0=B8=AA=E0=B8=94?= =?UTF-8?q?=E0=B8=87=E0=B9=80=E0=B8=89=E0=B8=9E=E0=B8=B2=E0=B8=B0=E0=B8=A0?= =?UTF-8?q?=E0=B8=B2=E0=B8=A9=E0=B8=B2=E0=B9=84=E0=B8=97=E0=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_translate_dialog/__init__.py | 1 + web_translate_dialog/res_users.py | 18 ++++++++++++++++++ web_translate_dialog/static/src/css/base.css | 4 ++++ 3 files changed, 23 insertions(+) create mode 100644 web_translate_dialog/res_users.py diff --git a/web_translate_dialog/__init__.py b/web_translate_dialog/__init__.py index 181529c..dcafc5e 100755 --- a/web_translate_dialog/__init__.py +++ b/web_translate_dialog/__init__.py @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- from . import models +from . import res_users # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/web_translate_dialog/res_users.py b/web_translate_dialog/res_users.py new file mode 100644 index 0000000..7dcc3f6 --- /dev/null +++ b/web_translate_dialog/res_users.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from openerp.tools.translate import _ +from openerp import models, fields, api + + +class res_users(models.Model): + _inherit = "res.users" + + @api.multi + def name_get(self): + res = [] + for rec in self: + name = self.env['ir.translation'].search([['name','=','res.users,name'],['type','=','model'],['res_id','=',rec.partner_id.id]], limit=1) + if name: + res.append((rec.id, '%s' % (name.value))) + else: + res.append((rec.id, '%s' % (rec.partner_id.name))) + return res diff --git a/web_translate_dialog/static/src/css/base.css b/web_translate_dialog/static/src/css/base.css index 8f88484..5a368ca 100755 --- a/web_translate_dialog/static/src/css/base.css +++ b/web_translate_dialog/static/src/css/base.css @@ -4,3 +4,7 @@ .openerp .oe_translation_field.touched { border: 1px solid green !important; } + +.openerp .oe_form input[type="text"], .openerp .oe_form input[type="password"], .openerp .oe_form input[type="file"], .openerp .oe_form select, .openerp .oe_form textarea{ + padding-right: 24px; +} \ No newline at end of file From 410199adf8f8caeb7adbb268348d8411cc374a2e Mon Sep 17 00:00:00 2001 From: Jakkrich Changgon Date: Tue, 19 Mar 2019 13:14:46 +0700 Subject: [PATCH 2/2] =?UTF-8?q?fix=20model=20name=20=E0=B9=81=E0=B8=9B?= =?UTF-8?q?=E0=B8=A5=E0=B8=A0=E0=B8=B2=E0=B8=A9=E0=B8=B2=E0=B9=84=E0=B8=97?= =?UTF-8?q?=E0=B8=A2=20=E0=B9=80=E0=B8=9B=E0=B9=87=E0=B8=99=20res=5Fpartne?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_translate_dialog/res_users.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web_translate_dialog/res_users.py b/web_translate_dialog/res_users.py index 7dcc3f6..8f7e8bc 100644 --- a/web_translate_dialog/res_users.py +++ b/web_translate_dialog/res_users.py @@ -10,7 +10,13 @@ class res_users(models.Model): def name_get(self): res = [] for rec in self: - name = self.env['ir.translation'].search([['name','=','res.users,name'],['type','=','model'],['res_id','=',rec.partner_id.id]], limit=1) + # Fix for Responsible Show Thai Only + name = self.env['ir.translation'].search( + [['lang','=','th_TH'], + ['name','=','res.partner,name'], + ['type','=','model'], + ['res_id','=',rec.partner_id.id]], limit=1 + ) if name: res.append((rec.id, '%s' % (name.value))) else: