diff --git a/app_common/__manifest__.py b/app_common/__manifest__.py index d0d64b95..33b9c05b 100644 --- a/app_common/__manifest__.py +++ b/app_common/__manifest__.py @@ -33,7 +33,7 @@ { 'name': "Sunpop Odooapp Common Func", - 'version': '13.22.06.16', + 'version': '13.22.08.21', 'author': 'Sunpop.cn', 'category': 'Base', 'website': 'https://www.sunpop.cn', diff --git a/app_common/models/base.py b/app_common/models/base.py index 624b808b..d997d8c9 100644 --- a/app_common/models/base.py +++ b/app_common/models/base.py @@ -71,13 +71,15 @@ class Base(models.AbstractModel): def _app_dt2local(self, value, return_format=DEFAULT_SERVER_DATETIME_FORMAT): """ - 将value中时间,按格式转为用户本地时间.注意只处理in str为字符串类型,如果是时间类型直接用 datetime.now(tz) + 将value中时间,按格式转为用户本地时间.如果处理当天,是时间类型直接用 datetime.now(tz) + 输入:str或日期时间类型 + 输出: str """ if not value: return value if isinstance(value, datetime): - value = value.strftime(return_format) - dt = datetime.strptime(value, return_format) + value = value.strftime(DEFAULT_SERVER_DATETIME_FORMAT) + dt = datetime.strptime(value, DEFAULT_SERVER_DATETIME_FORMAT) user_tz = pytz.timezone(self.env.user.tz or 'Etc/GMT-8') # _logger.warning('============= user2 tz: %s' % user_tz) dt = dt.replace(tzinfo=pytz.timezone('UTC')) @@ -90,8 +92,8 @@ class Base(models.AbstractModel): if not value: return value if isinstance(value, datetime): - value = value.strftime(return_format) - dt = datetime.strptime(value, return_format) + value = value.strftime(DEFAULT_SERVER_DATETIME_FORMAT) + dt = datetime.strptime(value, DEFAULT_SERVER_DATETIME_FORMAT) pytz_timezone = pytz.timezone('Etc/GMT+8') dt = dt.replace(tzinfo=pytz.timezone('UTC')) return dt.astimezone(pytz_timezone).strftime(return_format) diff --git a/app_company_chart_hierarchy/security/res_group.xml b/app_company_chart_hierarchy/security/res_group.xml index 9e24c066..38463ca1 100644 --- a/app_company_chart_hierarchy/security/res_group.xml +++ b/app_company_chart_hierarchy/security/res_group.xml @@ -3,11 +3,11 @@ - - - + + + + + + \ No newline at end of file diff --git a/l10n_cn_standard_latest/data/account.account.template.csv b/l10n_cn_standard_latest/data/account.account.template.csv index c6695e47..dbeaff39 100644 --- a/l10n_cn_standard_latest/data/account.account.template.csv +++ b/l10n_cn_standard_latest/data/account.account.template.csv @@ -10,7 +10,7 @@ account_1101,1101,交易性金融资产,,FALSE,account.data_account_type_current account_1111,1111,买入返售金融资产,,FALSE,account.data_account_type_current_assets,account_group_1,tag23,l10n_chart_china_standard_business_latest account_1121,1121,应收票据,,TRUE,account.data_account_type_receivable,account_group_1,,l10n_chart_china_standard_business_latest account_1122,1122,应收账款,,TRUE,account.data_account_type_receivable,account_group_1,,l10n_chart_china_standard_business_latest -account_1123,1123,预付账款,,TRUE,account.data_account_type_receivable,account_group_1,,l10n_chart_china_standard_business_latest +account_1123,1123,预付账款,,TRUE,account.data_account_type_prepayments,account_group_1,,l10n_chart_china_standard_business_latest account_1124,1124,应收账款(PoS),,TRUE,account.data_account_type_receivable,account_group_1,,l10n_chart_china_standard_business_latest account_1131,1131,应收股利,,TRUE,account.data_account_type_receivable,account_group_1,,l10n_chart_china_standard_business_latest account_1132,1132,应收利息,,TRUE,account.data_account_type_receivable,account_group_1,,l10n_chart_china_standard_business_latest diff --git a/l10n_cn_standard_latest/models/account_chart_template.py b/l10n_cn_standard_latest/models/account_chart_template.py index d7b0d03c..47fa5bca 100644 --- a/l10n_cn_standard_latest/models/account_chart_template.py +++ b/l10n_cn_standard_latest/models/account_chart_template.py @@ -68,7 +68,7 @@ class AccountChartTemplate(models.Model): ('chart_template_id', '=', self.id), ('parent_id', '!=', False) ], limit=1) - if len(parent_account) or code == '2221.01.01': + if len(parent_account) or code == '22210101' or code == '2221.01.01': parent_code = parent_account[0].parent_id.code if parent_code: parent = self.env['account.account'].sudo().search([