Navi
Navi

Reputation: 1052

How to inherit and add new state on a default module in odoo?

i am using odoo 10. Here i want to add an extra state in purchase module.Current states are open,draft and done. I want to add another state named new. How can i achieve this?

Upvotes: 1

Views: 1141

Answers (2)

Prakash Bhadiyatar
Prakash Bhadiyatar

Reputation: 21

state = fields.Selection(selection_add=[('remove','Removed'),('payment','PAYMENT'),('approved','APPROVED')])

in xml.

<xpath expr="//field[@name='state']" position="replace">
                <field name="state" widget="statusbar"/>

Upvotes: 0

KbiR
KbiR

Reputation: 4174

Use selection_add attribute.

Try below code:

state = fields.Selecion(selection_add=[('new_state','New State')])

Hope this will help you.

Upvotes: 5

Related Questions