March 2018
Beginner to intermediate
336 pages
8h 22m
English
Excluding the Cancel button, we have three action buttons to implement: Count All, Get All, and Mass Update. We will first focus on the Mass Update button.
The method called by the button is do_mass_update and it should be defined in the models/todo_wizard_model.py file, as shown in the following code:
from odoo import exceptions
import logging_logger = logging.getLogger(__name__)
# ...
# class TodoWizard(models.TransientModel):
# ...
@api.multi
def do_mass_update(self):
self.ensure_one()
if not (self.new_deadline or self.new_user_id):
raise exceptions.ValidationError('No data to update!') # Logging debug messages _logger.debug( 'Mass update on Todo Tasks %s', self.task_ids.ids) vals = {} if self.new_deadline: ...Read now
Unlock full access