-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #561 from CompassionCH/devel
Devel to Prod
- Loading branch information
Showing
54 changed files
with
1,465 additions
and
528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# convert to LF when writing to the object DB | ||
* text=auto | ||
*.py text | ||
*.xml text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
language: python | ||
sudo: required | ||
cache: | ||
apt: true | ||
directories: | ||
- $HOME/.cache/pip | ||
|
||
python: | ||
- "2.7" | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- expect-dev # provides unbuffer utility | ||
- python-lxml # because pip installation is slow | ||
- python-simplejson | ||
- python-serial | ||
- python-yaml | ||
- python-cups | ||
- python-mysqldb | ||
- python-tk | ||
# OpenCV requirements packages | ||
- zbar-tools | ||
- python-zbar | ||
|
||
env: | ||
global: | ||
- VERSION="10.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0" | ||
- PHANTOMJS_VERSION="latest" | ||
# The above line controls the PhantomJS version that is used for JS testing. | ||
# It is not necessary to include this value unless you are altering the default. | ||
# Use `OS` to skip the PhantomJS upgrade & use the system version instead. | ||
|
||
matrix: | ||
- LINT_CHECK="1" | ||
- TESTS="1" ODOO_REPO="odoo/odoo" EXCLUDE="pgsql_auto_backup" | ||
|
||
|
||
virtualenv: | ||
system_site_packages: true | ||
|
||
services: | ||
- postgresql | ||
|
||
install: | ||
- pip install -r requirements.txt | ||
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools | ||
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} | ||
- travis_install_nightly | ||
|
||
before_script: | ||
- sudo apt-get update | ||
- sudo apt-get autoremove postgis* | ||
- sudo apt-get autoremove postgresql* | ||
- sudo apt-get install postgresql-9.3-postgis-2.1 | ||
- sudo apt-get install python-opencv | ||
- sudo dpkg -L python-opencv | ||
- psql -U postgres -c "create extension postgis" | ||
- psql -U postgres -c "create extension postgis_topology" | ||
|
||
script: | ||
- travis_run_tests | ||
|
||
after_success: | ||
- travis_after_tests_success | ||
language: python | ||
sudo: required | ||
cache: | ||
apt: true | ||
directories: | ||
- $HOME/.cache/pip | ||
|
||
python: | ||
- "2.7" | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- expect-dev # provides unbuffer utility | ||
- python-lxml # because pip installation is slow | ||
- python-simplejson | ||
- python-serial | ||
- python-yaml | ||
- python-cups | ||
- python-mysqldb | ||
- python-tk | ||
# OpenCV requirements packages | ||
- zbar-tools | ||
- python-zbar | ||
|
||
env: | ||
global: | ||
- VERSION="10.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0" | ||
- PHANTOMJS_VERSION="latest" | ||
# The above line controls the PhantomJS version that is used for JS testing. | ||
# It is not necessary to include this value unless you are altering the default. | ||
# Use `OS` to skip the PhantomJS upgrade & use the system version instead. | ||
|
||
matrix: | ||
- LINT_CHECK="1" | ||
- TESTS="1" ODOO_REPO="odoo/odoo" EXCLUDE="pgsql_auto_backup" | ||
|
||
|
||
virtualenv: | ||
system_site_packages: true | ||
|
||
services: | ||
- postgresql | ||
|
||
install: | ||
- pip install -r requirements.txt | ||
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools | ||
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} | ||
- travis_install_nightly | ||
|
||
before_script: | ||
- sudo apt-get update | ||
- sudo apt-get autoremove postgis* | ||
- sudo apt-get autoremove postgresql* | ||
- sudo apt-get install postgresql-9.3-postgis-2.1 | ||
- sudo apt-get install python-opencv | ||
- sudo dpkg -L python-opencv | ||
- psql -U postgres -c "create extension postgis" | ||
- psql -U postgres -c "create extension postgis_topology" | ||
|
||
script: | ||
- travis_run_tests | ||
|
||
after_success: | ||
- travis_after_tests_success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch) | ||
# @author: Nicolas Badoux <[email protected]> | ||
# | ||
# The licence is in the file __manifest__.py | ||
# | ||
############################################################################## | ||
|
||
from . import test_account_reconcile |
129 changes: 129 additions & 0 deletions
129
account_reconcile_compassion/tests/test_account_reconcile.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch) | ||
# @author: Quentin Gigon <[email protected]> | ||
# | ||
# The licence is in the file __manifest__.py | ||
# | ||
############################################################################## | ||
|
||
from odoo import fields, _ | ||
from odoo.addons.sponsorship_compassion.tests.test_sponsorship_compassion \ | ||
import BaseSponsorshipTest | ||
|
||
|
||
class TestAccountReconcile(BaseSponsorshipTest): | ||
|
||
def setUp(self): | ||
super(TestAccountReconcile, self).setUp() | ||
|
||
self.t_child = self.create_child('TT123456789') | ||
self.t_partner = self.env['res.users'].search([ | ||
('company_id', '=', 1) | ||
], limit=1) | ||
t_group = self.create_group({'partner_id': self.t_partner.id}) | ||
self.t_sponsorship = self.create_contract({ | ||
'partner_id': self.t_partner.id, | ||
'group_id': t_group.id, | ||
'child_id': self.t_child.id, | ||
}, | ||
[{'amount': 50.0}]) | ||
|
||
self.company = self.env['res.company'].search([ | ||
('id', '=', 1) | ||
], limit=1) | ||
|
||
self.journal = self.env['account.journal'].search([ | ||
('code', '=', 'CCP') | ||
]) | ||
|
||
self.account = self.env['account.account'].search([ | ||
('id', '=', self.journal.default_credit_account_id.id) | ||
]) | ||
self.account.write({'currency_id': self.env.ref('base.CHF').id}) | ||
|
||
def test_account_reconcile(self): | ||
self.assertTrue(self.journal) | ||
self.assertTrue(self.company) | ||
self.assertTrue(self.account) | ||
|
||
move = self.env['account.move'].create({ | ||
'name': 'test_acc_move', | ||
'date': fields.Date.today(), | ||
'journal_id': self.journal.id, | ||
'state': 'draft', | ||
'company_id': self.company.id, | ||
'ref': 'test_ref' | ||
}) | ||
self.assertTrue(move) | ||
|
||
account_move_line = self.env['account.move.line'].create({ | ||
'name': 'test_move_line', | ||
'account_id': self.account.id, | ||
'move_id': move.id, | ||
'date_maturity': '2018-12-12', | ||
'currency_id': self.env.ref('base.CHF').id | ||
}) | ||
self.assertTrue(account_move_line) | ||
|
||
account_move_line_today = self.env['account.move.line'].create({ | ||
'name': 'test_move_line', | ||
'account_id': self.account.id, | ||
'move_id': move.id, | ||
'date_maturity': fields.Date.today(), | ||
'currency_id': self.env.ref('base.CHF').id | ||
}) | ||
self.assertTrue(account_move_line_today) | ||
|
||
bank_statement = self.env['account.bank.statement'].create({ | ||
'date': fields.Date.today(), | ||
'state': 'open', | ||
'journal_id': self.journal.id, | ||
'move_line_ids': [(6, _, [account_move_line.id, | ||
account_move_line_today.id])] | ||
}) | ||
self.assertTrue(bank_statement) | ||
|
||
bank_statement_line = self.env['account.bank.statement.line'].create({ | ||
'name': 'TestBankLine', | ||
'date': fields.Date.today(), | ||
'amount': 50, | ||
'journal_id': self.journal.id, | ||
'account_id': self.account.id, | ||
'statement_id': bank_statement.id, | ||
'ref': 'test_ref', | ||
'currency_id': self.account.currency_id.id, | ||
'journal_entry_ids': [(6, _, [move.id])] | ||
}) | ||
self.assertTrue(bank_statement_line) | ||
|
||
# should be 12 - 6 * 12 = 72 | ||
self.assertEquals(bank_statement_line._sort_move_line( | ||
account_move_line), 72) | ||
# should be 1 | ||
self.assertEquals(bank_statement_line._sort_move_line( | ||
account_move_line_today), 1) | ||
|
||
# test get_move_lines_for_reconciliation method | ||
self.assertEquals( | ||
len(bank_statement_line.get_move_lines_for_reconciliation()), 0) | ||
|
||
# test linking partner to bank when writing to | ||
# account.bank.statement.line | ||
self.env['account.bank.statement.line'].write({ | ||
'partner_id': self.t_partner.id | ||
}) | ||
partner_bank = self.env['res.partner.bank'].search([ | ||
'|', | ||
('acc_number', 'like', self.journal.bank_account_id.acc_number), | ||
('sanitized_acc_number', 'like', | ||
self.journal.bank_account_id.acc_number) | ||
]) | ||
self.assertEquals(partner_bank.company_id, self.journal.company_id) | ||
|
||
acc_partial_rec = self.env['account.partial.reconcile'].create({ | ||
'debit_move_id': account_move_line.id, | ||
'credit_move_id': account_move_line.id | ||
}) | ||
self.assertTrue(acc_partial_rec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<!-- Monthly Cron for Accounting Entries --> | ||
<record id="cleanup_cron" model="ir.cron"> | ||
<field name="name">CH Database Cleanup</field> | ||
<field name="interval_number">1</field> | ||
<field name="interval_type">months</field> | ||
<field name="numbercall">-1</field> | ||
<field name="active" eval="True"/> | ||
<field name="function">cleanup</field> | ||
<field name="model">database.cleanup.switzerland</field> | ||
</record> | ||
<data noupdate="1"> | ||
<record id="cleanup_cron" model="ir.cron"> | ||
<field name="name">CH Database Cleanup</field> | ||
<field name="interval_number">1</field> | ||
<field name="interval_type">months</field> | ||
<field name="numbercall">-1</field> | ||
<field name="active" eval="True"/> | ||
<field name="function">cleanup</field> | ||
<field name="model">database.cleanup.switzerland</field> | ||
</record> | ||
</data> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:alt: License: AGPL-3 | ||
|
||
LSV-DD Export Compassion | ||
======================== | ||
|
||
Customize LSV-DD to fit Compassion needs. | ||
|
||
* Change communication in Direct Debit Orders | ||
|
||
Installation | ||
============ | ||
This modules requires en_US, fr_CH, de_DE, it_IT and es_ES to be installed | ||
on the server. | ||
|
||
To check installed locales: | ||
|
||
* locale -a | ||
|
||
To add a new locale : | ||
|
||
* /usr/share/locales/install-language-pack <ISO-locale-name> | ||
* dpkg-reconfigure locales | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Cyril Sester <[email protected]> | ||
* Emanuel Cino <[email protected]> | ||
* Nicolas Tran <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
||
This module is maintained by `Compassion Switzerland <https://www.compassion.ch>`. | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:alt: License: AGPL-3 | ||
|
||
LSV-DD Export Compassion | ||
======================== | ||
|
||
Customize LSV-DD to fit Compassion needs. | ||
|
||
* Change communication in Direct Debit Orders | ||
|
||
Installation | ||
============ | ||
This modules requires en_US, fr_CH, de_DE, it_IT and es_ES to be installed | ||
on the server. | ||
|
||
To check installed locales: | ||
|
||
* locale -a | ||
|
||
To add a new locale : | ||
|
||
* /usr/share/locales/install-language-pack <ISO-locale-name> | ||
* dpkg-reconfigure locales | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Cyril Sester <[email protected]> | ||
* Emanuel Cino <[email protected]> | ||
* Nicolas Tran <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
||
This module is maintained by `Compassion Switzerland <https://www.compassion.ch>`. |
Oops, something went wrong.