diff --git a/app_odoo_customize/models/res_config_settings.py b/app_odoo_customize/models/res_config_settings.py index cda5a0c9..d24da809 100644 --- a/app_odoo_customize/models/res_config_settings.py +++ b/app_odoo_customize/models/res_config_settings.py @@ -364,17 +364,18 @@ class ResConfigSettings(models.TransientModel): sql2 = "update account_journal set bank_account_id=NULL where company_id=%d;" % company_id self._cr.execute(sql) self._cr.execute(sql2) + self._cr.commit() except Exception as e: _logger.error('remove data error: %s,%s', 'account_chart: set tax and account_journal', e) - try: - # 增加对 pos的处理 - sql = ("update pos_config set journal_id=NULL;") - self._cr.execute(sql) - self._cr.commit() - except Exception as e: - pass + # 增加对 pos的处理 + if self.env['ir.model']._get('pos.config'): + self.env['pos.config'].write({ + 'journal_id': False, + }) + # todo: 以下处理参考 res.partner的合并,将所有m2o的都一次处理,不需要次次找模型 + # partner 处理 try: rec = self.env['res.partner'].search([]) for r in rec: @@ -384,6 +385,7 @@ class ResConfigSettings(models.TransientModel): }) except Exception as e: _logger.error('remove data error: %s,%s', 'account_chart', e) + # 品类处理 try: rec = self.env['product.category'].search([]) for r in rec: @@ -396,7 +398,18 @@ class ResConfigSettings(models.TransientModel): 'property_stock_valuation_account_id': None, }) except Exception as e: - pass # raise Warning(e) + pass + # 产品处理 + try: + rec = self.env['product.template'].search([]) + for r in rec: + r.write({ + 'property_account_income_id': None, + 'property_account_expense_id': None, + }) + except Exception as e: + pass + # 库存计价处理 try: rec = self.env['stock.location'].search([]) for r in rec: diff --git a/app_odoo_customize/static/description/index.html b/app_odoo_customize/static/description/index.html index 535756f8..ff616b36 100644 --- a/app_odoo_customize/static/description/index.html +++ b/app_odoo_customize/static/description/index.html @@ -48,6 +48,8 @@

This is a Long Term Support Apps.

Update: v14.21.03.31

+

Account date reset, and account chart reset support multi company reset.

+

Update: v14.21.03.30

38. Add Draggable Dialog enable.

37. Easy noupdate manage for External Identifiers(xml_id).

Update: v14.21.03.03

diff --git a/app_odoo_customize/views/app_theme_config_settings_views.xml b/app_odoo_customize/views/app_theme_config_settings_views.xml index 89a5cb7d..7b3a7c1b 100644 --- a/app_odoo_customize/views/app_theme_config_settings_views.xml +++ b/app_odoo_customize/views/app_theme_config_settings_views.xml @@ -143,8 +143,10 @@ confirm="Please confirm to delete the select data?" class="oe_highlight"/>
- Accounting - + + Accounting + +