mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update app_odoo_customize
This commit is contained in:
@@ -405,6 +405,27 @@ class AppThemeConfigSettings(models.TransientModel):
|
||||
pass # raise Warning(e)
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def remove_project(self):
|
||||
to_removes = [
|
||||
# 清除项目
|
||||
['account.analytic.line', ],
|
||||
['project.task', ],
|
||||
['project.forecast', ],
|
||||
['project.project', ],
|
||||
]
|
||||
try:
|
||||
for line in to_removes:
|
||||
obj_name = line[0]
|
||||
obj = self.pool.get(obj_name)
|
||||
if obj:
|
||||
sql = "delete from %s" % obj._table
|
||||
self._cr.execute(sql)
|
||||
# 更新序号
|
||||
except Exception as e:
|
||||
pass # raise Warning(e)
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def remove_message(self):
|
||||
to_removes = [
|
||||
@@ -441,3 +462,17 @@ class AppThemeConfigSettings(models.TransientModel):
|
||||
except Exception as e:
|
||||
pass # raise Warning(e)
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def remove_all_biz(self):
|
||||
try:
|
||||
self.remove_sales()
|
||||
self.remove_purchase()
|
||||
self.remove_account()
|
||||
self.remove_mrp()
|
||||
self.remove_inventory()
|
||||
self.remove_project()
|
||||
self.remove_message()
|
||||
except Exception as e:
|
||||
pass # raise Warning(e)
|
||||
return True
|
||||
|
||||
@@ -94,21 +94,21 @@
|
||||
</group>
|
||||
<group name="data-clean" string="Data Cleaning (Be careful to do that!)">
|
||||
<label string="Sales"/>
|
||||
<div>
|
||||
<div class="mb4">
|
||||
<button string="Delete All Sales Order" type="object" name="remove_sales"
|
||||
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
</div>
|
||||
<label string="POS"/>
|
||||
<div>
|
||||
<div class="mb4">
|
||||
<button string="Delete All POS Order" type="object" name="remove_pos" confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
</div>
|
||||
<label string="Purchase"/>
|
||||
<div>
|
||||
<div class="mb4">
|
||||
<button string="Delete All Purchase Order and Requisition" type="object" name="remove_purchase"
|
||||
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
</div>
|
||||
<label string="MRP"/>
|
||||
<div>
|
||||
<div class="mb4">
|
||||
<button string="Delete All Manufacturing Order" type="object" name="remove_mrp"
|
||||
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
|
|
||||
@@ -116,17 +116,22 @@
|
||||
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
</div>
|
||||
<label string="Inventory"/>
|
||||
<div>
|
||||
<div class="mb4">
|
||||
<button string="Delete All Move/Picking/Package/Lot" type="object" name="remove_inventory"
|
||||
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
</div>
|
||||
<label string="Accounting"/>
|
||||
<div>
|
||||
<div class="mb4">
|
||||
<button string="Delete All Voucher/Invoice/Bill" type="object" name="remove_account"
|
||||
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
</div>
|
||||
<label string="Project"/>
|
||||
<div class="mb4">
|
||||
<button string="Delete All Project/Task/Forecast" type="object" name="remove_project"
|
||||
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
</div>
|
||||
<label string="Base Models"/>
|
||||
<div>
|
||||
<div class="mb4">
|
||||
<button string="Delete All Product" type="object" name="remove_product"
|
||||
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
|
|
||||
@@ -139,6 +144,11 @@
|
||||
<button string="Delete All Workflow" type="object" name="remove_workflow"
|
||||
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
</div>
|
||||
<label string="All Business"/>
|
||||
<div class="mb4">
|
||||
<button string="Delete All MRP/Sale/Purchase/Account/MRP/Inventory/Project/Message/Workflow" type="object" name="remove_all_biz"
|
||||
confirm="Please confirm to delete the select data?" class="oe_highlight"/>
|
||||
</div>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user