mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update po and common
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': "Sunpop Odooapp Common Func",
|
'name': "Sunpop Odooapp Common Func",
|
||||||
'version': '13.22.06.16',
|
'version': '13.22.08.21',
|
||||||
'author': 'Sunpop.cn',
|
'author': 'Sunpop.cn',
|
||||||
'category': 'Base',
|
'category': 'Base',
|
||||||
'website': 'https://www.sunpop.cn',
|
'website': 'https://www.sunpop.cn',
|
||||||
|
|||||||
@@ -71,13 +71,15 @@ class Base(models.AbstractModel):
|
|||||||
|
|
||||||
def _app_dt2local(self, value, return_format=DEFAULT_SERVER_DATETIME_FORMAT):
|
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:
|
if not value:
|
||||||
return value
|
return value
|
||||||
if isinstance(value, datetime):
|
if isinstance(value, datetime):
|
||||||
value = value.strftime(return_format)
|
value = value.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
|
||||||
dt = datetime.strptime(value, return_format)
|
dt = datetime.strptime(value, DEFAULT_SERVER_DATETIME_FORMAT)
|
||||||
user_tz = pytz.timezone(self.env.user.tz or 'Etc/GMT-8')
|
user_tz = pytz.timezone(self.env.user.tz or 'Etc/GMT-8')
|
||||||
# _logger.warning('============= user2 tz: %s' % user_tz)
|
# _logger.warning('============= user2 tz: %s' % user_tz)
|
||||||
dt = dt.replace(tzinfo=pytz.timezone('UTC'))
|
dt = dt.replace(tzinfo=pytz.timezone('UTC'))
|
||||||
@@ -90,8 +92,8 @@ class Base(models.AbstractModel):
|
|||||||
if not value:
|
if not value:
|
||||||
return value
|
return value
|
||||||
if isinstance(value, datetime):
|
if isinstance(value, datetime):
|
||||||
value = value.strftime(return_format)
|
value = value.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
|
||||||
dt = datetime.strptime(value, return_format)
|
dt = datetime.strptime(value, DEFAULT_SERVER_DATETIME_FORMAT)
|
||||||
pytz_timezone = pytz.timezone('Etc/GMT+8')
|
pytz_timezone = pytz.timezone('Etc/GMT+8')
|
||||||
dt = dt.replace(tzinfo=pytz.timezone('UTC'))
|
dt = dt.replace(tzinfo=pytz.timezone('UTC'))
|
||||||
return dt.astimezone(pytz_timezone).strftime(return_format)
|
return dt.astimezone(pytz_timezone).strftime(return_format)
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<data noupdate="0">
|
<data noupdate="0">
|
||||||
<!--系统设置默认值,每次更新模块时要更新-->
|
<!--系统设置默认值,每次更新模块时要更新-->
|
||||||
<!--设置 多公司 【启用】-->
|
<!--设置 多公司 【启用】-->
|
||||||
<record id="base.group_user" model="res.groups">
|
<!-- <record id="base.group_user" model="res.groups">-->
|
||||||
<field name="implied_ids"
|
<!-- <field name="implied_ids"-->
|
||||||
eval="[
|
<!-- eval="[-->
|
||||||
(3, ref('base.group_multi_company')),
|
<!-- (3, ref('base.group_multi_company')),-->
|
||||||
]"/>
|
<!-- ]"/>-->
|
||||||
</record>
|
<!-- </record>-->
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -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_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_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_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_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_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
|
account_1132,1132,应收利息,,TRUE,account.data_account_type_receivable,account_group_1,,l10n_chart_china_standard_business_latest
|
||||||
|
|||||||
|
@@ -68,7 +68,7 @@ class AccountChartTemplate(models.Model):
|
|||||||
('chart_template_id', '=', self.id),
|
('chart_template_id', '=', self.id),
|
||||||
('parent_id', '!=', False)
|
('parent_id', '!=', False)
|
||||||
], limit=1)
|
], 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
|
parent_code = parent_account[0].parent_id.code
|
||||||
if parent_code:
|
if parent_code:
|
||||||
parent = self.env['account.account'].sudo().search([
|
parent = self.env['account.account'].sudo().search([
|
||||||
|
|||||||
Reference in New Issue
Block a user