diff --git a/chezbetty/migrations/migration_1.14.1-1.15.0.sql b/chezbetty/migrations/migration_1.14.1-1.15.0.sql new file mode 100644 index 0000000..83eec6b --- /dev/null +++ b/chezbetty/migrations/migration_1.14.1-1.15.0.sql @@ -0,0 +1,3 @@ +ALTER TABLE items ADD COLUMN sticky_price BOOLEAN DEFAULT FALSE; +ALTER TABLE items_history ADD COLUMN sticky_price BOOLEAN DEFAULT FALSE; + diff --git a/chezbetty/models/item.py b/chezbetty/models/item.py index 7dd9e40..be1c285 100644 --- a/chezbetty/models/item.py +++ b/chezbetty/models/item.py @@ -20,17 +20,18 @@ def __str__(self): class Item(Versioned, Base): __tablename__ = 'items' - id = Column(Integer, primary_key=True, nullable=False) - name = Column(String(255), nullable=False, unique=True) - barcode = Column(String(255), nullable=True, unique=True) - price = Column(Numeric, nullable=False) - wholesale = Column(Numeric, nullable=False) - bottle_dep = Column(Boolean, nullable=False, default=False) - sales_tax = Column(Boolean, nullable=False, default=False) - in_stock = Column(Integer, nullable=False, default=0) - img = relationship(ItemImage, uselist=False, backref="item") - - enabled = Column(Boolean, default=True, nullable=False) + id = Column(Integer, primary_key=True, nullable=False) + name = Column(String(255), nullable=False, unique=True) + barcode = Column(String(255), nullable=True, unique=True) + price = Column(Numeric, nullable=False) + sticky_price = Column(Boolean, default=False) + wholesale = Column(Numeric, nullable=False) + bottle_dep = Column(Boolean, nullable=False, default=False) + sales_tax = Column(Boolean, nullable=False, default=False) + in_stock = Column(Integer, nullable=False, default=0) + img = relationship(ItemImage, uselist=False, backref="item") + + enabled = Column(Boolean, default=True, nullable=False) def __init__(self, name, barcode, price, wholesale, bottle_dep, sales_tax, in_stock, enabled): diff --git a/chezbetty/templates/admin/item_edit.jinja2 b/chezbetty/templates/admin/item_edit.jinja2 index 4d230ba..37149d0 100644 --- a/chezbetty/templates/admin/item_edit.jinja2 +++ b/chezbetty/templates/admin/item_edit.jinja2 @@ -29,6 +29,10 @@