-2

I tried overriding the sales order confirm button with the below code:

class sale_order(models.Model):
    _inherit = 'sale.order'

    @api.multi
    def action_confirm(self):
        _logger = logging.getLogger(__name__)
        rec = super(sale_order, self).action_confirm()
        _logger.debug("this_action_took_place_sales")
        _logger.error('this_action_took_place_sales %s', "sales")
        return rec

I restarted the server and upgraded the code. Even then I do not see the message in the logs.

I read this answer: https://www.odoo.com/forum/help-1/question/sale-override-action-button-confirm-116695 and wrote the below code:

@api.multi
def action_button_confirm(self):
    _logger = logging.getLogger(__name__)
    rec = super(sale_order, self).action_button_confirm()
    _logger.debug("this_action_took_place_sales")
    _logger.error('this_action_took_place_sales %s', "sales")
    return rec

No logs even then. I checked the parent sales order file. (sale.py). The method over there is named action_confirm(self)

What is the correct way to override the sales confirm action button in odoo 11?

tahaasadullah
  • 67
  • 1
  • 5
  • Check whether your file gets loaded during startup at all: is it in `__init__.py` ? if there's an intentional syntax error, does it fail on startup? – miw Sep 04 '18 at 18:51

1 Answers1

0

That method in Odoo v9 was renamed to action_confirm, the link referenced from the Odoo forum refers to Odoo v8 where the method was action_button_confirm. Just rename it to the new method name and you will be fine from v9 to v11

aekis.dev
  • 2,626
  • 1
  • 12
  • 19