Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update changes since TravisCI #1

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d0b4f78
Actualizacion branch 8.0
Danisan May 21, 2015
68a9cda
Agrego yml travis
Danisan Sep 21, 2015
94bd46c
remove lint by now
Danisan Sep 21, 2015
c84929e
Correct yaml
Danisan Sep 21, 2015
416c150
Syntax and library checks travis
Danisan Sep 21, 2015
93b2eec
correcciones de espacios
Danisan Sep 21, 2015
c4dfb65
cambios travis
Danisan Sep 21, 2015
ffc78b2
Eliminated print lines
Danisan Sep 21, 2015
a1cb125
Clean comments
Danisan Sep 21, 2015
31ad1bd
delete blank line at the end
Danisan Sep 21, 2015
62dab2f
Modify readme file
Danisan Sep 21, 2015
02e1ba6
Add coverage file
Danisan Sep 21, 2015
860f9c8
include coveralls in yaml file
Danisan Sep 21, 2015
3471303
send to coveralls.io
Danisan Sep 21, 2015
62f02f5
Cambios al readme (coveralls)
Danisan Sep 21, 2015
96aaa2d
Add options to omit in coverage config file
Danisan Sep 21, 2015
a642422
Change readme image
Danisan Sep 21, 2015
77dc981
Add codeclimate info addons to .travis.yml
Danisan Sep 21, 2015
efe2eef
Add codeclimate.yml to run code climate test in new platform.
Danisan Sep 21, 2015
82bfeab
Update README.rst file
Danisan Oct 1, 2015
e159178
add absolute ref to apikey.py
Danisan Oct 1, 2015
39200a3
Change import method
Danisan Oct 1, 2015
07d51ce
Include License AGPL in manifest
Danisan Jan 6, 2016
8743bdb
backup
Danisan Jan 17, 2016
3360bd2
[IMP] Added dependency over webservices_generic
Danisan Jan 17, 2016
a2e7a98
Update readme file
Danisan Jan 17, 2016
a2e168d
[FIX] Travis. Remove pylint check
Danisan Jan 17, 2016
fa68776
[FIX] correction to function in cron process.
Danisan Jan 18, 2016
ab4de86
change % with format
Danisan Dec 20, 2016
a83d25e
Adapt to api 8.0
Danisan Mar 29, 2017
78eb153
[FIX] Cron Scheduler Adapt to api 8.0
Danisan Mar 29, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is a sample .codeclimate.yml configured for Engine analysis on Code
# Climate Platform. For an overview of the Code Climate Platform, see here:
# http://docs.codeclimate.com/article/300-the-codeclimate-platform

# Under the engines key, you can configure which engines will analyze your repo.
# Each key is an engine name. For each value, you need to specify enabled: true
# to enable the engine as well as any other engines-specific configuration.

# For more details, see here:
# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform

# For a list of all available engines, see here:
# http://docs.codeclimate.com/article/296-engines-available-engines

engines:
# to turn on an engine, add it here and set enabled to `true`
# to turn off an engine, set enabled to `false` or remove it
rubocop:
enabled: true
golint:
enabled: true
gofmt:
enabled: true
eslint:
enabled: true
csslint:
enabled: true

# Engines can analyze files and report issues on them, but you can separately
# decide which files will receive ratings based on those issues. This is
# specified by path patterns under the ratings key.

# For more details see here:
# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform

# Note: If the ratings key is not specified, this will result in a 0.0 GPA on your dashboard.

# ratings:
# paths:
# - app/**
# - lib/**
# - "**.rb"
# - "**.go"

# You can globally exclude files from being analyzed by any engine using the
# exclude_paths key.

#exclude_paths:
#- spec/**/*
#- vendor/**/*
20 changes: 20 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Config file .coveragerc

[report]
include =
*/odoo-chile/l10n_cl_financial_indicators/*

omit =
*/scenario/*
*/scenarios/*
*/test/*
*/tests/*
*__init__.py
*__openerp__.py

# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about null context checking
if context is None:
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.pyc
.~*
apikey.py


37 changes: 37 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
addons:
apt:
packages:
- python-httplib2
code_climate:
repo_token: 97a9e35b387576e47a2c78ad5430580fb9764423cb692e088ef2392524860159

language: python
sudo: false
cache: pip

python:
- '2.7'

env:
#- VERSION="8.0" LINT_CHECK="1"
- VERSION="8.0" ODOO_REPO="odoo/odoo" LINT_CHECK="0"
- VERSION="8.0" ODOO_REPO="OCA/OCB" LINT_CHECK="0"

matrix:
- TESTS="1" ODOO_REPO="odoo/odoo"
- UNIT_TEST="1"

virtualenv:
system_site_packages: true

install:

- git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly

script:
- travis_run_tests

after_success:
- coveralls
Empty file modified LICENSE
100644 → 100755
Empty file.
90 changes: 67 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[![Build Status](https://travis-ci.org/odoo-chile/l10n_cl_financial_indicators.svg)](https://travis-ci.org/odoo-chile/l10n_cl_financial_indicators)
[![Coverage Status](https://coveralls.io/repos/odoo-chile/l10n_cl_financial_indicators/badge.svg?branch=8.0&service=github)](https://coveralls.io/github/odoo-chile/l10n_cl_financial_indicators?branch=8.0)
[![Code Climate](https://codeclimate.com/github/odoo-chile/l10n_cl_financial_indicators/badges/gpa.svg)](https://codeclimate.com/github/odoo-chile/l10n_cl_financial_indicators)


Odoo - Update Chilean Financial Indicators
==========================================


Module that updates the following indicators used in Chile for Odoo
sofware:

Expand All @@ -13,21 +17,42 @@ UTM
It connects to SBIFs webservices. Prior to use, you must get your
own apikey from this webpage:

An then replace it at:
#Version 1.0

apikey.py
(rename apikey.py.sample to apikey.py and include your own api key there)
##Enhancementes of this version
##-----------------------------
1) Ensure that base currency is set to CLP
2) Adds UF y UTM as currencies. In case they have been deleted, it also adds USD and EUR
3) Allow to manage update of each currency manually.
4) It makes calculation with needed precision.
5) Dependency: this module depends on a generic webservices module, which acts as a repository for more webservices (webservices_generic)
webservices_generic allows to add several kind of webservices you could need inside Odoo.

You must also have the following these currency values loaded in your
system, using the following Id for each one:

USD
EUR
UF
UTM
##ToDo
##-----
1) Launch a wizard when installed, so that you can add your SBIF apikey just once.


##Important!
##-----------------------------
If you are upgrading from previous version, we advice to delete UF and UTM. This way the external reference name
will be correctly established.

You should also install these modules for better experience:
account_invoice_prices_update (purchases)
base_currency_inverse_rate (to see the inverse rate, which is always more familiar to your brain)


Currency or pseudo/currencies updated by the module:
USD, EUR, UF, UTM

## Credits
<p>
<img alt="Logo BMYA" src="http://crm.blancomartin.cl/index.php?entryPoint=image&name=c82ab43f-e8dd-b2fa-25ff-56017f69d116" />
</p>
**Blanco Martin & Asociados EIRL** - http://blancomartin.cl

If the spell is not the same, this implementation won't be able to find
the currencies or the indexes to update.

Actualizador de indices financieros chilenos para Odoo
======================================================
Expand All @@ -47,20 +72,39 @@ desde esta página web:

http://api.sbif.cl/api/contactanos.jsp

Y entonces, reemplazar la misma en:
Monedas que actualiza:
USD, EUR, UF, UTM

apikey.py
Si la nomenclatura no es exactamente la misma, esta implementacion
no podrá encontrar las monedas para ser actualizadas.

(renombra apikey.py.sample a apikey.py e incluye allí tu propia clave api)
#Versión 1.0

Ud. deberá tener las siguientes monedas ingresadas en su sistema Odoo,
utilizando la siguiente identificación para las mismas:
##Mejoras realizadas en el módulo
##-------------------------------
1) Asegura que esté la moneda contable (CLP) es la moneda base.
2) ingresa UF y UTM como monedas. En caso que no estén ingresa también USD y EUR
3) permite manejar la actualización de cada una de las monedas manualmente
4) realiza el cálculo de manera correcta. (OK)
5) mejora: se incorporó un repositorio de webservices. (webservices_generic)
La idea es que este módulo sirva como repositorio de servidores para diferentes servicios que se quieran incorporar a Odoo.

USD
EUR
UF
UTM

Si la nomenclatura no es exactamente la misma, esta implementacion
no podrá encontrar las monedas para ser actualizadas.
##Mejoras Para hacer
##------------------
1) Que lance un asistente (wizard) cuando se instale, de manera que permita el ingreso de la clave api del
SBIF sólo una vez.

##Recomendaciones (Importante!)
##-----------------------------
Eliminar las monedas UF y UTM si ya las tienen ingresadas de antes, para que tome las referencias correctas.
Instalar además los siguientes módulos:
account_invoice_prices_update (para compras)
base_currency_inverse_rate (para poder ver los rates de monedas en fórmula inversa)


## Credits
<p>
<img alt="Logo BMYA" src="http://crm.blancomartin.cl/index.php?entryPoint=image&name=c82ab43f-e8dd-b2fa-25ff-56017f69d116" />
</p>
**Blanco Martin & Asociados EIRL** - http://blancomartin.cl
3 changes: 2 additions & 1 deletion __init__.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# -*- coding: utf-8 -*-
import l10n_cl_financial_indicators
from . import models

55 changes: 27 additions & 28 deletions __openerp__.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# Copyright (C) 2004-2015 OdooL (<http://odoo.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This module authored by Daniel Blanco, Blanco Martín & Asociados
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Odoo, Open Source Management Solution
# Copyright (C) 2004-2015 OdooL (<http://odoo.com>).
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This module authored by Daniel Blanco, Blanco Martín & Asociados
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################


{
'name': 'Chilean Financial Indicators',
'version': '0.1',
'version': '1.0',
'category': 'Tools',
'complexity': "easy",
'description': "Update UF, UTM and Dollar Official Value in a daily basis using SBIF webservices",
'author': 'Blanco Martin y Asociados',
'license': 'AGPL-3',
'description': '''Update UF, UTM and Dollar Official Value in a daily basis
using SBIF webservices''',
'author': 'Blanco Martin & Asociados',
'website': 'http://blancomartin.cl',
'depends': ['base'],
'init_xml': [],
'update_xml': [
'ir_cron.xml'
],
'demo_xml': [
'depends': [
'base',
'webservices_generic',
'decimal_precision_currency'
],
'test':[
'data': [
'views/update_button.xml',
'data/ir_cron.xml',
'data/res.currency.csv',
'data/webservices.server.csv',
],
'installable': True,
}
Expand Down
1 change: 0 additions & 1 deletion apikey.py.sample

This file was deleted.

11 changes: 5 additions & 6 deletions ir_cron.xml → data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data noupdate="True">
<data noupdate="False">
<record model='ir.cron' id='update_cl_financial'>
<field name='name'>Update Chilean Financial Indicators</field>
<field name='active'>True</field>
<field name='priority'>5</field>
<field name='interval_number'>1</field>
<field name='number_call'>-1</field>
<field name='interval_type'>days</field>
<field name='model'>res.currency.rate</field>
<field name='numbercall'>-1</field>
<field name='interval_type'>hours</field>
<field name='model'>webservices.server</field>
<field name='function'>currency_schedule_update</field>
<field name='args'>()</field>
</record>
</data>
</openerp>

</openerp>
7 changes: 7 additions & 0 deletions data/res.currency.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"id","active","base","rounding","name","position","accuracy","symbol"
"base.EUR","True","False","0.01","EUR","before","4","€"
"base.UF","True","False","","UF","after","15","UF"
"base.USD","True","False","0.01","USD","before","4","$"
"base.UTM","True","False","1e-06","UTM","after","6","UTM"
"base.CLP","True","True","1.0","CLP","before","4","$"

5 changes: 5 additions & 0 deletions data/webservices.server.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"id","active","additional_parameter","auth_method","auth_method_name","http_auth_method","name","response_format","response_format_name","scope","just_url","url"
"sbif_usd","True","formato","data_token","apikey","GET","SBIFUSD","JSON","formato","generic","FALSE","http://api.sbif.cl/api-sbifv3/recursos_api/dolar/"
"sbif_uf","True","formato","data_token","apikey","GET","SBIFUF","JSON","formato","generic","FALSE","http://api.sbif.cl/api-sbifv3/recursos_api/uf/"
"sbif_utm","True","formato","data_token","apikey","GET","SBIFUTM","JSON","formato","generic","FALSE","http://api.sbif.cl/api-sbifv3/recursos_api/utm/"
"sbif_eur","True","formato","data_token","apikey","GET","SBIFEUR","JSON","formato","generic","FALSE","http://api.sbif.cl/api-sbifv3/recursos_api/euro/"
44 changes: 0 additions & 44 deletions l10n_cl_financial_indicators.py

This file was deleted.

2 changes: 2 additions & 0 deletions models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import l10n_cl_financial_indicators
Loading