mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
add delete bom
This commit is contained in:
@@ -157,6 +157,25 @@ class AppThemeConfigSettings(models.TransientModel):
|
||||
['mrp.production.workcenter.line', ],
|
||||
['mrp.production', ],
|
||||
['mrp.production.product.line', ],
|
||||
['mrp.unbuild', ],
|
||||
]
|
||||
try:
|
||||
for line in to_removes :
|
||||
obj_name = line[0]
|
||||
obj = self.pool.get(obj_name)
|
||||
if obj and obj._table_exist:
|
||||
sql = "delete from %s" % obj._table
|
||||
self._cr.execute( sql)
|
||||
except Exception, e:
|
||||
raise Warning(e)
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def remove_mrp_bom(self):
|
||||
to_removes = [
|
||||
# 清除生产BOM
|
||||
['mrp.bom.line', ],
|
||||
['mrp.bom', ],
|
||||
]
|
||||
try:
|
||||
for line in to_removes :
|
||||
|
||||
Reference in New Issue
Block a user