Browse Source

Merge pull request #115 from Tecnativa/10.0-fix-travis

[10.0][FIX] Fix Travis
pull/108/head
Pedro M. Baeza 7 years ago
committed by GitHub
parent
commit
31518700f2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      .travis.yml
  2. 20
      contract_payment_auto/README.rst
  3. 7
      contract_payment_auto/tests/test_account_analytic_account.py
  4. 34
      contract_payment_mode/tests/test_contract_payment.py
  5. 6
      contract_sale_generation/tests/test_contract_invoice.py
  6. 33
      contract_variable_quantity/tests/test_contract_variable_quantity.py

8
.travis.yml

@ -7,20 +7,12 @@ python:
addons:
apt:
sources:
- pov-wkhtmltopdf
packages:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow
- python-simplejson
- python-serial
- python-yaml
- wkhtmltopdf
# set up an X server to run wkhtmltopdf.
before_install:
- "export DISPLAY=:910.0"
- "sh -e /etc/init.d/xvfb start"
env:
global:

20
contract_payment_auto/README.rst

@ -24,13 +24,19 @@ Automatic Payment Settings
The following settings are available at both the contract and contract template level:
| Name | Description |
|------|-------------|
| Invoice Message | Message template that is used to send invoices to customers upon creation. |
| Payment Retry Message | Message template that is used to alert a customer that their automatic payment failed for some reason and will be retried. |
| Payment Fail Message | Message template that is used to alert a customer that their automatic payment failed and will no longer be retried. |
| Auto Pay Retries | Amount of times to attempt an automatic payment before discontinuing and removing the payment token from the contract/account payment method. |
| Auto Pay Retry Hours | Amount of hours that should lapse until retrying failed payments. |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Description |
+=======================+===============================================================================================================================================+
| Invoice Message | Message template that is used to send invoices to customers upon creation. |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Payment Retry Message | Message template that is used to alert a customer that their automatic payment failed for some reason and will be retried. |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Payment Fail Message | Message template that is used to alert a customer that their automatic payment failed and will no longer be retried. |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Auto Pay Retries | Amount of times to attempt an automatic payment before discontinuing and removing the payment token from the contract/account payment method. |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Auto Pay Retry Hours | Amount of hours that should lapse until retrying failed payments. |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
Payment Token
-------------

7
contract_payment_auto/tests/test_account_analytic_account.py

@ -8,13 +8,14 @@ from contextlib import contextmanager
from odoo import fields
from odoo.tools import mute_logger
from odoo.tests.common import TransactionCase
from odoo.tests import common
from ..models import account_analytic_account
class TestAccountAnalyticAccount(TransactionCase):
@common.at_install(False)
@common.post_install(True)
class TestAccountAnalyticAccount(common.HttpCase):
def setUp(self):
super(TestAccountAnalyticAccount, self).setUp()
self.Model = self.env['account.analytic.account']

34
contract_payment_mode/tests/test_contract_payment.py

@ -4,42 +4,44 @@
# Copyright 2017 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests import common
import odoo.tests
from ..hooks import post_init_hook
class TestContractPaymentInit(common.SavepointCase):
@classmethod
def setUpClass(cls):
super(TestContractPaymentInit, cls).setUpClass()
@odoo.tests.post_install(True)
@odoo.tests.at_install(False)
class TestContractPaymentInit(odoo.tests.HttpCase):
cls.payment_method = cls.env['account.payment.method'].create({
def setUp(self):
super(TestContractPaymentInit, self).setUp()
self.payment_method = self.env['account.payment.method'].create({
'name': 'Test Payment Method',
'code': 'Test',
'payment_type': 'inbound',
})
cls.payment_mode = cls.env['account.payment.mode'].create({
self.payment_mode = self.env['account.payment.mode'].create({
'name': 'Test payment mode',
'active': True,
'payment_method_id': cls.payment_method.id,
'payment_method_id': self.payment_method.id,
'bank_account_link': 'variable',
})
cls.partner = cls.env['res.partner'].create({
self.partner = self.env['res.partner'].create({
'name': 'Test contract partner',
'customer_payment_mode_id': cls.payment_mode,
'customer_payment_mode_id': self.payment_mode,
})
cls.product = cls.env['product.product'].create({
self.product = self.env['product.product'].create({
'name': 'Custom Service',
'type': 'service',
'uom_id': cls.env.ref('product.product_uom_hour').id,
'uom_po_id': cls.env.ref('product.product_uom_hour').id,
'uom_id': self.env.ref('product.product_uom_hour').id,
'uom_po_id': self.env.ref('product.product_uom_hour').id,
'sale_ok': True,
})
cls.contract = cls.env['account.analytic.account'].create({
self.contract = self.env['account.analytic.account'].create({
'name': 'Maintenance of Servers',
})
company = cls.env.ref('base.main_company')
cls.journal = cls.env['account.journal'].create({
company = self.env.ref('base.main_company')
self.journal = self.env['account.journal'].create({
'name': 'Sale Journal - Test',
'code': 'HRTSJ',
'type': 'sale',

6
contract_sale_generation/tests/test_contract_invoice.py

@ -4,11 +4,13 @@
# Copyright 2017 Angel Moya <angel.moya@pesol.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import odoo.tests
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase
class TestContractInvoice(TransactionCase):
@odoo.tests.at_install(False)
@odoo.tests.post_install(True)
class TestContractInvoice(odoo.tests.HttpCase):
# Use case : Prepare some data for current test case
def setUp(self):

33
contract_variable_quantity/tests/test_contract_variable_quantity.py

@ -2,27 +2,28 @@
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common
import odoo.tests
from odoo import exceptions
class TestContractVariableQuantity(common.SavepointCase):
@classmethod
def setUpClass(cls):
super(TestContractVariableQuantity, cls).setUpClass()
cls.partner = cls.env['res.partner'].create({
@odoo.tests.at_install(False)
@odoo.tests.post_install(True)
class TestContractVariableQuantity(odoo.tests.HttpCase):
def setUp(self):
super(TestContractVariableQuantity, self).setUp()
self.partner = self.env['res.partner'].create({
'name': 'Test partner',
})
cls.product = cls.env['product.product'].create({
self.product = self.env['product.product'].create({
'name': 'Test product',
})
cls.contract = cls.env['account.analytic.account'].create({
self.contract = self.env['account.analytic.account'].create({
'name': 'Test Contract',
'partner_id': cls.partner.id,
'pricelist_id': cls.partner.property_product_pricelist.id,
'partner_id': self.partner.id,
'pricelist_id': self.partner.property_product_pricelist.id,
'recurring_invoices': True,
})
cls.formula = cls.env['contract.line.qty.formula'].create({
self.formula = self.env['contract.line.qty.formula'].create({
'name': 'Test formula',
# For testing each of the possible variables
'code': 'env["res.users"]\n'
@ -33,14 +34,14 @@ class TestContractVariableQuantity(common.SavepointCase):
'invoice.id\n'
'result = 12',
})
cls.contract_line = cls.env['account.analytic.invoice.line'].create({
'analytic_account_id': cls.contract.id,
'product_id': cls.product.id,
self.contract_line = self.env['account.analytic.invoice.line'].create({
'analytic_account_id': self.contract.id,
'product_id': self.product.id,
'name': 'Test',
'qty_type': 'variable',
'qty_formula_id': cls.formula.id,
'qty_formula_id': self.formula.id,
'quantity': 1,
'uom_id': cls.product.uom_id.id,
'uom_id': self.product.uom_id.id,
'price_unit': 100,
'discount': 50,
})

Loading…
Cancel
Save