From dae7f8d8d303eef12e192b2a820892fa5fbd2cbf Mon Sep 17 00:00:00 2001 From: ivan deng Date: Tue, 17 Aug 2021 11:59:31 +0800 Subject: [PATCH] update translate and ent --- app_common/models/base.py | 44 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/app_common/models/base.py b/app_common/models/base.py index a621ed65..fe928793 100644 --- a/app_common/models/base.py +++ b/app_common/models/base.py @@ -9,9 +9,51 @@ from io import BytesIO from datetime import date, datetime, time import pytz +# 常规的排除的fields +EXCLU_FIELDS = [ + '__last_update', + 'access_token', + 'access_url', + 'access_warning', + 'activity_date_deadline', + 'activity_exception_decoration', + 'activity_exception_icon', + 'activity_ids', + 'activity_state', + 'activity_summary', + 'activity_type_id', + 'activity_user_id', + 'display_name', + 'message_attachment_count', + 'message_channel_ids', + 'message_follower_ids', + 'message_has_error', + 'message_has_error_counter', + 'message_has_sms_error', + 'message_ids', + 'message_is_follower', + 'message_main_attachment_id', + 'message_needaction', + 'message_needaction_counter', + 'message_partner_ids', + 'message_unread', + 'message_unread_counter', + 'website_message_ids', + 'write_date', + 'write_uid', +] + class Base(models.AbstractModel): _inherit = 'base' - + + @api.model + def _get_normal_fields(self): + f_list = [] + for k, v in self._fields.items(): + if k not in EXCLU_FIELDS: + f_list.append(k) + return f_list + @api.model def _app_get_m2o_default(self, fieldname, domain=[]): if hasattr(self, fieldname) and self._fields[fieldname].type == 'many2one':