Exemplo n.º 1
0
 class Meta:
     model = Product
     fields = (
         "accounting_identifier",
         "barcode",
         "cost_center",
         "depth",
         "gross_weight",
         "gtin",
         "height",
         "manufacturer",
         "net_weight",
         "profit_center",
         "sales_unit",
         "shipping_mode",
         "sku",
         "stock_behavior",
         "tax_class",
         "type",
         "width",
         # I18n
         "description",
         "short_description",
         "keywords",
         "name",
         "slug",
         "variation_name",
     )
     widgets = {
         "keywords": forms.TextInput(),
         "sales_unit": QuickAddSalesUnitSelect(editable_model="shuup.SalesUnit"),
         "tax_class": QuickAddTaxClassSelect(editable_model="shuup.TaxClass"),
         "description": TextEditorWidget(),
         "short_description": forms.TextInput(),
     }
Exemplo n.º 2
0
 class Meta:
     model = Product
     fields = (
         "accounting_identifier",
         "barcode",
         "cost_center",
         "depth",
         "gross_weight",
         "gtin",
         "height",
         "manufacturer",
         "net_weight",
         "profit_center",
         "sales_unit",
         "shipping_mode",
         "sku",
         "tax_class",
         "type",
         "width",
         # I18n
         "description",
         "short_description",
         "keywords",
         "name",
         "slug",
         "variation_name",
     )
     widgets = {
         "keywords":
         forms.TextInput(),
         "sales_unit":
         QuickAddSalesUnitSelect(editable_model="shuup.SalesUnit"),
         "tax_class":
         QuickAddTaxClassSelect(editable_model="shuup.TaxClass"),
         "description":
         (TextEditorWidget()
          if settings.SHUUP_ADMIN_ALLOW_HTML_IN_PRODUCT_DESCRIPTION else
          forms.Textarea(attrs={"rows": 5})),
         "short_description":
         forms.TextInput(),
     }