This question has been flagged
3467 Views

I am having these codes:

```

class PurchaseOrder(models.Model):
_inherit = 'purchase.order'



state = fields.Selection(selection_add=[

('approved_finance', 'Approved By Finance Manager'),

('approved_manager', 'Approved By Manager'),

])


@api.constrains('partner_ref')

def _hello_world(self):

raise Warning('Hello World')

```


I am looking at this article: https://aasimania.wordpress.com/2011/12/11/inheriting-workflows-in-openerp/. Looking there, I need to define workflow.activity and workflow.transition. How can I inherit the workflow.transition that already available for model purchase.order?

```

<record id=”trans_act_draft_approval” model=”workflow.transition”>

<field name=”act_from” ref=”sale.act_draft”/>

<field name=”act_to” ref=”act_approval”/>

<field name=”signal”>confirm_approve</field>

</record>

```


How can I have any information on sale.act_draft, for example (especially for what are there for purchase.order)?


EDIT 1: I am using Odoo 12 CE

Avatar
Discard

which odoo version are you using ? For new API we don't need to define workflow and transitions.

Author

Oh sorry, I am using Odoo 12 CE.

Author

Found the solution here: https://www.youtube.com/watch?v=lPHWsw3Iclk. Good video, people coming by looking for an answer from related topic better look at this YouTube video.