Last active
May 29, 2018 10:12
-
-
Save tienhieuD/99269a3fea634d5f90e6743ddec5e8a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_selection_name(env, model, field, value): | |
return dict(env[model].fields_get(field, 'selection').get(field, {}).get('selection',{})).get(value) | |
# usage | |
get_selection_name(request.env, 'sale.order', 'general_status', 'picking') # 'Đang lấy hàng' | |
get_selection_name(self.env, 'sale.order', 'general_status', 'picking') # 'Đang lấy hàng' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment