products : defining the things you sell and buy

The lino_xl.lib.products plugin adds functionality for managing “products”.

A tested document

This is a tested document. The following instructions are used for initialization:

>>> from lino import startup
>>> startup('lino_pronto.projects.yvonne.settings.doctests')
>>> from lino.api.doctest import *

Products

A product is something you can sell or buy. The lino_xl.lib.sales plugins injects a sales_price field.

class lino_xl.lib.products.Product

Django model to represent a product.

description

The description of this product.

This is a BabelField, so there will be one field for every language defined in lino.core.site.Site.languages.

cat

Pointer to ProductCat

delivery_unit

Pointer to DeliveryUnits

vat_class

The VAT class. Injected by lino_xl.lib.vat. If that plugin is not installed, vat_class is a dummy field.

class lino_xl.lib.products.Products
>>> rt.show(products.Products)
... 
==== ============== ================== ================== =========== =============
 ID   Designation    Designation (de)   Designation (fr)   Category    Sales price
---- -------------- ------------------ ------------------ ----------- -------------
 4    Metal chair    Stuhl aus Metall   Chaise en métal    Furniture   79,99
 3    Metal table    Tisch aus Metall   Table en métal     Furniture   129,99
 2    Wooden chair   Stuhl aus Holz     Chaise en bois     Furniture   99,99
 1    Wooden table   Tisch aus Holz     Table en bois      Furniture   199,99
                                                                       **509,96**
==== ============== ================== ================== =========== =============
class lino_xl.lib.products.Services
>>> rt.show(products.Services)
... 
================================================================ ================================================================ ================================================================ ===============
 Designation                                                      Designation (de)                                                 Designation (fr)                                                 Sales account
---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- ---------------
 IT consultation & maintenance                                    EDV Konsultierung & Unterhaltsarbeiten                           ICT Consultation & maintenance
 Image processing and website content maintenance                 Bildbearbeitung und Unterhalt Website                            Traitement d'images et maintenance site existant
 Programming                                                      Programmierung                                                   Programmation
 Server software installation, configuration and administration   Server software installation, configuration and administration   Server software installation, configuration and administration
 Website hosting 1MB/month                                        Website-Hosting 1MB/Monat                                        Hébergement 1MB/mois
================================================================ ================================================================ ================================================================ ===============
class lino_xl.lib.products.ProductCat

Can be used to group products into “categories”. Categories can be edited by the user.

>>> rt.show(products.ProductCats)
... 
==== ================= ================== =============================== ============== =============
 ID   Designation       Designation (de)   Designation (fr)                Product type   description
---- ----------------- ------------------ ------------------------------- -------------- -------------
 1    Furniture         Möbel              Meubles                         Products
 2    Website Hosting   Website-Hosting    Hébergement de sites Internet   Services
==== ================= ================== =============================== ============== =============
class lino_xl.lib.products.ProductTypes

Can be used to group products into “types”. Types cannot be edited by the user. But every product type can have a layout on its own.

>>> rt.show(products.ProductTypes)
... 
======= ========== ========== ===================
 value   name       text       Table name
------- ---------- ---------- -------------------
 100     default    Products   products.Products
 200     services   Services   products.Services
 300     parts      Parts      products.Parts
======= ========== ========== ===================
class lino_xl.lib.products.DeliveryUnits

The list of possible delivery units of a product.

>>> rt.show(products.DeliveryUnits)
======= ======= =======
 value   name    text
------- ------- -------
 10      hour    Hour
 20      piece   Piece
 30      kg      Kg
======= ======= =======