Permalink
Browse files

review

  • Loading branch information...
tivisse committed Oct 18, 2017
1 parent 78873b4 commit 93c248ddafd4734c8c106d245d913aab2e7f8a6e
Showing with 4 additions and 26 deletions.
  1. +4 −16 addons/web/static/src/js/views/basic/basic_controller.js
  2. +0 −10 odoo/addons/base/ir/ir_translation.py
@@ -593,22 +593,10 @@ var BasicController = AbstractController.extend(FieldManagerMixin, {
}).then(function (result) {
self.do_action(result, {
on_reverse_breadcrumb: function () {
// If the term is translated in all the languages, do not show the Link into the translation alert info
self._rpc({
model: 'ir.translation',
method: 'is_remaining_translate_fields',
args: [record.model, record.res_id, event.data.fieldName, record.getContext()],
}).then(function (field) {
if (result) {
self.renderer.alertFields = _.filter(self.renderer.alertFields, function(alertField) {
return alertField.name != field
});
}
if (self.renderer.alertFields.length) {
self.renderer.displayTranslationAlert();
}
return false
});
if (self.renderer.alertFields.length) {
self.renderer.displayTranslationAlert();
}
return false
},
})
});
@@ -630,16 +630,6 @@ def insert_missing(self, field, records):
})
self._modified_model(field.model_name)
@api.model
def is_remaining_translate_fields(self, model, id, field):
action = self.translate_fields(model=model, id=id, field=field)
domain = action['domain'] + [('name', '=', "%s,%s" % (model, field))]
translate = self.env[action['res_model']].search(domain)
for record in translate:
if not record.state or record.state != 'translated':
return False
return field
@api.model
def translate_fields(self, model, id, field=None):
""" Open a view for translating the field(s) of the record (model, id). """

0 comments on commit 93c248d

Please sign in to comment.