pycharm-odoo
pycharm-odoo copied to clipboard
Singleton error inspection
For example, the following code can lead to a singleton error:
@api.depends('product_uom_qty', 'discount', 'price_unit', 'tax_id')
def _compute_amount(self):
"""
Compute the amounts of the SO line.
"""
for line in self:
price = self.price_unit * (1 - (line.discount or 0.0) / 100.0)
self.price_unit => error
Nice, but please don't force the use of ensure_one.
Nice, but please don't force the use of ensure_one.
Yup! :))