Skip to Content
Menu
This question has been flagged
1 Reply
10119 Views

Hii!!!!!

Can anyone help me know how to insert the button 'Save & Close' in a popup.

Thanks a lot in advance.

Best regards.    

Avatar
Discard
Best Answer

hi, see this code

@api.multi 
def action_save(self):     #your code     self.ensure_one()     #close popup     return {'type': 'ir.actions.act_window_close'}
<odoo>
<record id="darkroom_modal_view_form" model="ir.ui.view">
<field name="name">Darkroom Modal Wizard</field>
<field name="model">darkroom.modal</field>
<field name="arch" type="xml">
<form string="Darkroom Modal">
<header />
<sheet>
<group name="data">
<field name="image" widget="darkroom" nolabel="1"/>
</group>
</sheet>
<footer>
<button special="cancel" string="Cancel" class="pull-left"/>
<button name="action_save" type="object" string="Save" class="oe_highlight pull-right"/>
</footer>
</form>
</field>
</record>
</odoo>
if you want just a classic save button instead 'action_save' use 'write' and your python code will be approximately:
class Meeting(models.Model):

  .....
     @api.multi
     def write(self, values):
         return super(Meeting, self).write(values)
Avatar
Discard
Related Posts Replies Views Activity
1
May 21
7667
2
Aug 16
4214
2
Sep 21
2770
0
Aug 17
3773
2
Nov 24
271