Fix get categories for restaurant

This commit is contained in:
Oscar Alvarez 2020-05-26 14:51:04 -05:00
parent 89562ff7ca
commit 2f1b558ede
1 changed files with 3 additions and 7 deletions

View File

@ -1545,17 +1545,13 @@ class MainWindow(FrontWindow):
('template.categories', '=', cat_id),
])
return [
[r['id'], r['code'], r['template.name'], r['template.sale_price_w_tax']]
[r['id'], r['code'], r['name'], r['template']['sale_price_w_tax']]
for r in records
]
def get_product_by_categories(self):
domain = [
('parent', '=', None),
('accounting', '=', False),
('id', 'in', self.product_categories)
]
self.allow_categories = self.Category.find(domain)
self.allow_categories = [pc for pc in self.product_categories if (
not pc['parent'] and not pc['accounting'])]
for cat in self.allow_categories:
cat['icon'] = get_icon(cat['name_icon'])