Исправление ошибок в редактировании комплектов: валидация, верстка, расчет цены
This commit is contained in:
@@ -141,6 +141,14 @@ class Product(BaseProductEntity):
|
||||
from ..services.cost_calculator import ProductCostCalculator
|
||||
return ProductCostCalculator.get_cost_details(self)
|
||||
|
||||
@property
|
||||
def kit_items_using_as_sales_unit(self):
|
||||
"""
|
||||
Возвращает QuerySet KitItem, где этот товар используется как единица продажи.
|
||||
"""
|
||||
from .kits import KitItem
|
||||
return KitItem.objects.filter(sales_unit__product=self)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
# Используем сервис для подготовки к сохранению
|
||||
ProductSaveService.prepare_product_for_save(self)
|
||||
|
||||
Reference in New Issue
Block a user