mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
优化数据清理
This commit is contained in:
@@ -304,6 +304,9 @@ class AppThemeConfigSettings(models.TransientModel):
|
|||||||
['procurement.group', ],
|
['procurement.group', ],
|
||||||
]
|
]
|
||||||
try:
|
try:
|
||||||
|
# 为优化,增加处理
|
||||||
|
self._cr.execute("update stock_move set split_from=NULL;")
|
||||||
|
self._cr.execute("update stock_move set origin_returned_move_id=NULL;")
|
||||||
for line in to_removes :
|
for line in to_removes :
|
||||||
obj_name = line[0]
|
obj_name = line[0]
|
||||||
obj = self.pool.get(obj_name)
|
obj = self.pool.get(obj_name)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_app_theme_config_settings" model="ir.ui.view">
|
<record id="</" model="ir.ui.view">
|
||||||
<field name="name">App Odoo Customize Settings</field>
|
<field name="name">App Odoo Customize Settings</field>
|
||||||
<field name="model">app.theme.config.settings</field>
|
<field name="model">app.theme.config.settings</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
|||||||
@@ -36,6 +36,13 @@ class ProductTemplate(models.Model):
|
|||||||
default_code_stored = fields.Char('Internal Reference Stored',
|
default_code_stored = fields.Char('Internal Reference Stored',
|
||||||
default=lambda self: _('New'))
|
default=lambda self: _('New'))
|
||||||
|
|
||||||
|
# todo: 检查数据,要保证数据唯一性
|
||||||
|
_sql_constraints = [
|
||||||
|
('uniq_default_code',
|
||||||
|
'unique(default_code)',
|
||||||
|
'The reference must be unique'),
|
||||||
|
]
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def default_get(self, fields):
|
def default_get(self, fields):
|
||||||
context = self._context or {}
|
context = self._context or {}
|
||||||
|
|||||||
Reference in New Issue
Block a user