How do I add new state and change the workflow of Purchase Order?
来源:互联网 发布:淘宝图片设计原则 编辑:程序博客网 时间:2024/05/16 23:01
原文: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 purchase.order
and redefine the state field by adding or removing states. The following example adds new_state
state:
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 referencepurchase
module 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_confirmed
transition 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>
- How do I add new state and change the workflow of Purchase Order?
- Lotus Workflow 如何複製工作屬性 How do I copy the job of property
- the state of workflow
- The state of workflow
- 变化太快,how can I do and change it?
- How do I change the default runlevel in Feodra 15?
- How do I set or change the PATH system variable?
- Can I change the order of items in category views?
- The State of Workflow by Tom Baeyens
- The State of Workflow by Tom Baeyens
- How do I like the idea of cloning?
- how do I get the instance of sun.misc.Unsafe
- How Do I Compare Two Files and Show The Differences?
- Office - How do I change user name of Office for Mac 2011
- How do I change the FROM address to a friendly name?
- How do I change the directory that MATLAB is initially started in?
- How do I change the Java Virtual Machine (JVM) that MATLAB is using?
- How do I add a component
- MyBatis-spring和spring JDBC批量插入Mysql的效率比较
- leetcode 198.213.337 House Robber
- JavaScript 语法简单描述
- transitionend animationend 事件兼容问题
- MySQL(基础篇)之存储过程
- How do I add new state and change the workflow of Purchase Order?
- List合并具有相同属性的对象
- Android开发中混淆代码总结
- 杭电OJ 2136 Largest prime factor
- python和编码
- 杭州市高层次人才住房保障实施意见
- yolo模型的批量测试和位置输出
- slf4j-api、slf4j-log4j12以及log4j之间什么关系?
- HTML5学习---新新手怎样在云主机上部署html5项目