Make scenario independent of the current day
The fiscal years are created centered on the passed date such that if the current day change during the execution, the fiscal year is still usable. Also fiscal year can be created for a range of dates such that it is guarantee that the dates are in the fiscal year. And finally remove datetime and dateutil import when they are not used. Closes #9977
This commit is contained in:
@@ -4,8 +4,6 @@ Account Reconciliation Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -13,7 +11,6 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Account Close Fiscalyear Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
@@ -17,7 +17,7 @@ Imports::
|
||||
... create_fiscalyear, create_chart, get_accounts)
|
||||
>>> from trytond.modules.currency.tests.tools import get_currency
|
||||
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
>>> last_year = today - relativedelta(years=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -4,8 +4,6 @@ Move Cancel Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -14,7 +12,6 @@ Imports::
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.currency.tests.tools import get_currency
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ Split line by number::
|
||||
(Decimal('33.33'), Decimal('33.33'), Decimal('33.34'))
|
||||
>>> term1.amount = Decimal('40.00')
|
||||
>>> term2.amount = term3.amount = Decimal('30.00')
|
||||
>>> term3.date += relativedelta(months=1)
|
||||
>>> term3.date = period.end_date + relativedelta(months=3)
|
||||
|
||||
>>> reschedule.execute('reschedule')
|
||||
>>> reschedule_move, = reschedule.actions[0]
|
||||
|
||||
@@ -4,16 +4,12 @@ Account Renew Fiscalyear Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear
|
||||
>>> today = datetime.date.today()
|
||||
>>> end_year = today + relativedelta(month=12, day=31)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -30,8 +26,8 @@ Create fiscal year::
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> period = fiscalyear.periods.new()
|
||||
>>> period.name = 'Adjustment'
|
||||
>>> period.start_date = end_year
|
||||
>>> period.end_date = end_year
|
||||
>>> period.start_date = fiscalyear.end_date
|
||||
>>> period.end_date = fiscalyear.end_date
|
||||
>>> period.type = 'adjustment'
|
||||
>>> fiscalyear.save()
|
||||
|
||||
@@ -64,7 +60,7 @@ Renew fiscalyear resetting sequences::
|
||||
Set the sequence name::
|
||||
|
||||
>>> sequence = new_fiscalyear.post_move_sequence
|
||||
>>> sequence.name = 'Sequence %s' % new_fiscalyear.start_date.strftime('%Y')
|
||||
>>> sequence.name = 'Sequence %s' % new_fiscalyear.name
|
||||
>>> sequence.save()
|
||||
|
||||
Renew fiscalyear and test sequence name is updated::
|
||||
@@ -74,5 +70,5 @@ Renew fiscalyear and test sequence name is updated::
|
||||
>>> renew_fiscalyear.execute('create_')
|
||||
>>> new_fiscalyear, = renew_fiscalyear.actions[0]
|
||||
>>> new_fiscalyear.post_move_sequence.name == (
|
||||
... 'Sequence %s' % new_fiscalyear.start_date.strftime('%Y'))
|
||||
... 'Sequence %s' % new_fiscalyear.name)
|
||||
True
|
||||
|
||||
@@ -4,8 +4,7 @@ Account Reports Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -13,7 +12,8 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -26,7 +26,7 @@ Create company::
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = create_fiscalyear(company)
|
||||
>>> fiscalyear = create_fiscalyear(company, today)
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> periods = fiscalyear.periods
|
||||
>>> period_1, period_3, period_5 = periods[0], periods[2], periods[4]
|
||||
|
||||
@@ -12,7 +12,7 @@ __all__ = ['create_fiscalyear', 'create_chart', 'get_accounts',
|
||||
|
||||
|
||||
def create_fiscalyear(company=None, today=None, config=None):
|
||||
"Create a fiscal year for the company on today"
|
||||
"Create a fiscal year for the company on today or range"
|
||||
FiscalYear = Model.get('account.fiscalyear', config=config)
|
||||
Sequence = Model.get('ir.sequence', config=config)
|
||||
SequenceType = Model.get('ir.sequence.type', config=config)
|
||||
@@ -22,10 +22,18 @@ def create_fiscalyear(company=None, today=None, config=None):
|
||||
|
||||
if not today:
|
||||
today = datetime.date.today()
|
||||
if isinstance(today, datetime.date):
|
||||
start_date = end_date = today
|
||||
else:
|
||||
start_date, end_date = today
|
||||
today = start_date + (end_date - start_date) / 2
|
||||
start_date = min(start_date, today - relativedelta(months=6, day=1))
|
||||
end_date = max(end_date, today + relativedelta(months=5, day=31))
|
||||
assert start_date <= end_date
|
||||
|
||||
fiscalyear = FiscalYear(name=str(today.year))
|
||||
fiscalyear.start_date = today + relativedelta(month=1, day=1)
|
||||
fiscalyear.end_date = today + relativedelta(month=12, day=31)
|
||||
fiscalyear.start_date = start_date
|
||||
fiscalyear.end_date = end_date
|
||||
fiscalyear.company = company
|
||||
|
||||
sequence_type, = SequenceType.find(
|
||||
|
||||
@@ -4,7 +4,6 @@ Account Asset Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -17,7 +16,6 @@ Imports::
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> from trytond.modules.account_asset.tests.tools \
|
||||
... import add_asset_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -98,7 +96,7 @@ Buy an asset::
|
||||
>>> invoice_line.unit_price = Decimal('1000')
|
||||
>>> invoice_line.account == asset_account
|
||||
True
|
||||
>>> supplier_invoice.invoice_date = today + relativedelta(day=1, month=1)
|
||||
>>> supplier_invoice.invoice_date = fiscalyear.start_date
|
||||
>>> supplier_invoice.click('post')
|
||||
>>> supplier_invoice.state
|
||||
'posted'
|
||||
|
||||
@@ -4,7 +4,6 @@ Account Asset Depreciated Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -17,7 +16,6 @@ Imports::
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> from trytond.modules.account_asset.tests.tools \
|
||||
... import add_asset_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -77,7 +75,7 @@ Depreciate the asset::
|
||||
>>> asset.product = asset_product
|
||||
>>> asset.value = Decimal('1500.00')
|
||||
>>> asset.depreciated_amount = Decimal('500.00')
|
||||
>>> asset.start_date = today + relativedelta(day=1, month=1)
|
||||
>>> asset.start_date = fiscalyear.start_date
|
||||
>>> asset.purchase_date = asset.start_date
|
||||
>>> asset.end_date = (asset.start_date +
|
||||
... relativedelta(years=2, days=-1))
|
||||
|
||||
@@ -4,8 +4,6 @@ Purchase Asset Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -17,7 +15,6 @@ Imports::
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> from trytond.modules.account_asset.tests.tools \
|
||||
... import add_asset_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
-3
@@ -4,7 +4,6 @@ Account Cash Rounding Alternate Currency Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,8 +14,6 @@ Imports::
|
||||
... create_fiscalyear, create_chart, get_accounts)
|
||||
>>> from trytond.modules.account_invoice.tests.tools import (
|
||||
... set_fiscalyear_invoice_sequences)
|
||||
>>> today = dt.date.today()
|
||||
>>> tomorrow = today + dt.timedelta(days=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ Deposit Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -17,7 +15,6 @@ Imports::
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> from trytond.modules.account_deposit.tests.tools import \
|
||||
... add_deposit_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ Process dunning::
|
||||
>>> dunning.reload()
|
||||
>>> dunning.state
|
||||
'waiting'
|
||||
>>> dunning.date == today
|
||||
>>> bool(dunning.date)
|
||||
True
|
||||
|
||||
Create dunnings on 30 days with blocked dunning::
|
||||
|
||||
@@ -4,8 +4,7 @@ Account Dunning Final Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
@@ -13,7 +12,6 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -44,7 +42,7 @@ Create dunning procedure::
|
||||
>>> procedure = Procedure(name='Procedure')
|
||||
>>> level = procedure.levels.new()
|
||||
>>> level.sequence = 1
|
||||
>>> level.overdue = datetime.timedelta(0)
|
||||
>>> level.overdue = dt.timedelta(0)
|
||||
>>> procedure.save()
|
||||
|
||||
Create parties::
|
||||
@@ -82,7 +80,7 @@ Create dunning::
|
||||
|
||||
>>> Dunning = Model.get('account.dunning')
|
||||
>>> create_dunning = Wizard('account.dunning.create')
|
||||
>>> create_dunning.form.date = period.start_date + relativedelta(days=1)
|
||||
>>> create_dunning.form.date = period.start_date + dt.timedelta(days=1)
|
||||
>>> create_dunning.execute('create_')
|
||||
>>> dunning, = Dunning.find([])
|
||||
>>> dunning.state
|
||||
@@ -100,7 +98,7 @@ Process dunning::
|
||||
Refresh dunning::
|
||||
|
||||
>>> create_dunning = Wizard('account.dunning.create')
|
||||
>>> create_dunning.form.date = period.start_date + relativedelta(days=2)
|
||||
>>> create_dunning.form.date = period.start_date + dt.timedelta(days=2)
|
||||
>>> create_dunning.execute('create_')
|
||||
>>> dunning, = Dunning.find([])
|
||||
>>> dunning.state
|
||||
|
||||
@@ -4,7 +4,7 @@ Account Dunning Fee Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import config, Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -12,7 +12,6 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -87,10 +86,10 @@ Create dunning procedure::
|
||||
>>> Procedure = Model.get('account.dunning.procedure')
|
||||
>>> procedure = Procedure(name='Procedure Fee')
|
||||
>>> level = procedure.levels.new()
|
||||
>>> level.overdue = datetime.timedelta(5)
|
||||
>>> level.overdue = dt.timedelta(5)
|
||||
>>> level.fee = fee
|
||||
>>> level = procedure.levels.new()
|
||||
>>> level.overdue = datetime.timedelta(10)
|
||||
>>> level.overdue = dt.timedelta(10)
|
||||
>>> level.fee = fee_pc
|
||||
>>> procedure.save()
|
||||
|
||||
@@ -131,8 +130,8 @@ Create dunning on 5 days::
|
||||
|
||||
>>> Dunning = Model.get('account.dunning')
|
||||
>>> create_dunning = Wizard('account.dunning.create')
|
||||
>>> create_dunning.form.date = (period.start_date
|
||||
... + datetime.timedelta(days=5))
|
||||
>>> create_dunning.form.date = (
|
||||
... period.start_date + dt.timedelta(days=5))
|
||||
>>> create_dunning.execute('create_')
|
||||
>>> dunning, = Dunning.find([])
|
||||
|
||||
@@ -156,7 +155,7 @@ Create dunning on 10 days::
|
||||
>>> Dunning = Model.get('account.dunning')
|
||||
>>> create_dunning = Wizard('account.dunning.create')
|
||||
>>> create_dunning.form.date = (period.start_date
|
||||
... + datetime.timedelta(days=10))
|
||||
... + dt.timedelta(days=10))
|
||||
>>> create_dunning.execute('create_')
|
||||
>>> dunning, = Dunning.find([])
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ Account Dunning Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import config, Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
@@ -13,7 +12,6 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -82,7 +80,7 @@ Create dunning procedure::
|
||||
>>> procedure = Procedure(name='Procedure')
|
||||
>>> level = procedure.levels.new()
|
||||
>>> level.sequence = 1
|
||||
>>> level.overdue = datetime.timedelta(5)
|
||||
>>> level.overdue = dt.timedelta(5)
|
||||
>>> level.print_on_letter = True
|
||||
>>> procedure.save()
|
||||
|
||||
@@ -174,7 +172,7 @@ Create dunnings::
|
||||
>>> set_user(dunning_user)
|
||||
>>> Dunning = Model.get('account.dunning')
|
||||
>>> create_dunning = Wizard('account.dunning.create')
|
||||
>>> create_dunning.form.date = period.start_date + relativedelta(days=5)
|
||||
>>> create_dunning.form.date = period.start_date + dt.timedelta(days=5)
|
||||
>>> create_dunning.execute('create_')
|
||||
>>> dunning, = Dunning.find([])
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Account ES Reporting Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,7 +15,6 @@ Imports::
|
||||
... create_chart, get_accounts, create_fiscalyear)
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -33,7 +32,8 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company, datetime.date(2018, 1, 1)))
|
||||
... create_fiscalyear(
|
||||
... company, (dt.date(2018, 1, 1), dt.date(2018, 12, 31))))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> period = fiscalyear.periods[0]
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Account ES Reporting Alternate Currency Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,7 +15,7 @@ Imports::
|
||||
... create_chart, get_accounts, create_fiscalyear)
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -31,7 +31,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -4,7 +4,7 @@ Account ES Compensated Reporting Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,7 +15,6 @@ Imports::
|
||||
... create_chart, get_accounts, create_fiscalyear)
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -33,7 +32,8 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company, datetime.date(2018, 1, 1)))
|
||||
... create_fiscalyear(
|
||||
... company, (dt.date(2018, 1, 1), dt.date(2018, 12, 31))))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> previous_period = fiscalyear.periods[0]
|
||||
>>> period = fiscalyear.periods[1]
|
||||
|
||||
@@ -4,7 +4,7 @@ Account ES Reporting Surcharge Tax Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,7 +15,6 @@ Imports::
|
||||
... create_chart, get_accounts, create_fiscalyear)
|
||||
>>> from trytond.modules.account_invoice.tests.tools import (
|
||||
... set_fiscalyear_invoice_sequences)
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -33,7 +32,8 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company, datetime.date(2020, 1, 1)))
|
||||
... create_fiscalyear(
|
||||
... company, (dt.date(2020, 1, 1), dt.date(2020, 12, 31))))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -331,7 +331,7 @@ class AccountEsSiiTestCase(ModuleTestCase):
|
||||
fiscalyear.save()
|
||||
|
||||
currency = create_currency('gbp')
|
||||
add_currency_rate(currency, 2)
|
||||
add_currency_rate(currency, 2, fiscalyear.start_date)
|
||||
|
||||
party = create_party('Customer', 'eu_vat', 'ES00000000T')
|
||||
tax, = Tax.search([
|
||||
|
||||
@@ -47,7 +47,7 @@ for dep in info.get('depends', []):
|
||||
requires.append(get_require_version('trytond_%s' % dep))
|
||||
requires.append(get_require_version('trytond'))
|
||||
|
||||
tests_require = [get_require_version('proteus'), 'python-dateutil']
|
||||
tests_require = [get_require_version('proteus')]
|
||||
|
||||
setup(name=name,
|
||||
version=version,
|
||||
|
||||
@@ -4,11 +4,10 @@ FEC Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> import os
|
||||
>>> import io
|
||||
>>> from decimal import Decimal
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
@@ -17,8 +16,6 @@ Imports::
|
||||
>>> from trytond.modules.account_fr.tests.tools import create_chart, \
|
||||
... get_accounts
|
||||
|
||||
>>> today = datetime.date(2018, 1, 1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('account_fr')
|
||||
@@ -34,13 +31,14 @@ Create company::
|
||||
Create last year fiscal year::
|
||||
|
||||
>>> fiscalyear_previous = create_fiscalyear(
|
||||
... company, today=today - relativedelta(years=1))
|
||||
... company, (dt.date(2017, 1, 1), dt.date(2017, 12, 31)))
|
||||
>>> fiscalyear_previous.click('create_period')
|
||||
>>> period_previous = fiscalyear_previous.periods[0]
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = create_fiscalyear(company, today=today)
|
||||
>>> fiscalyear = create_fiscalyear(
|
||||
... company, (dt.date(2018, 1, 1), dt.date(2018, 12, 31)))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> period = fiscalyear.periods[0]
|
||||
|
||||
@@ -153,6 +151,7 @@ With reconciliation::
|
||||
... [reconcile1, reconcile2])
|
||||
>>> reconcile_lines.state == 'end'
|
||||
True
|
||||
>>> reconcile_date = reconcile1.reconciliation.create_date
|
||||
|
||||
Balance non-deferral::
|
||||
|
||||
@@ -197,7 +196,7 @@ Generate FEC::
|
||||
>>> file = os.path.join(os.path.dirname(__file__), 'FEC.csv')
|
||||
>>> with io.open(file, mode='rb') as fp:
|
||||
... template = fp.read().decode('utf-8')
|
||||
>>> current_date = datetime.date.today().strftime('%Y%m%d')
|
||||
>>> current_date = reconcile_date.strftime('%Y%m%d')
|
||||
>>> template = template.format(
|
||||
... current_date=current_date,
|
||||
... )
|
||||
|
||||
@@ -3,8 +3,8 @@ Invoice Scenario
|
||||
================
|
||||
|
||||
Imports::
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -15,7 +15,7 @@ Imports::
|
||||
... create_chart, get_accounts, create_tax, create_tax_code
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -33,7 +33,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> period = fiscalyear.periods[0]
|
||||
>>> period_ids = [p.id for p in fiscalyear.periods]
|
||||
@@ -167,6 +167,7 @@ Test change tax::
|
||||
|
||||
Post invoice::
|
||||
|
||||
>>> invoice.invoice_date = today
|
||||
>>> invoice.click('post')
|
||||
>>> invoice.state
|
||||
'posted'
|
||||
@@ -219,7 +220,7 @@ Credit invoice with refund::
|
||||
>>> invoice.reload()
|
||||
>>> invoice.state
|
||||
'cancelled'
|
||||
>>> invoice.reconciled == today
|
||||
>>> bool(invoice.reconciled)
|
||||
True
|
||||
>>> credit_note, = Invoice.find([
|
||||
... ('type', '=', 'out'), ('id', '!=', invoice.id)])
|
||||
|
||||
@@ -4,8 +4,7 @@ Invoice Scenario Alternate Currency
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -17,8 +16,8 @@ Imports::
|
||||
... create_chart, get_accounts, create_tax
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
>>> tomorrow = today + relativedelta(days=1)
|
||||
>>> today = dt.date.today()
|
||||
>>> tomorrow = today + dt.timedelta(days=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -44,11 +43,8 @@ Set alternate currency rates::
|
||||
Create fiscal years::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company, today=today))
|
||||
... create_fiscalyear(company, (today, tomorrow)))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> next_fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company, today=today + relativedelta(years=1)))
|
||||
>>> next_fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -147,6 +143,7 @@ Create invoice with alternate currency::
|
||||
Decimal('40.00')
|
||||
>>> invoice.total_amount
|
||||
Decimal('460.00')
|
||||
>>> invoice.invoice_date = today
|
||||
>>> invoice.click('post')
|
||||
>>> invoice.state
|
||||
'posted'
|
||||
|
||||
@@ -4,7 +4,7 @@ Invoice Scenario Alternate Currency Lower Rate
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,7 +15,7 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -38,7 +38,7 @@ Set alternate currency rates::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
@@ -76,6 +76,7 @@ Create invoice with alternate currency::
|
||||
>>> line.account = accounts['revenue']
|
||||
>>> line.quantity = 5
|
||||
>>> line.unit_price = Decimal('80')
|
||||
>>> invoice.invoice_date = today
|
||||
>>> invoice.click('post')
|
||||
>>> invoice.state
|
||||
'posted'
|
||||
|
||||
@@ -6,8 +6,7 @@ Imports::
|
||||
|
||||
>>> from decimal import Decimal
|
||||
>>> import datetime as dt
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from proteus import Model
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
@@ -16,7 +15,7 @@ Imports::
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = dt.date.today()
|
||||
>>> past_year = today - relativedelta(years=1)
|
||||
>>> past_year = today - dt.timedelta(days=365)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -30,11 +29,12 @@ Create company::
|
||||
Create fiscal years::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company, today=past_year))
|
||||
... create_fiscalyear(company, past_year))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> next_fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company, today=today))
|
||||
>>> next_fiscalyear.click('create_period')
|
||||
|
||||
>>> renew_fiscalyear = Wizard('account.fiscalyear.renew')
|
||||
>>> renew_fiscalyear.execute('create_')
|
||||
>>> next_fiscalyear, = renew_fiscalyear.actions[0]
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Invoice in Future
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -14,8 +14,8 @@ Imports::
|
||||
... create_chart, get_accounts)
|
||||
>>> from trytond.modules.account_invoice.tests.tools import (
|
||||
... set_fiscalyear_invoice_sequences)
|
||||
>>> today = datetime.date.today()
|
||||
>>> tomorrow = today + datetime.timedelta(days=1)
|
||||
>>> today = dt.date.today()
|
||||
>>> tomorrow = today + dt.timedelta(days=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -29,7 +29,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, (today, tomorrow)))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -33,7 +33,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> period_ids = [p.id for p in fiscalyear.periods]
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Invoice Supplier Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
@@ -16,7 +16,7 @@ Imports::
|
||||
... create_chart, get_accounts, create_tax, create_tax_code
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -30,7 +30,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> period_ids = [p.id for p in fiscalyear.periods]
|
||||
|
||||
@@ -243,5 +243,5 @@ Cancel posted invoice::
|
||||
'cancelled'
|
||||
>>> invoice.cancel_move is not None
|
||||
True
|
||||
>>> invoice.reconciled == today
|
||||
>>> bool(invoice.reconciled)
|
||||
True
|
||||
|
||||
@@ -3,7 +3,8 @@ Invoice Supplier Post Paid
|
||||
==========================
|
||||
|
||||
Imports::
|
||||
>>> import datetime
|
||||
|
||||
>>> import datetime as dt
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
@@ -15,7 +16,7 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -29,7 +30,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> period = fiscalyear.periods[0]
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -3,8 +3,7 @@ Invoice with credit Scenario
|
||||
============================
|
||||
|
||||
Imports::
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -15,7 +14,6 @@ Imports::
|
||||
... create_chart, get_accounts, create_tax, create_tax_code
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -74,6 +72,7 @@ Create invoice::
|
||||
>>> line.quantity = -2
|
||||
>>> line.unit_price = Decimal('5.0000')
|
||||
>>> line.taxes.append(Tax(tax.id))
|
||||
>>> invoice.invoice_date = fiscalyear.start_date
|
||||
>>> invoice.click('post')
|
||||
|
||||
>>> invoice.untaxed_amount
|
||||
|
||||
@@ -4,7 +4,7 @@ Renew Fiscalyear Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
@@ -14,8 +14,7 @@ Imports::
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear
|
||||
>>> from trytond.modules.account_invoice.tests.tools \
|
||||
... import set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
>>> end_year = today + relativedelta(month=12, day=31)
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -29,7 +28,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> InvoiceSequence = Model.get('account.fiscalyear.invoice_sequence')
|
||||
>>> fiscalyear = create_fiscalyear(company)
|
||||
>>> fiscalyear = create_fiscalyear(company, today)
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(fiscalyear)
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> inv_seq, = fiscalyear.invoice_sequences
|
||||
@@ -45,8 +44,8 @@ Create fiscal year::
|
||||
... })
|
||||
>>> period = fiscalyear.periods.new()
|
||||
>>> period.name = 'Adjustment'
|
||||
>>> period.start_date = end_year
|
||||
>>> period.end_date = end_year
|
||||
>>> period.start_date = fiscalyear.end_date
|
||||
>>> period.end_date = fiscalyear.end_date
|
||||
>>> period.type = 'adjustment'
|
||||
>>> fiscalyear.save()
|
||||
|
||||
@@ -91,7 +90,7 @@ Set the sequence name::
|
||||
|
||||
>>> for seq in new_fiscalyear.invoice_sequences:
|
||||
... seq.out_invoice_sequence.name = ('Sequence %s' %
|
||||
... new_fiscalyear.start_date.strftime('%Y'))
|
||||
... new_fiscalyear.name)
|
||||
... seq.out_invoice_sequence.save()
|
||||
|
||||
Renew fiscalyear and test sequence name is updated::
|
||||
@@ -101,6 +100,6 @@ Renew fiscalyear and test sequence name is updated::
|
||||
>>> renew_fiscalyear.execute('create_')
|
||||
>>> new_fiscalyear, = renew_fiscalyear.actions[0]
|
||||
>>> all(seq.out_invoice_sequence.name ==
|
||||
... 'Sequence %s' % new_fiscalyear.start_date.strftime('%Y')
|
||||
... 'Sequence %s' % new_fiscalyear.name
|
||||
... for seq in new_fiscalyear.invoice_sequences)
|
||||
True
|
||||
|
||||
@@ -18,6 +18,8 @@ Imports::
|
||||
>>> from trytond.modules.account_invoice_defer.tests.tools import (
|
||||
... add_deferred_accounts)
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('account_invoice_defer')
|
||||
@@ -36,7 +38,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> period = fiscalyear.periods[0]
|
||||
|
||||
@@ -81,7 +83,7 @@ Create invoice::
|
||||
>>> line.unit_price = Decimal('1000')
|
||||
>>> line.defer_from = period.start_date
|
||||
>>> line.defer_to = line.defer_from + dt.timedelta(days=499)
|
||||
>>> invoice.invoice_date = dt.date.today()
|
||||
>>> invoice.invoice_date = today
|
||||
>>> invoice.click('post')
|
||||
>>> invoice_line, = invoice.lines
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -3,7 +3,8 @@ Payment Scenario
|
||||
================
|
||||
|
||||
Imports::
|
||||
>>> import datetime
|
||||
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -11,7 +12,9 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> tomorrow = datetime.date.today() + datetime.timedelta(days=1)
|
||||
|
||||
>>> today = dt.date.today()
|
||||
>>> tomorrow = today + dt.timedelta(days=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -38,7 +41,7 @@ Set employee::
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = create_fiscalyear(company)
|
||||
>>> fiscalyear = create_fiscalyear(company, (today, tomorrow))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -16,6 +16,7 @@ Imports::
|
||||
|
||||
>>> today = dt.date.today()
|
||||
>>> tomorrow = today + dt.timedelta(days=1)
|
||||
>>> after_tomorrow = tomorrow + dt.timedelta(days=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -34,7 +35,7 @@ Create company::
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = create_fiscalyear(company)
|
||||
>>> fiscalyear = create_fiscalyear(company, (today, after_tomorrow))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
@@ -83,7 +84,7 @@ Create receivable moves::
|
||||
Create direct debit::
|
||||
|
||||
>>> create_direct_debit = Wizard('account.move.line.create_direct_debit')
|
||||
>>> create_direct_debit.form.date = tomorrow + dt.timedelta(days=1)
|
||||
>>> create_direct_debit.form.date = after_tomorrow
|
||||
>>> create_direct_debit.execute('create_')
|
||||
|
||||
>>> payment, = Payment.find([])
|
||||
@@ -99,7 +100,7 @@ Create direct debit::
|
||||
Re-run create direct debit does nothing::
|
||||
|
||||
>>> create_direct_debit = Wizard('account.move.line.create_direct_debit')
|
||||
>>> create_direct_debit.form.date = tomorrow + dt.timedelta(days=1)
|
||||
>>> create_direct_debit.form.date = after_tomorrow
|
||||
>>> create_direct_debit.execute('create_')
|
||||
|
||||
>>> Payment.find([]) == [payment]
|
||||
|
||||
@@ -41,7 +41,7 @@ Create chart of accounts::
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = create_fiscalyear(company)
|
||||
>>> fiscalyear = create_fiscalyear(company, today)
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create dunning procedure::
|
||||
|
||||
@@ -4,7 +4,7 @@ Payment Planning Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -12,9 +12,10 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
>>> tomorrow = today + datetime.timedelta(days=1)
|
||||
>>> next_week = today + datetime.timedelta(weeks=1)
|
||||
|
||||
>>> today = dt.date.today()
|
||||
>>> tomorrow = today + dt.timedelta(days=1)
|
||||
>>> next_week = today + dt.timedelta(weeks=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -27,7 +28,7 @@ Create company::
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = create_fiscalyear(company)
|
||||
>>> fiscalyear = create_fiscalyear(company, (today, next_week))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -51,7 +51,7 @@ tests_require = [get_require_version('proteus'),
|
||||
get_require_version('trytond_account_statement'),
|
||||
get_require_version('trytond_account_statement_rule'),
|
||||
get_require_version('trytond_account_invoice'),
|
||||
'python-dateutil']
|
||||
]
|
||||
|
||||
setup(name=name,
|
||||
version=version,
|
||||
|
||||
+3
-3
@@ -3,8 +3,8 @@ Negative Payment Clearing Scenario
|
||||
==================================
|
||||
|
||||
Imports::
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -12,7 +12,7 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ Payment Clearing Scenario
|
||||
=========================
|
||||
|
||||
Imports::
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,9 +15,9 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
>>> yesterday = today - relativedelta(days=1)
|
||||
>>> first = today + relativedelta(day=1)
|
||||
>>> today = dt.date.today()
|
||||
>>> yesterday = today - dt.timedelta(days=1)
|
||||
>>> first = today + dt.timedelta(days=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -31,7 +31,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, (yesterday, first)))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
@@ -62,7 +62,7 @@ Create payment journal::
|
||||
>>> payment_journal = PaymentJournal(name='Manual',
|
||||
... process_method='manual', clearing_journal=expense,
|
||||
... clearing_account=bank_clearing,
|
||||
... clearing_posting_delay=datetime.timedelta(1))
|
||||
... clearing_posting_delay=dt.timedelta(1))
|
||||
>>> payment_journal.save()
|
||||
|
||||
Create parties::
|
||||
@@ -110,8 +110,6 @@ Partially pay the line::
|
||||
Succeed payment::
|
||||
|
||||
>>> succeed = Wizard('account.payment.succeed', [payment])
|
||||
>>> succeed.form.date == today
|
||||
True
|
||||
>>> succeed.form.date = first
|
||||
>>> succeed.execute('succeed')
|
||||
>>> payment.state
|
||||
|
||||
+1
-5
@@ -3,8 +3,7 @@ Payment Clearing Invoice Amount to Pay
|
||||
======================================
|
||||
|
||||
Imports::
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,9 +14,6 @@ Imports::
|
||||
... create_fiscalyear, create_chart, get_accounts)
|
||||
>>> from trytond.modules.account_invoice.tests.tools import (
|
||||
... set_fiscalyear_invoice_sequences)
|
||||
>>> today = datetime.date.today()
|
||||
>>> yesterday = today - relativedelta(days=1)
|
||||
>>> first = today + relativedelta(day=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Account Payment Stripe Scenario
|
||||
Imports::
|
||||
|
||||
>>> import os
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> import time
|
||||
>>> from decimal import Decimal
|
||||
>>> import stripe
|
||||
@@ -16,6 +16,8 @@ Imports::
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('account_payment_stripe')
|
||||
@@ -28,7 +30,7 @@ Create company::
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = create_fiscalyear(company)
|
||||
>>> fiscalyear = create_fiscalyear(company, today)
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
@@ -102,7 +104,7 @@ Checkout the payment::
|
||||
... card={
|
||||
... 'number': '4242424242424242',
|
||||
... 'exp_month': 12,
|
||||
... 'exp_year': datetime.date.today().year + 1,
|
||||
... 'exp_year': today.year + 1,
|
||||
... 'cvc': '123',
|
||||
... },
|
||||
... )
|
||||
@@ -144,7 +146,7 @@ Create failing payment::
|
||||
... card={
|
||||
... 'number': '4000000000000002',
|
||||
... 'exp_month': 12,
|
||||
... 'exp_year': datetime.date.today().year + 1,
|
||||
... 'exp_year': today.year + 1,
|
||||
... 'cvc': '123',
|
||||
... },
|
||||
... )
|
||||
@@ -178,7 +180,7 @@ Checkout the customer::
|
||||
... card={
|
||||
... 'number': '4012888888881881',
|
||||
... 'exp_month': 12,
|
||||
... 'exp_year': datetime.date.today().year + 1,
|
||||
... 'exp_year': today.year + 1,
|
||||
... 'cvc': '123',
|
||||
... },
|
||||
... )
|
||||
@@ -217,7 +219,7 @@ Make payment with customer::
|
||||
>>> payment.save()
|
||||
>>> _, source = Payment.get_stripe_customer_sources(payment.id, config.context)
|
||||
>>> source_id, source_name = source
|
||||
>>> source_name == 'Visa ****1881 12/%s' % (datetime.date.today().year + 1)
|
||||
>>> source_name == 'Visa ****1881 12/%s' % (today.year + 1)
|
||||
True
|
||||
>>> payment.stripe_customer_source = source_id
|
||||
>>> payment.click('submit')
|
||||
@@ -280,7 +282,7 @@ Checkout the capture payment::
|
||||
... card={
|
||||
... 'number': '4242424242424242',
|
||||
... 'exp_month': 12,
|
||||
... 'exp_year': datetime.date.today().year + 1,
|
||||
... 'exp_year': today.year + 1,
|
||||
... 'cvc': '123',
|
||||
... },
|
||||
... )
|
||||
|
||||
@@ -5,7 +5,7 @@ Account Payment Stripe Dispute Scenario
|
||||
Imports::
|
||||
|
||||
>>> import os
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> import time
|
||||
>>> from decimal import Decimal
|
||||
>>> import stripe
|
||||
@@ -16,6 +16,8 @@ Imports::
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('account_payment_stripe')
|
||||
@@ -28,7 +30,7 @@ Create company::
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = create_fiscalyear(company)
|
||||
>>> fiscalyear = create_fiscalyear(company, today)
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
@@ -87,7 +89,7 @@ Create fully disputed payment::
|
||||
... card={
|
||||
... 'number': '4000000000000259',
|
||||
... 'exp_month': 12,
|
||||
... 'exp_year': datetime.date.today().year + 1,
|
||||
... 'exp_year': today.year + 1,
|
||||
... 'cvc': '123',
|
||||
... },
|
||||
... )
|
||||
@@ -180,7 +182,7 @@ Create partial disputed payment::
|
||||
... card={
|
||||
... 'number': '4000000000000259',
|
||||
... 'exp_month': 12,
|
||||
... 'exp_year': datetime.date.today().year + 1,
|
||||
... 'exp_year': today.year + 1,
|
||||
... 'cvc': '123',
|
||||
... },
|
||||
... )
|
||||
@@ -251,7 +253,7 @@ Create won disputed payment::
|
||||
... card={
|
||||
... 'number': '4000000000000259',
|
||||
... 'exp_month': 12,
|
||||
... 'exp_year': datetime.date.today().year + 1,
|
||||
... 'exp_year': today.year + 1,
|
||||
... 'cvc': '123',
|
||||
... },
|
||||
... )
|
||||
|
||||
@@ -16,6 +16,8 @@ Imports::
|
||||
>>> from trytond.modules.company.tests.tools import (
|
||||
... create_company, get_company)
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('account_payment_stripe')
|
||||
@@ -65,7 +67,7 @@ Create a customer::
|
||||
... card={
|
||||
... 'number': '4012888888881881',
|
||||
... 'exp_month': 12,
|
||||
... 'exp_year': dt.date.today().year + 1,
|
||||
... 'exp_year': today.year + 1,
|
||||
... 'cvc': '123',
|
||||
... },
|
||||
... )
|
||||
@@ -90,7 +92,7 @@ Create a second customer with same card::
|
||||
... card={
|
||||
... 'number': '4012888888881881',
|
||||
... 'exp_month': 12,
|
||||
... 'exp_year': dt.date.today().year + 1,
|
||||
... 'exp_year': today.year + 1,
|
||||
... 'cvc': '123',
|
||||
... },
|
||||
... )
|
||||
|
||||
@@ -5,7 +5,7 @@ Account Payment Stripe Intent Scenario
|
||||
Imports::
|
||||
|
||||
>>> import os
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> import time
|
||||
>>> from decimal import Decimal
|
||||
>>> import stripe
|
||||
@@ -16,6 +16,8 @@ Imports::
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('account_payment_stripe')
|
||||
@@ -28,7 +30,7 @@ Create company::
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = create_fiscalyear(company)
|
||||
>>> fiscalyear = create_fiscalyear(company, today)
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
@@ -80,7 +82,7 @@ Register card::
|
||||
... card={
|
||||
... 'number': '4000000000003055',
|
||||
... 'exp_month': 12,
|
||||
... 'exp_year': datetime.date.today().year + 1,
|
||||
... 'exp_year': today.year + 1,
|
||||
... 'cvc': '123',
|
||||
... })
|
||||
>>> setup_intent = stripe.SetupIntent.confirm(
|
||||
|
||||
@@ -4,7 +4,7 @@ Account Statement Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
@@ -15,7 +15,8 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -29,7 +30,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -4,7 +4,7 @@ Account Statement Origin Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -14,7 +14,8 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -28,7 +29,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -4,7 +4,7 @@ Account Statement Origin Invoices Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -14,7 +14,8 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -28,7 +29,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -4,15 +4,15 @@ Account Statement Rule Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
>>> from trytond.modules.account.tests.tools import (
|
||||
... create_chart, get_accounts)
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@ Account Statement Rule Keyword Bank Account Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -14,7 +14,7 @@ Imports::
|
||||
... create_fiscalyear, create_chart, get_accounts)
|
||||
>>> from trytond.modules.account_invoice.tests.tools import (
|
||||
... set_fiscalyear_invoice_sequences)
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -36,7 +36,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -4,7 +4,7 @@ Account Statement Rule Keyword Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -14,7 +14,8 @@ Imports::
|
||||
... create_fiscalyear, create_chart, get_accounts)
|
||||
>>> from trytond.modules.account_invoice.tests.tools import (
|
||||
... set_fiscalyear_invoice_sequences)
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -28,7 +29,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -4,8 +4,7 @@ Account Stock Anglo-Saxon Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
@@ -19,7 +18,8 @@ Imports::
|
||||
... add_stock_accounts
|
||||
>>> from trytond.modules.account_stock_anglo_saxon.tests.tools import \
|
||||
... add_cogs_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -69,7 +69,7 @@ Create the required users::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.account_stock_method = 'anglo_saxon'
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
@@ -121,7 +121,7 @@ Create product::
|
||||
>>> template.salable = True
|
||||
>>> template.list_price = Decimal('10')
|
||||
>>> template.cost_price_method = 'fixed'
|
||||
>>> template.lead_time = datetime.timedelta(0)
|
||||
>>> template.lead_time = dt.timedelta(0)
|
||||
>>> template.account_category = account_category
|
||||
>>> product, = template.products
|
||||
>>> product.cost_price = Decimal('5')
|
||||
@@ -355,7 +355,7 @@ Now we will use a product with different unit of measure::
|
||||
>>> template_by5.sale_uom = unit_5
|
||||
>>> template_by5.list_price = Decimal('10')
|
||||
>>> template_by5.cost_price_method = 'fixed'
|
||||
>>> template_by5.lead_time = datetime.timedelta(0)
|
||||
>>> template_by5.lead_time = dt.timedelta(0)
|
||||
>>> template_by5.account_category = account_category
|
||||
>>> product_by5, = template_by5.products
|
||||
>>> product_by5.cost_price = Decimal('5')
|
||||
|
||||
+6
-6
@@ -4,8 +4,7 @@ Account Stock Anglo-Saxon with Drop Shipment Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
@@ -19,7 +18,8 @@ Imports::
|
||||
... add_stock_accounts
|
||||
>>> from trytond.modules.account_stock_anglo_saxon.tests.tools import \
|
||||
... add_cogs_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -79,7 +79,7 @@ Create account user::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.account_stock_method = 'anglo_saxon'
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
@@ -132,7 +132,7 @@ Create product::
|
||||
>>> template.salable = True
|
||||
>>> template.list_price = Decimal('10')
|
||||
>>> template.cost_price_method = 'fixed'
|
||||
>>> template.lead_time = datetime.timedelta(0)
|
||||
>>> template.lead_time = dt.timedelta(0)
|
||||
>>> template.supply_on_sale = True
|
||||
>>> template.account_category = account_category
|
||||
>>> product, = template.products
|
||||
@@ -143,7 +143,7 @@ Create product::
|
||||
>>> product_supplier.template = template
|
||||
>>> product_supplier.party = supplier
|
||||
>>> product_supplier.drop_shipment = True
|
||||
>>> product_supplier.lead_time = datetime.timedelta(0)
|
||||
>>> product_supplier.lead_time = dt.timedelta(0)
|
||||
>>> product_supplier.save()
|
||||
|
||||
Create payment term::
|
||||
|
||||
@@ -4,7 +4,7 @@ Account Stock Continental Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -17,7 +17,8 @@ Imports::
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> from trytond.modules.account_stock_continental.tests.tools import \
|
||||
... add_stock_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -36,7 +37,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.account_stock_method = 'continental'
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
@@ -86,7 +87,7 @@ Create product::
|
||||
>>> template.salable = True
|
||||
>>> template.list_price = Decimal('10')
|
||||
>>> template.cost_price_method = 'fixed'
|
||||
>>> template.lead_time = datetime.timedelta(0)
|
||||
>>> template.lead_time = dt.timedelta(0)
|
||||
>>> template.account_category = account_category
|
||||
>>> product, = template.products
|
||||
>>> product.cost_price = Decimal('5')
|
||||
@@ -282,7 +283,7 @@ Create Drop Shipment Move::
|
||||
>>> product_supplier.template = product.template
|
||||
>>> product_supplier.party = supplier
|
||||
>>> product_supplier.drop_shipment = True
|
||||
>>> product_supplier.lead_time = datetime.timedelta(0)
|
||||
>>> product_supplier.lead_time = dt.timedelta(0)
|
||||
>>> product_supplier.save()
|
||||
>>> product.template.supply_on_sale = True
|
||||
>>> product.template.save()
|
||||
@@ -335,7 +336,7 @@ Create Drop Shipment Move::
|
||||
>>> product_supplier.template = product_average.template
|
||||
>>> product_supplier.party = supplier
|
||||
>>> product_supplier.drop_shipment = True
|
||||
>>> product_supplier.lead_time = datetime.timedelta(0)
|
||||
>>> product_supplier.lead_time = dt.timedelta(0)
|
||||
>>> product_supplier.save()
|
||||
>>> product_average.template.supply_on_sale = True
|
||||
>>> product_average.template.save()
|
||||
|
||||
@@ -4,8 +4,7 @@ Account Stock Landed Cost
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,7 +14,8 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -29,7 +29,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
+4
-4
@@ -4,8 +4,7 @@ Account Stock Landed Cost Weight
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,7 +14,8 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -29,7 +29,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -43,7 +43,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -35,7 +35,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> period_ids = [p.id for p in fiscalyear.periods]
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ Analytic Account Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -13,7 +11,6 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ Analytic Budget Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -12,7 +11,6 @@ Imports::
|
||||
... create_company, get_company)
|
||||
>>> from trytond.modules.account.tests.tools import (
|
||||
... create_fiscalyear, create_chart, get_accounts)
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate the analytic_budget module::
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ Analytic Invoice Scenario
|
||||
=========================
|
||||
|
||||
Imports::
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -15,7 +14,6 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Analytic Invoice with Assets Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
@@ -18,7 +18,10 @@ Imports::
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> from trytond.modules.account_asset.tests.tools \
|
||||
... import add_asset_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
>>> next_month = today + relativedelta(day=1, month=1)
|
||||
>>> next_next_month = next_month + relativedelta(months=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -32,7 +35,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, (today, next_next_month)))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
@@ -98,7 +101,7 @@ Buy an asset::
|
||||
>>> invoice_line.unit_price = Decimal('1000')
|
||||
>>> entry, = invoice_line.analytic_accounts
|
||||
>>> entry.account = analytic_account
|
||||
>>> supplier_invoice.invoice_date = today + relativedelta(day=1, month=1)
|
||||
>>> supplier_invoice.invoice_date = next_month
|
||||
>>> supplier_invoice.click('post')
|
||||
>>> supplier_invoice.state
|
||||
'posted'
|
||||
@@ -121,8 +124,7 @@ Depreciate the asset::
|
||||
Create Moves for 1 month::
|
||||
|
||||
>>> create_moves = Wizard('account.asset.create_moves')
|
||||
>>> create_moves.form.date = (supplier_invoice.invoice_date
|
||||
... + relativedelta(months=1))
|
||||
>>> create_moves.form.date = next_next_month
|
||||
>>> create_moves.execute('create_moves')
|
||||
>>> analytic_account.reload()
|
||||
>>> analytic_account.debit
|
||||
@@ -137,4 +139,4 @@ Close the asset::
|
||||
>>> analytic_account.debit
|
||||
Decimal('1000.00')
|
||||
>>> analytic_account.credit
|
||||
Decimal('0.00')
|
||||
Decimal('0.00')
|
||||
|
||||
@@ -4,8 +4,6 @@ Analytic Purchase Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
@@ -16,7 +14,6 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ Analytic Sale Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
@@ -16,7 +14,6 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
-3
@@ -4,8 +4,6 @@ Carrier Percentage with Purchase Shipment Cost Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,7 +13,6 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ Carrier Weight Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,7 +13,6 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,17 +4,17 @@ Agent Selection Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
>>> yesterday = today - relativedelta(days=1)
|
||||
>>> from trytond.modules.account.tests.tools import (
|
||||
... create_chart, get_accounts)
|
||||
|
||||
>>> today = dt.date.today()
|
||||
>>> yesterday = today - dt.timedelta(days=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ Commission Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,8 +14,9 @@ Imports::
|
||||
... create_chart, get_accounts, create_tax
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
>>> tomorrow = today + relativedelta(days=1)
|
||||
|
||||
>>> today = dt.date.today()
|
||||
>>> tomorrow = today + dt.timedelta(days=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -33,7 +33,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, (today, tomorrow)))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -42,7 +42,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, (yesterday, today)))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -4,8 +4,7 @@ Commission Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,7 +14,8 @@ Imports::
|
||||
... create_chart, get_accounts, create_tax
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -29,7 +29,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -4,14 +4,13 @@ Stock FIFO Cost Price
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ Stock FIFO Cost Price with no Input
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ Product Cost FIFO Recompute Cost Price
|
||||
Imports::
|
||||
|
||||
>>> import datetime as dt
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
|
||||
@@ -4,14 +4,14 @@ Stock FIFO Cost Price UoM
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> today = datetime.date.today()
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ Imports::
|
||||
|
||||
>>> import datetime as dt
|
||||
>>> import time
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
|
||||
@@ -30,7 +30,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -4,17 +4,17 @@ Production Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> from trytond.modules.production.production import BOM_CHANGES
|
||||
>>> today = datetime.date.today()
|
||||
>>> yesterday = today - relativedelta(days=1)
|
||||
>>> before_yesterday = yesterday - relativedelta(days=1)
|
||||
|
||||
>>> today = dt.date.today()
|
||||
>>> yesterday = today - dt.timedelta(days=1)
|
||||
>>> before_yesterday = yesterday - dt.timedelta(days=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -97,7 +97,7 @@ Create Bill of Material::
|
||||
>>> production_lead_time = ProductionLeadTime()
|
||||
>>> production_lead_time.product = product
|
||||
>>> production_lead_time.bom = bom
|
||||
>>> production_lead_time.lead_time = datetime.timedelta(1)
|
||||
>>> production_lead_time.lead_time = dt.timedelta(1)
|
||||
>>> production_lead_time.save()
|
||||
|
||||
Create an Inventory::
|
||||
|
||||
@@ -4,14 +4,14 @@ Production Work Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -216,7 +216,7 @@ Run works::
|
||||
'draft'
|
||||
>>> work2.click('start')
|
||||
>>> cycle2, = [c for c in work2.active_cycles]
|
||||
>>> cycle2.duration = datetime.timedelta(hours=1)
|
||||
>>> cycle2.duration = dt.timedelta(hours=1)
|
||||
>>> cycle2.save()
|
||||
>>> work2.click('stop')
|
||||
>>> work2.state
|
||||
|
||||
@@ -4,8 +4,7 @@ Project Invoice Effort Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
@@ -15,7 +14,6 @@ Imports::
|
||||
... get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -120,12 +118,12 @@ Create a Project::
|
||||
>>> project.party = customer
|
||||
>>> project.project_invoice_method = 'effort'
|
||||
>>> project.product = product
|
||||
>>> project.effort_duration = datetime.timedelta(hours=1)
|
||||
>>> project.effort_duration = dt.timedelta(hours=1)
|
||||
>>> task = project.children.new()
|
||||
>>> task.name = 'Task 1'
|
||||
>>> task.type = 'task'
|
||||
>>> task.product = product
|
||||
>>> task.effort_duration = datetime.timedelta(hours=5)
|
||||
>>> task.effort_duration = dt.timedelta(hours=5)
|
||||
>>> task_no_effort = project.children.new()
|
||||
>>> task_no_effort.name = "Task 2"
|
||||
>>> task_no_effort.type = 'task'
|
||||
@@ -133,7 +131,7 @@ Create a Project::
|
||||
>>> task_fixed = project.children.new()
|
||||
>>> task_fixed.name = "Task 2"
|
||||
>>> task_fixed.type = 'task'
|
||||
>>> task_fixed.effort_duration = datetime.timedelta(hours=2)
|
||||
>>> task_fixed.effort_duration = dt.timedelta(hours=2)
|
||||
>>> task_fixed.product = product_fixed
|
||||
>>> project.save()
|
||||
>>> task, task_no_effort, task_fixed = project.children
|
||||
|
||||
@@ -4,8 +4,7 @@ Project Invoice Multiple Parties Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -13,7 +12,6 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_chart, \
|
||||
... get_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -70,7 +68,7 @@ Create a Project with multiple customers::
|
||||
>>> project.party = customer1
|
||||
>>> project.project_invoice_method = 'effort'
|
||||
>>> project.product = product
|
||||
>>> project.effort_duration = datetime.timedelta(hours=1)
|
||||
>>> project.effort_duration = dt.timedelta(hours=1)
|
||||
|
||||
>>> subproject = project.children.new()
|
||||
>>> subproject.name = 'Subproject'
|
||||
@@ -78,7 +76,7 @@ Create a Project with multiple customers::
|
||||
>>> subproject.party = customer2
|
||||
>>> subproject.project_invoice_method = 'effort'
|
||||
>>> subproject.product = product
|
||||
>>> subproject.effort_duration = datetime.timedelta(hours=5)
|
||||
>>> subproject.effort_duration = dt.timedelta(hours=5)
|
||||
|
||||
>>> project.save()
|
||||
>>> subproject, = project.children
|
||||
|
||||
@@ -4,8 +4,7 @@ Project Invoice Progress Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
@@ -15,7 +14,6 @@ Imports::
|
||||
... get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -124,12 +122,12 @@ Create a Project::
|
||||
>>> project.party = customer
|
||||
>>> project.project_invoice_method = 'progress'
|
||||
>>> project.product = product
|
||||
>>> project.effort_duration = datetime.timedelta(hours=1)
|
||||
>>> project.effort_duration = dt.timedelta(hours=1)
|
||||
>>> task = project.children.new()
|
||||
>>> task.name = 'Task 1'
|
||||
>>> task.type = 'task'
|
||||
>>> task.product = product
|
||||
>>> task.effort_duration = datetime.timedelta(hours=5)
|
||||
>>> task.effort_duration = dt.timedelta(hours=5)
|
||||
>>> task_fixed = project.children.new()
|
||||
>>> task_fixed.name = 'Task 2'
|
||||
>>> task_fixed.type = 'task'
|
||||
|
||||
@@ -4,7 +4,7 @@ Project Invoice Timesheet Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -15,8 +15,9 @@ Imports::
|
||||
... get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
>>> yesterday = today - datetime.timedelta(days=1)
|
||||
|
||||
>>> today = dt.date.today()
|
||||
>>> yesterday = today - dt.timedelta(days=1)
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -135,13 +136,13 @@ Create timesheets::
|
||||
>>> line = TimesheetLine()
|
||||
>>> line.date = yesterday
|
||||
>>> line.employee = employee
|
||||
>>> line.duration = datetime.timedelta(hours=3)
|
||||
>>> line.duration = dt.timedelta(hours=3)
|
||||
>>> line.work, = task.timesheet_works
|
||||
>>> line.save()
|
||||
>>> line = TimesheetLine()
|
||||
>>> line.date = today
|
||||
>>> line.employee = employee
|
||||
>>> line.duration = datetime.timedelta(hours=2)
|
||||
>>> line.duration = dt.timedelta(hours=2)
|
||||
>>> line.work, = project.timesheet_works
|
||||
>>> line.save()
|
||||
|
||||
@@ -199,7 +200,7 @@ Create more timesheets::
|
||||
>>> TimesheetLine = Model.get('timesheet.line')
|
||||
>>> line = TimesheetLine()
|
||||
>>> line.employee = employee
|
||||
>>> line.duration = datetime.timedelta(hours=4)
|
||||
>>> line.duration = dt.timedelta(hours=4)
|
||||
>>> line.work, = task.timesheet_works
|
||||
>>> line.save()
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ Purchase Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
@@ -16,7 +15,8 @@ Imports::
|
||||
... create_chart, get_accounts, create_tax
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -45,7 +45,7 @@ Set employee::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
@@ -4,8 +4,6 @@ Purchase Return Wizard Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -15,8 +13,6 @@ Imports::
|
||||
... create_chart, get_accounts
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ Purchase Blanket Agreement Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -15,8 +14,8 @@ Imports::
|
||||
>>> from trytond.modules.account.tests.tools import (
|
||||
... create_chart, get_accounts)
|
||||
|
||||
>>> today = datetime.date.today()
|
||||
>>> later = today + relativedelta(days=30)
|
||||
>>> today = dt.date.today()
|
||||
>>> later = today + dt.timedelta(days=30)
|
||||
|
||||
|
||||
Activate modules::
|
||||
|
||||
-3
@@ -4,8 +4,6 @@ Purchase Invoice Line Standalone Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -16,7 +14,6 @@ Imports::
|
||||
... create_chart, get_accounts, create_tax
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ Purchase Product Quantity Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -14,8 +13,6 @@ Imports::
|
||||
>>> from trytond.modules.company.tests.tools import (
|
||||
... create_company, get_company)
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules(
|
||||
|
||||
@@ -4,8 +4,7 @@ Purchase Request Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
@@ -13,7 +12,8 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import (create_chart,
|
||||
... get_accounts)
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Purchase Request For Quotation Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
@@ -12,7 +12,8 @@ Imports::
|
||||
... create_company, get_company)
|
||||
>>> from trytond.modules.account.tests.tools import (
|
||||
... create_chart, get_accounts)
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate purchase_request_quotation Module::
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ Purchase Requisition Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
@@ -13,7 +12,8 @@ Imports::
|
||||
... get_company)
|
||||
>>> from trytond.modules.account.tests.tools import (create_chart,
|
||||
... get_accounts)
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate purchase_requisition Module::
|
||||
|
||||
|
||||
+3
-4
@@ -4,8 +4,7 @@ Purchase Blanket Agreement Secondary Unit Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
|
||||
>>> from proteus import Model, Wizard
|
||||
@@ -15,8 +14,8 @@ Imports::
|
||||
>>> from trytond.modules.account.tests.tools import (
|
||||
... create_chart, get_accounts)
|
||||
|
||||
>>> today = datetime.date.today()
|
||||
>>> later = today + relativedelta(days=30)
|
||||
>>> today = dt.date.today()
|
||||
>>> later = today + dt.timedelta(days=30)
|
||||
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -4,14 +4,11 @@ Purchase Shipment Cost Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ Create chart of accounts::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create account categories::
|
||||
|
||||
-3
@@ -4,8 +4,6 @@ Purchase Shipment Cost with Account Stock Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -17,7 +15,6 @@ Imports::
|
||||
... set_fiscalyear_invoice_sequences
|
||||
>>> from trytond.modules.account_stock_continental.tests.tools import \
|
||||
... add_stock_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
+4
-4
@@ -4,8 +4,7 @@ Purchase Shipment Cost with Account Stock Anglo-Saxon Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> import datetime as dt
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
@@ -19,7 +18,8 @@ Imports::
|
||||
... add_stock_accounts
|
||||
>>> from trytond.modules.account_stock_anglo_saxon.tests.tools import \
|
||||
... add_cogs_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
>>> today = dt.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
@@ -37,7 +37,7 @@ Create company::
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
... create_fiscalyear(company))
|
||||
... create_fiscalyear(company, today))
|
||||
>>> fiscalyear.account_stock_method = 'anglo_saxon'
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ Sale Scenario
|
||||
|
||||
Imports::
|
||||
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
@@ -16,7 +14,6 @@ Imports::
|
||||
... create_chart, get_accounts, create_tax
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user