Changeset 72d1b07 in rattail


Ignore:
Timestamp:
06/14/2022 01:48:22 PM (6 months ago)
Author:
Lance Edgar <lance@…>
Branches:
master
Children:
aca6ed6
Parents:
03c3bded
Message:

Add basic start date support for "future" pricing batch

Location:
rattail
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • rattail/batch/handlers.py

    r03c3bded r72d1b07  
    9797        return self.batch_model_class.batch_key
    9898
     99    @classmethod
     100    def get_spec(cls):
     101        return '{}:{}'.format(cls.__module__, cls.__name__)
     102
    99103    def get_model_title(self):
    100104        return self.batch_model_class.get_model_title()
  • rattail/batch/pricing.py

    r03c3bded r72d1b07  
    33#
    44#  Rattail -- Retail Software Framework
    5 #  Copyright © 2010-2020 Lance Edgar
     5#  Copyright © 2010-2022 Lance Edgar
    66#
    77#  This file is part of Rattail.
     
    4646    # cached decimal object used for rounding percentages, below
    4747    percent_decimal = decimal.Decimal('.001')
     48
     49    def allow_future(self):
     50        """
     51        Returns boolean indicating whether "future" price changes
     52        should be allowed.
     53
     54        :returns: ``True`` if future price changes allowed; else ``False``.
     55        """
     56        return self.config.getbool('rattail.batch', 'pricing.allow_future',
     57                                   default=False)
    4858
    4959    def should_populate(self, batch):
  • rattail/db/model/batch/pricing.py

    r03c3bded r72d1b07  
    33#
    44#  Rattail -- Retail Software Framework
    5 #  Copyright © 2010-2020 Lance Edgar
     5#  Copyright © 2010-2022 Lance Edgar
    66#
    77#  This file is part of Rattail.
     
    5757    Flag indicating whether prices should be calculated for products which are
    5858    manually priced under normal circumstances.
     59    """)
     60
     61    start_date = sa.Column(sa.Date(), nullable=True, doc="""
     62    Start date for prices within the batch.
    5963    """)
    6064
Note: See TracChangeset for help on using the changeset viewer.