April 2019
Beginner to intermediate
774 pages
24h 59m
English
For this recipe, we will use the code from the previous recipe. As an example, we will increase the existing book price by $10 USD. Note that you might using another currency based on company configurations.
Follow these steps to invoke the Python method from the XML file:
@api.modeldef _update_book_price(self): all_books = self.search([]) for book in all_books: book.cost_price += 10
<function model="library.book" name="_update_book_price"/>
Read now
Unlock full access