Odoo中文社区可以通过以下三个域名访问:shine-it.net , odoocn.org,odoo.net.cn

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

实用脚本:OpenERP基础篇-新手入门-业务模拟-清除模拟数据反复测试-OpenERPV6



  • OpenERP基础篇-新手入门-业务模拟-数据清除<br /><br /><br />使用场景:<br /> 建好了一个帐套,做了很多业务模拟,现在想重新开始,又不想再重新建帐套. <br /> 其中,只想清除销售,采购,库存,会计模块的一些业务数据,产品、客户、供应商和基础配置保留,如果是这样,就可以使用下面的SQL脚本。<br /><br />[b]<br />[size=14pt][color=red]申明:<br /> 使用有风险,操作需谨慎。<br /> 操作前先备份数据!!![/color][/size][/b]<br /><br /><br />--会计部分<br />TRUNCATE table account_invoice CASCADE;<br />TRUNCATE table account_invoice_line CASCADE;<br />TRUNCATE table account_invoice_line_tax CASCADE;<br />TRUNCATE table account_invoice_tax CASCADE;<br />TRUNCATE table account_move CASCADE;<br />TRUNCATE table account_move_line CASCADE;<br />TRUNCATE table account_move_reconcile CASCADE;<br /><br />TRUNCATE table account_balance_report_journal_rel CASCADE;<br />TRUNCATE table account_bank_accounts_wizard CASCADE;<br />TRUNCATE table account_bank_statement CASCADE;<br />TRUNCATE table account_bank_statement_line CASCADE;<br />TRUNCATE table account_bank_statement_line_move_rel CASCADE;<br />TRUNCATE table account_cashbox_line CASCADE;<br />TRUNCATE table account_invoice CASCADE;<br />TRUNCATE table account_invoice_line CASCADE;<br />TRUNCATE table account_invoice_refund CASCADE;<br />TRUNCATE table account_voucher CASCADE;<br />TRUNCATE table account_voucher_line CASCADE;<br /><br /><br />TRUNCATE table payment_order CASCADE;<br /><br />--POS模块<br />TRUNCATE table pos_order CASCADE;<br />TRUNCATE table pos_order_line CASCADE;<br />TRUNCATE table pos_make_payment CASCADE;<br />TRUNCATE table pos_close_statement CASCADE;<br />TRUNCATE table pos_box_entries CASCADE;<br />TRUNCATE table pos_receipt CASCADE;<br />TRUNCATE table pos_confirm CASCADE;<br />TRUNCATE table pos_details CASCADE;<br />TRUNCATE table pos_open_statement CASCADE;<br /><br />--采购模块<br />TRUNCATE table purchase_order CASCADE;<br />TRUNCATE table purchase_order_line CASCADE;<br />TRUNCATE table purchase_order_taxe CASCADE;<br /><br /><br />--销售模块<br />TRUNCATE table sale_order CASCADE;<br />TRUNCATE table sale_order_invoice_rel CASCADE;<br />TRUNCATE table sale_order_line CASCADE;<br />TRUNCATE table sale_order_line_invoice_rel CASCADE;<br />TRUNCATE table sale_order_line_property_rel CASCADE;<br />TRUNCATE table sale_order_tax CASCADE;<br /><br /><br />--库存模块<br />TRUNCATE table stock_inventory CASCADE;<br />TRUNCATE table stock_inventory_line CASCADE;<br />TRUNCATE table stock_inventory_move_rel CASCADE;<br />TRUNCATE table stock_move CASCADE;<br />TRUNCATE table stock_move_history_ids CASCADE;<br />TRUNCATE table stock_picking CASCADE; <br /><br /><br />TRUNCATE table procurement_order CASCADE;<br />TRUNCATE table procurement_order_compute CASCADE;<br />TRUNCATE table procurement_order_compute_all CASCADE;<br />TRUNCATE table procurement_orderpoint_compute CASCADE;<br />TRUNCATE table procurement_property_rel CASCADE;<br /><br /><br />TRUNCATE table res_log CASCADE;<br />TRUNCATE table mail_message CASCADE;<br /><br />--CRM模块<br />TRUNCATE table crm_lead CASCADE;<br />TRUNCATE table crm_meeting CASCADE;<br />TRUNCATE table crm_make_sale CASCADE;<br />TRUNCATE table crm_phonecall CASCADE;<br />TRUNCATE table crm_segmentation_line CASCADE;<br /><br />TRUNCATE table edi_document CASCADE;<br />TRUNCATE table detail_ledger CASCADE;<br /><br />--HR模块<br />TRUNCATE table hr_sign_in_out CASCADE;<br />TRUNCATE table hr_sign_in_out_ask CASCADE;<br />TRUNCATE table hr_sign_in_project CASCADE;<br />TRUNCATE table hr_sign_out_project CASCADE;<br /><br /><br />看累了,可以下载文档PDF<br /><br />[attach=1]



  • OpenERP基础篇-新手入门-业务模拟-数据清除<br /><br /><br />使用场景:<br /> 建好了一个帐套,做了很多业务模拟,现在想重新开始,又不想再重新建帐套. <br /> 其中,只想清除销售,采购,库存,会计模块的一些业务数据,产品、客户、供应商和基础配置保留,如果是这样,就可以使用下面的SQL脚本。<br /><br />[b]<br />[size=14pt][color=red]申明:<br /> 使用有风险,操作需谨慎。<br /> 操作前先备份数据!!![/color][/size][/b]<br /><br /><br />--会计部分<br />TRUNCATE table account_invoice CASCADE;<br />TRUNCATE table account_invoice_line CASCADE;<br />TRUNCATE table account_invoice_line_tax CASCADE;<br />TRUNCATE table account_invoice_tax CASCADE;<br />TRUNCATE table account_move CASCADE;<br />TRUNCATE table account_move_line CASCADE;<br />TRUNCATE table account_move_reconcile CASCADE;<br /><br />TRUNCATE table account_balance_report_journal_rel CASCADE;<br />TRUNCATE table account_bank_accounts_wizard CASCADE;<br />TRUNCATE table account_bank_statement CASCADE;<br />TRUNCATE table account_bank_statement_line CASCADE;<br />TRUNCATE table account_bank_statement_line_move_rel CASCADE;<br />TRUNCATE table account_cashbox_line CASCADE;<br />TRUNCATE table account_invoice CASCADE;<br />TRUNCATE table account_invoice_line CASCADE;<br />TRUNCATE table account_invoice_refund CASCADE;<br />TRUNCATE table account_voucher CASCADE;<br />TRUNCATE table account_voucher_line CASCADE;<br /><br /><br />TRUNCATE table payment_order CASCADE;<br /><br />--POS模块<br />TRUNCATE table pos_order CASCADE;<br />TRUNCATE table pos_order_line CASCADE;<br />TRUNCATE table pos_make_payment CASCADE;<br />TRUNCATE table pos_close_statement CASCADE;<br />TRUNCATE table pos_box_entries CASCADE;<br />TRUNCATE table pos_receipt CASCADE;<br />TRUNCATE table pos_confirm CASCADE;<br />TRUNCATE table pos_details CASCADE;<br />TRUNCATE table pos_open_statement CASCADE;<br /><br />--采购模块<br />TRUNCATE table purchase_order CASCADE;<br />TRUNCATE table purchase_order_line CASCADE;<br />TRUNCATE table purchase_order_taxe CASCADE;<br /><br /><br />--销售模块<br />TRUNCATE table sale_order CASCADE;<br />TRUNCATE table sale_order_invoice_rel CASCADE;<br />TRUNCATE table sale_order_line CASCADE;<br />TRUNCATE table sale_order_line_invoice_rel CASCADE;<br />TRUNCATE table sale_order_line_property_rel CASCADE;<br />TRUNCATE table sale_order_tax CASCADE;<br /><br /><br />--库存模块<br />TRUNCATE table stock_inventory CASCADE;<br />TRUNCATE table stock_inventory_line CASCADE;<br />TRUNCATE table stock_inventory_move_rel CASCADE;<br />TRUNCATE table stock_move CASCADE;<br />TRUNCATE table stock_move_history_ids CASCADE;<br />TRUNCATE table stock_picking CASCADE; <br /><br /><br />TRUNCATE table procurement_order CASCADE;<br />TRUNCATE table procurement_order_compute CASCADE;<br />TRUNCATE table procurement_order_compute_all CASCADE;<br />TRUNCATE table procurement_orderpoint_compute CASCADE;<br />TRUNCATE table procurement_property_rel CASCADE;<br /><br /><br />TRUNCATE table res_log CASCADE;<br />TRUNCATE table mail_message CASCADE;<br /><br />--CRM模块<br />TRUNCATE table crm_lead CASCADE;<br />TRUNCATE table crm_meeting CASCADE;<br />TRUNCATE table crm_make_sale CASCADE;<br />TRUNCATE table crm_phonecall CASCADE;<br />TRUNCATE table crm_segmentation_line CASCADE;<br /><br />TRUNCATE table edi_document CASCADE;<br />TRUNCATE table detail_ledger CASCADE;<br /><br />--HR模块<br />TRUNCATE table hr_sign_in_out CASCADE;<br />TRUNCATE table hr_sign_in_out_ask CASCADE;<br />TRUNCATE table hr_sign_in_project CASCADE;<br />TRUNCATE table hr_sign_out_project CASCADE;<br /><br /><br />看累了,可以下载文档PDF<br /><br />[attach=1]



  • 主要是自己经常用,希望对大家有所帮助.



  • 这个不错,可以推荐使用



  • 不错.... 能给贴子加上标签(Tag) 就更棒了哇. ....



  • [quote author=mrshelly link=topic=4190.msg11309#msg11309 date=1338991829]<br />不错.... 能给贴子加上标签(Tag) 就更棒了哇. ....<br />[/quote]<br /><br /> :D 已添加


登录后回复
 

与 Odoo 中文社区 的连接断开,我们正在尝试重连,请耐心等待