How do I add new state and change the workflow of Purchase Order?
2016-06-16 20:00
447 查看
原文:https://www.odoo.com/forum/help-1/question/how-do-i-add-new-state-and-change-the-workflow-of-purchase-order-5118
You need to inherit
states. The following example adds
check this question about sales order for
a possible issue if other modules are also modifying the state field .
To modify the workflow, you can add new workflow items or modify existing items using xml records that reference
records. Note that you need to add
you are modifying. The following example adds a new activity and modifies
to the purchase order:
You need to inherit
purchase.orderand redefine the state field by adding or removing
states. The following example adds
new_statestate:
class purchase_order(osv.osv): _inherit = 'purchase.order' STATE_SELECTION = [ ('new_state', 'New State'), ('draft', 'Draft PO'), ('sent', 'RFQ Sent'), ('confirmed', 'Waiting Approval'), ('approved', 'Purchase Order'), ('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled') ] _columns = { 'state': fields.selection(STATE_SELECTION, 'Status', readonly=True, help="The status of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' status. Then the order has to be confirmed by the user, the status switch to 'Confirmed'. Then the supplier must confirm the order to change the status to 'Approved'. When the purchase order is paid and received, the status becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the status becomes in exception.", select=True), } sale_order()
check this question about sales order for
a possible issue if other modules are also modifying the state field .
To modify the workflow, you can add new workflow items or modify existing items using xml records that reference
purchasemodule
records. Note that you need to add
module_name.prefix to any id defined in the module
you are modifying. The following example adds a new activity and modifies
trans_sent_confirmedtransition
to the purchase order:
<record id="act_new_state" model="workflow.activity"> <field name="wkf_id" ref="purchase.purchase_order"/> <field name="name">new_state</field> <field name="kind">function</field> <field name="action">write({'state':'new_state'})</field> </record> <record id="purchase.trans_sent_confirmed" model="workflow.transition"> <field name="act_from" ref="purchase.act_sent"/> <field name="act_to" ref="act_new_state"/> <field name="signal">purchase_confirm</field> </record>
相关文章推荐
- odoo 中多币种处理(外币处理)
- odoo采购业务流程要点
- 销售提成的模块
- odoo凭证自动生成问题和如何查明细账?
- OpenERP7.0社区维护的产品相关的增强模块
- OpenERP中多币种处理(外币处理)
- 禁止显示“OpenERP Apps Unreachable”警告信息
- oe7.解决自定义附件字段下载时无文件名
- odoo 财务会计相关介绍
- odoo退货流程
- odoo base模块听课笔记
- odoo预付款处理流程
- openerp财务报表说明
- RML报表的网格内容自动换行
- openerp7 增加出货检查库位
- odoo开发之坑
- odoo开发之坑
- OpenERP Web Client设置闲置有效时间
- odoo 选择客户时解决同时出现公司和联系人的问题
- 上海寰享十二月培训信息