Moved the CURRENCY_REQUIRED validator back from the "accounting.forms" module to the "accounting.journal_entry.forms.currency" module. It is not shared with other module anymore.
This commit is contained in:
parent
2014344d25
commit
671dbfb692
@ -19,16 +19,11 @@
|
||||
"""
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, ValidationError
|
||||
from wtforms.validators import DataRequired
|
||||
|
||||
from accounting import db
|
||||
from accounting.locale import lazy_gettext
|
||||
from accounting.models import Currency
|
||||
|
||||
CURRENCY_REQUIRED: DataRequired = DataRequired(
|
||||
lazy_gettext("Please select the currency."))
|
||||
"""The validator to check if the currency code is empty."""
|
||||
|
||||
|
||||
class CurrencyExists:
|
||||
"""The validator to check if the account exists."""
|
||||
|
@ -24,9 +24,10 @@ from flask_babel import LazyString
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, ValidationError, FieldList, IntegerField, \
|
||||
BooleanField, FormField
|
||||
from wtforms.validators import DataRequired
|
||||
|
||||
from accounting import db
|
||||
from accounting.forms import CURRENCY_REQUIRED, CurrencyExists
|
||||
from accounting.forms import CurrencyExists
|
||||
from accounting.journal_entry.utils.offset_alias import offset_alias
|
||||
from accounting.locale import lazy_gettext
|
||||
from accounting.models import JournalEntryLineItem
|
||||
@ -35,6 +36,11 @@ from accounting.utils.strip_text import strip_text
|
||||
from .line_item import LineItemForm, CreditLineItemForm, DebitLineItemForm
|
||||
|
||||
|
||||
CURRENCY_REQUIRED: DataRequired = DataRequired(
|
||||
lazy_gettext("Please select the currency."))
|
||||
"""The validator to check if the currency code is empty."""
|
||||
|
||||
|
||||
class SameCurrencyAsOriginalLineItems:
|
||||
"""The validator to check if the currency is the same as the
|
||||
original line items."""
|
||||
|
Loading…
Reference in New Issue
Block a user