[FIX] product: report pricelist empty data
Try to get the report_pricelist with empty data (Studio Report editor can) Before this commit, it crashes because we tried to access dict keys directly in an empty dict After this commit, it doesn't crash OPW 2009862 closes odoo/odoo#34118 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit is contained in:
@@ -27,7 +27,8 @@ class report_product_pricelist(models.AbstractModel):
|
||||
}
|
||||
|
||||
def _get_quantity(self, data):
|
||||
return sorted([data['form'][key] for key in data['form'] if key.startswith('qty') and data['form'][key]])
|
||||
form = data and data.get('form') or {}
|
||||
return sorted([form[key] for key in form if key.startswith('qty') and form[key]])
|
||||
|
||||
def _get_categories(self, pricelist, products, quantities):
|
||||
categ_data = []
|
||||
|
||||
Reference in New Issue
Block a user