Skip to Content
Menu
This question has been flagged
5 Replies
4097 Views

I want odoo to auto click "Transfer" after Posting invoice.

Testing on Odoo 13 community.


https://imgur.com/a/EcQ7ftg .( 2 image.) before post.jpeg & after post.jpeg

Avatar
Discard

Hope these tips will help you: http://learnopenerp.blogspot.com/

Best Answer

Hi,

You can override/super the function of the Post button and call this function. So once you click the post button this button action will also get executed.


For overriding a function, see:

def function_name(self):
res = super(Classname, self).function_name()
# call your button here
return res

Thanks

Avatar
Discard
Author

Hi, thanks for helping.

But i don't know where to put

def function_name(self):

res = super(Classname, self).function_name()

# call your button here

return res

*I am not an odoo developer :(

Author

I know how to enter developer mode, and click bug icon , and edit view form

Best Answer

Hello HMMW,

Create one py file in your custom module and write the following code.

from odoo import models, fields, api, _

class AccountMove(models.Model):
_inherit =
'account.move'

 

def action_post(self):
res =
super(AccountMove, self).action_post()
#call your mothod here.    
self.your_mehhod_name(function_argument)
return res

def your_method_name(self, function_argument):
#your code

Don't forget to add your py file in __init__.py, then restart odoo service.


Avatar
Discard