#51 feat: categorias anidadas en el listado legacy de productos
Issue #51: discriminacion y administracion de categorias de productos. - Product.to_list() devuelve categorias como objetos (id, name, alternative_name, active) en vez de solo nombres
This commit is contained in:
@@ -49,7 +49,15 @@ class Product(models.Model):
|
||||
"price_list": product.price,
|
||||
"uom": product.measuring_unit,
|
||||
"external_id": product.external_id,
|
||||
"categories": [c.name for c in product.categories.all()],
|
||||
"categories": [
|
||||
{
|
||||
"id": c.id,
|
||||
"name": c.name,
|
||||
"alternative_name": c.alternative_name,
|
||||
"active": c.active,
|
||||
}
|
||||
for c in product.categories.all()
|
||||
],
|
||||
}
|
||||
products_list.append(rproduct)
|
||||
return products_list
|
||||
|
||||
Reference in New Issue
Block a user