Skip to Content
Menu
This question has been flagged
1290 Views

suppose I have a model merchant and need to change the state field of the merchant. 

I Created a wizard and a models.Transient which has a field state. now how can i change state in merchant model. wizard opens in form view of merchant. 

 

class MerchantStatusUpdate(models.TransientModel):
_name = 'extended_ecommerce.merchant_state'

stateUpdate = fields.Selection([
("pending" , "Pending"),
("verified", "Verified"),
('accept', "Accept"),
('rejected', 'Rejected'),
], default='pending', string="State")


def setState(self):
return


***record xml is in the comment

Avatar
Discard
Author

<record id="merchant_status_update_form" model="ir.ui.view">

<field name="name">extended_ecommerce.merchant_state.name</field>

<field name="model">extended_ecommerce.merchant_state</field>

<field name="arch" type="xml">

<form string="State Update">

<group>

<field name="stateUpdate"/>

</group>

<footer>

<button name="setState" string="Set" />

</footer>

</form>

</field>

</record>

<record id="merchant_status_update" model="ir.actions.act_window">

<field name="name">State Update</field>

<field name="type">ir.actions.act_window</field>

<field name="res_model">extended_ecommerce.merchant_state</field>

<field name="view_mode">form</field>

<field name="view_id" ref="merchant_status_update_form"/>

<field name="target">new</field>

</record>

<button name="%(merchant_status_update)d" string="State" type="action" />

Related Posts Replies Views Activity
1
Nov 24
1487
1
Nov 24
1198
2
Sep 24
1047
1
Aug 24
2459
3
Aug 24
2687