├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows
│ ├── clean.yaml
│ ├── linting.yaml
│ └── tests.yaml
├── .gitignore
├── Dockerfile
├── README.md
├── assets
├── image1.png
├── image2.png
├── image3.png
├── image4.png
└── image5.png
├── l10n_do_currency_update
├── LICENCE
├── README.md
├── __init__.py
├── __manifest__.py
├── data
│ ├── ir_config_parameter_data.xml
│ └── ir_cron_data.xml
├── demo
│ └── res_company_demo.xml
├── i18n
│ └── es_DO.po
├── models
│ ├── __init__.py
│ ├── res_company.py
│ └── res_config_settings.py
├── static
│ └── description
│ │ ├── icon.png
│ │ └── index.html
├── tests
│ ├── __init__.py
│ └── test_get_currency_rates.py
└── views
│ └── res_config_settings_views.xml
├── l10n_do_ncf_validation
├── __init__.py
├── __manifest__.py
├── data
│ └── ir_config_parameter_data.xml
├── i18n
│ └── es_DO.po
├── models
│ ├── __init__.py
│ ├── account_move.py
│ ├── res_company.py
│ └── res_config_settings.py
├── static
│ └── description
│ │ └── icon.png
└── views
│ └── res_config_settings_views.xml
├── l10n_do_rnc_validation
├── README.rst
├── __init__.py
├── __manifest__.py
├── data
│ └── ir_config_parameter_data.xml
├── i18n
│ └── es_DO.po
├── migrations
│ └── 14.0.2.1.0
│ │ └── post-init_migrate_fields.py
├── models
│ ├── __init__.py
│ ├── res_company.py
│ ├── res_config_settings.py
│ └── res_partner.py
└── views
│ ├── res_config_settings_views.xml
│ └── res_partner_views.xml
└── requirements.txt
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: indexa-git
4 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | #### Impacted versions
11 |
12 | #### Steps to reproduce
13 |
14 | #### Current behavior
15 |
16 | #### Expected behavior
17 |
18 | #### Video/Screenshot link (optional)
19 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/workflows/clean.yaml:
--------------------------------------------------------------------------------
1 | name: Clean Deployment
2 |
3 | on:
4 | push:
5 | branches:
6 | - '[0-9]+.0'
7 | paths:
8 | - '**/src/**'
9 | - '**/i18n/**'
10 | - '**.py'
11 | - '**.xml'
12 |
13 | jobs:
14 | deployment:
15 | name: GKE clean Deploy
16 | continue-on-error: true
17 | runs-on: ubuntu-latest
18 | env:
19 | PROJECT_ID: ${{ secrets.GKE_PROJECT }}
20 | GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }}
21 | GKE_ZONE: ${{ secrets.GKE_ZONE }}
22 |
23 | steps:
24 | - name: Download Deployment.yaml
25 | continue-on-error: true
26 | uses: dawidd6/action-download-artifact@v6
27 | with:
28 | workflow: tests.yaml
29 | workflow_conclusion: success
30 | pr: ${{github.event.pull_request.number}}
31 | name: deployment
32 | path: deployment
33 |
34 | - name: Inject slug/short variables
35 | uses: rlespinasse/github-slug-action@v2.x
36 |
37 | - name: K8s Template
38 | uses: actions/checkout@v3
39 | with:
40 | repository: indexa-git/gke-dev-cluster.git
41 | path: gke-dev-cluster
42 | token: ${{ secrets.ACTIONS_PAT }}
43 | ref: master
44 |
45 | - name: Setup gcloud CLI
46 | uses: GoogleCloudPlatform/github-actions/setup-gcloud@main
47 | with:
48 | version: '290.0.1'
49 | service_account_key: ${{ secrets.GKE_SA_KEY }}
50 | project_id: ${{ secrets.GKE_PROJECT }}
51 |
52 | # Configure Docker to use the gcloud command-line tool as a credential
53 | # helper for authentication
54 | - name: Get Cluster & Docker credentials
55 | run: |
56 | gcloud container clusters get-credentials "$GKE_CLUSTER" --zone "$GKE_ZONE" --project "$PROJECT_ID"
57 | gcloud --quiet auth configure-docker
58 |
59 | # Remove the Docker image from the GKE cluster
60 | - name: Remove Deployment
61 | continue-on-error: true
62 | run: |
63 | kubectl delete -f deployment/deployment.yaml
64 |
--------------------------------------------------------------------------------
/.github/workflows/linting.yaml:
--------------------------------------------------------------------------------
1 | name: Linting
2 |
3 | on:
4 | push:
5 | branches:
6 | - '**'
7 | paths:
8 | - '**.py'
9 |
10 | pull_request:
11 | branches:
12 | - '**'
13 |
14 | jobs:
15 | flake8:
16 | runs-on: ubuntu-latest
17 | continue-on-error: true
18 | steps:
19 | - uses: actions/checkout@v3
20 | - uses: actions/setup-python@v4
21 | with:
22 | python-version: 3.10.16
23 | - run: pip install flake8
24 | - name: Lint with flake8
25 | run: |
26 | # stop the build if there are Python syntax errors or undefined names
27 | flake8 . --count --exit-zero --select E9,F63,F7,F82 --ignore E203,E501,W503 \
28 | --exclude __unported__,__init__.py,examples --show-source --statistics
29 | # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30 | flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
31 |
32 | - name: Check Flake8
33 | uses: TrueBrain/actions-flake8@master
34 | with:
35 | ignore: E123,E133,E226,E241,E242,F811,F601,W503,W504,E203,F401
36 | max_line_length: 120
37 |
38 | pylint:
39 | runs-on: ubuntu-latest
40 | continue-on-error: true
41 | steps:
42 | - uses: actions/checkout@v3
43 |
44 | - name: Inject slug/short variables
45 | uses: rlespinasse/github-slug-action@v4.x
46 |
47 | - run: curl https://raw.githubusercontent.com/iterativo-git/dockerdoo/master/.devcontainer/.vscode/oca_pylint.cfg -o oca_pylint.cfg
48 | - uses: actions/setup-python@v4
49 | with:
50 | python-version: 3.10.16
51 | - run: pip install pylint_odoo
52 | - run: |
53 | pylint **/*.py --exit-zero --rcfile oca_pylint.cfg --load-plugins pylint_odoo
54 |
--------------------------------------------------------------------------------
/.github/workflows/tests.yaml:
--------------------------------------------------------------------------------
1 | name: Unit Tests
2 |
3 | on:
4 | push:
5 | branches:
6 | - '[0-9]+.0'
7 | paths:
8 | - '**/workflows/**'
9 | - '**/src/**'
10 | - '**/i18n/**'
11 | - '**.py'
12 | - '**.xml'
13 | pull_request:
14 | branches:
15 | - '[0-9]+.0'
16 | types: [ opened, synchronize, reopened, labeled ]
17 |
18 | env:
19 | REQUIRED_MODULES: 'session_redis' # list of addional addons to install separated by comma
20 | TEST_TAGS: '0'
21 |
22 | jobs:
23 | test:
24 | name: Test Modules
25 | runs-on: ubuntu-latest
26 | permissions:
27 | contents: read
28 | id-token: write
29 | outputs:
30 | get_modules: ${{ steps.get_modules.outputs.modules }}
31 | services:
32 | db:
33 | image: postgres:14-alpine
34 | env:
35 | POSTGRES_DB: postgres
36 | POSTGRES_USER: odoo
37 | POSTGRES_PASSWORD: odoo
38 | # needed because the postgres container does not provide a healthcheck
39 | options: >-
40 | --health-cmd pg_isready
41 | --health-interval 10s
42 | --health-timeout 5s
43 | --health-retries 5
44 | ports:
45 | - 5432:5432
46 |
47 | steps:
48 | - name: Inject slug/short variables
49 | uses: rlespinasse/github-slug-action@v5.x
50 |
51 | - name: INDEXA ${{ env.GITHUB_REPOSITORY_NAME_PART_SLUG_URL }}
52 | uses: actions/checkout@v4
53 | with:
54 | path: ${{ env.GITHUB_REPOSITORY_SLUG_URL }}
55 |
56 | - name: Download python addons script
57 | run: curl https://raw.githubusercontent.com/iterativo-git/dockerdoo/${{ env.GITHUB_BASE_REF_SLUG || env.GITHUB_REF_SLUG }}/resources/getaddons.py -o getaddons.py
58 |
59 | - name: CamptoCamp odoo-cloud-platform
60 | uses: actions/checkout@v4
61 | with:
62 | repository: camptocamp/odoo-cloud-platform
63 | path: odoo-cloud-platform
64 | ref: '${{ env.GITHUB_BASE_REF_SLUG || env.GITHUB_REF_SLUG }}'
65 |
66 | - name: Odoo Enterprise
67 | uses: actions/checkout@v4
68 | with:
69 | repository: odoo/enterprise
70 | token: ${{ secrets.ACTIONS_PAT }}
71 | path: enterprise
72 | ref: '${{ env.GITHUB_BASE_REF_SLUG || env.GITHUB_REF_SLUG }}'
73 |
74 | - name: INDEXA l10n-dominicana
75 | uses: actions/checkout@v4
76 | with:
77 | repository: indexa-git/l10n-dominicana
78 | path: l10n-dominicana
79 | # TODO change this to ${{ env.GITHUB_BASE_REF_SLUG || env.GITHUB_REF_SLUG }}
80 | ref: '${{ env.GITHUB_BASE_REF_SLUG || env.GITHUB_REF_SLUG }}'
81 |
82 | - name: Select Odoo modules to install
83 | id: get_modules
84 | run: |
85 | output=$(python -c "from getaddons import get_modules; print(','.join(get_modules('$GITHUB_WORKSPACE/${{ env.GITHUB_REPOSITORY_SLUG_URL }}', depth=3)))")
86 | echo $output
87 | echo "::set-output name=modules::$output"
88 |
89 | - name: Set test all tag
90 | if: ${{ github.event.label.name == 'test all' }}
91 | run: |
92 | echo "WITHOUT_TEST_TAGS=1" >> $GITHUB_ENV
93 |
94 | - name: Authenticate to Google Cloud
95 | id: auth
96 | uses: google-github-actions/auth@v2.1.3
97 | with:
98 | project_id: '${{ vars.ITERATIVO_GCP_PROJECT }}'
99 | workload_identity_provider: '${{ vars.ITERATIVO_GCP_WORKLOAD_IDENTITY }}'
100 | service_account: '${{ vars.ITERATIVO_GCP_ARTIFACTS_SA }}'
101 | token_format: access_token
102 |
103 | - name: Login to Google Artifact Registry
104 | uses: docker/login-action@v3.3.0
105 | with:
106 | registry: gcr.io
107 | username: oauth2accesstoken
108 | password: ${{ steps.auth.outputs.access_token }}
109 |
110 | - name: Run Odoo tests
111 | run: |
112 | docker pull gcr.io/${{ vars.ITERATIVO_GCP_PROJECT }}/iterativo/dockerdoo:${{ env.GITHUB_BASE_REF_SLUG || env.GITHUB_REF_SLUG }}
113 | docker run -e RUN_TESTS -e WITHOUT_TEST_TAGS -e PIP_AUTO_INSTALL -e LOG_LEVEL -e WITHOUT_DEMO -e EXTRA_MODULES -e ODOO_EXTRA_ADDONS -e PGHOST \
114 | -v $GITHUB_WORKSPACE:/github/workspace \
115 | --network="host" --name odoo -t gcr.io/${{ vars.ITERATIVO_GCP_PROJECT }}/iterativo/dockerdoo:${{ env.GITHUB_BASE_REF_SLUG || env.GITHUB_REF_SLUG }}
116 | env:
117 | RUN_TESTS: '1'
118 | WITHOUT_TEST_TAGS: ${{ env.WITHOUT_TEST_TAGS }}
119 | PIP_AUTO_INSTALL: '1'
120 | LOG_LEVEL: test
121 | WITHOUT_DEMO: 'False'
122 | EXTRA_MODULES: ${{ steps.get_modules.outputs.modules }},${{ env.REQUIRED_MODULES }}
123 | ODOO_EXTRA_ADDONS: /github/workspace
124 | PGHOST: localhost
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # sphinx build directories
2 | _build/
3 |
4 | # dotfiles
5 | .*
6 | !.gitignore
7 | !.mailmap
8 | !.github
9 | # compiled python files
10 | *.py[co]
11 | __pycache__/
12 | # setup.py egg_info
13 | *.egg-info
14 | # emacs backup files
15 | *~
16 | # hg stuff
17 | *.orig
18 | status
19 | # odoo filestore
20 | odoo/filestore
21 | # maintenance migration scripts
22 | odoo/addons/base/maintenance
23 |
24 | # generated for windows installer?
25 | install/win32/*.bat
26 | install/win32/meta.py
27 |
28 | # needed only when building for win32
29 | setup/win32/static/less/
30 | setup/win32/static/wkhtmltopdf/
31 | setup/win32/static/postgresql*.exe
32 |
33 | # various virtualenv
34 | /bin/
35 | /build/
36 | /dist/
37 | /include/
38 | /lib/
39 | /man/
40 | /share/
41 | /src/
42 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM gcr.io/iterativo/dockerdoo:15.0
2 | ENV ODOO_EXTRA_ADDONS /mnt/extra-addons
3 | USER root
4 | RUN sudo mkdir -p ${ODOO_EXTRA_ADDONS}
5 | COPY . ${ODOO_EXTRA_ADDONS}
6 | RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends build-essential \
7 | && find ${ODOO_EXTRA_ADDONS} -name 'requirements.txt' -exec pip3 --no-cache-dir install -r {} \; \
8 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
9 | && rm -rf /var/lib/apt/lists/*
10 | RUN sudo chown -R 1000:1000 ${ODOO_EXTRA_ADDONS}
11 | USER 1000
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 | 
3 |
4 | **🔈Aviso Importante: Cambios en la Disponibilidad del Servicio INDEXA API**
5 |
6 | Estimados usuarios,
7 |
8 | Por más de **8 años** , INDEXA SRL ha tenido el privilegio de ofrecer acceso gratuito a nuestro servicio **INDEXA API** , una herramienta que ha permitido consultas esenciales como **RNC, NCF, Tasas Bancarias de múltiples instituciones y Precios de Combustibles**. Durante este tiempo, hemos sido testigos del impacto positivo que este servicio ha tenido en empresas de todos los tamaños, desde pequeñas startups hasta grandes corporaciones, así como en integradores de soluciones tecnológicas y proveedores de distintos software ERP.
9 |
10 | Hemos visto cómo nuestro servicio ha sido utilizado para impulsar el crecimiento de negocios, optimizar procesos y facilitar la integración de soluciones tecnológicas. Sin embargo, tras una evaluación estratégica que responde a nuestra evolución hemos decidido ajustar nuestra oferta de soluciones, que nos permitirá seguir innovando y desarrollando soluciones alineadas con las necesidades de nuestros clientes.
11 |
12 | A partir del **15 de marzo de 2025** , el acceso al servicio **INDEXA API** estará disponible exclusivamente para nuestros clientes. Esta decisión nos permitirá seguir innovando y brindando valor a quienes han confiado en nosotros como socios estratégicos.
13 |
14 | Reconocemos y celebramos el papel que nuestro servicio ha jugado en el éxito de tantas empresas durante estos años. Sin embargo, consideramos que esta nueva dirección es necesaria para continuar ofreciendo soluciones de alta calidad y mantenernos alineados con las necesidades de nuestros clientes directos.
15 |
16 | Para aquellos interesados en seguir utilizando **INDEXA API** , los invitamos a explorar las opciones disponibles dentro de nuestros productos principales o a contactarnos para discutir alternativas personalizadas.
17 |
18 | ¡Gracias por ser parte de nuestra historia\!
19 |
20 | Atentamente,
21 |
22 | 
23 |
24 | Emmanuel Peña
25 | **Chief Executive Officer**
26 | **Progressa Corporate Group**
27 |
28 | 
29 |
30 | 
31 |
--------------------------------------------------------------------------------
/assets/image1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/indexa-git/external-service-addons/057ec59ffab7ed896d5e925814555acaf9e4eb0c/assets/image1.png
--------------------------------------------------------------------------------
/assets/image2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/indexa-git/external-service-addons/057ec59ffab7ed896d5e925814555acaf9e4eb0c/assets/image2.png
--------------------------------------------------------------------------------
/assets/image3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/indexa-git/external-service-addons/057ec59ffab7ed896d5e925814555acaf9e4eb0c/assets/image3.png
--------------------------------------------------------------------------------
/assets/image4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/indexa-git/external-service-addons/057ec59ffab7ed896d5e925814555acaf9e4eb0c/assets/image4.png
--------------------------------------------------------------------------------
/assets/image5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/indexa-git/external-service-addons/057ec59ffab7ed896d5e925814555acaf9e4eb0c/assets/image5.png
--------------------------------------------------------------------------------
/l10n_do_currency_update/LICENCE:
--------------------------------------------------------------------------------
1 |
2 |
3 | Odoo is published under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3
4 | (LGPLv3), as included below. Since the LGPL is a set of additional
5 | permissions on top of the GPL, the text of the GPL is included at the
6 | bottom as well.
7 |
8 | Some external libraries and contributions bundled with Odoo may be published
9 | under other GPL-compatible licenses. For these, please refer to the relevant
10 | source files and/or license files, in the source code tree.
11 |
12 | **************************************************************************
13 |
14 | GNU LESSER GENERAL PUBLIC LICENSE
15 | Version 3, 29 June 2007
16 |
17 | Copyright (C) 2007 Free Software Foundation, Inc.
18 | Everyone is permitted to copy and distribute verbatim copies
19 | of this license document, but changing it is not allowed.
20 |
21 |
22 | This version of the GNU Lesser General Public License incorporates
23 | the terms and conditions of version 3 of the GNU General Public
24 | License, supplemented by the additional permissions listed below.
25 |
26 | 0. Additional Definitions.
27 |
28 | As used herein, "this License" refers to version 3 of the GNU Lesser
29 | General Public License, and the "GNU GPL" refers to version 3 of the GNU
30 | General Public License.
31 |
32 | "The Library" refers to a covered work governed by this License,
33 | other than an Application or a Combined Work as defined below.
34 |
35 | An "Application" is any work that makes use of an interface provided
36 | by the Library, but which is not otherwise based on the Library.
37 | Defining a subclass of a class defined by the Library is deemed a mode
38 | of using an interface provided by the Library.
39 |
40 | A "Combined Work" is a work produced by combining or linking an
41 | Application with the Library. The particular version of the Library
42 | with which the Combined Work was made is also called the "Linked
43 | Version".
44 |
45 | The "Minimal Corresponding Source" for a Combined Work means the
46 | Corresponding Source for the Combined Work, excluding any source code
47 | for portions of the Combined Work that, considered in isolation, are
48 | based on the Application, and not on the Linked Version.
49 |
50 | The "Corresponding Application Code" for a Combined Work means the
51 | object code and/or source code for the Application, including any data
52 | and utility programs needed for reproducing the Combined Work from the
53 | Application, but excluding the System Libraries of the Combined Work.
54 |
55 | 1. Exception to Section 3 of the GNU GPL.
56 |
57 | You may convey a covered work under sections 3 and 4 of this License
58 | without being bound by section 3 of the GNU GPL.
59 |
60 | 2. Conveying Modified Versions.
61 |
62 | If you modify a copy of the Library, and, in your modifications, a
63 | facility refers to a function or data to be supplied by an Application
64 | that uses the facility (other than as an argument passed when the
65 | facility is invoked), then you may convey a copy of the modified
66 | version:
67 |
68 | a) under this License, provided that you make a good faith effort to
69 | ensure that, in the event an Application does not supply the
70 | function or data, the facility still operates, and performs
71 | whatever part of its purpose remains meaningful, or
72 |
73 | b) under the GNU GPL, with none of the additional permissions of
74 | this License applicable to that copy.
75 |
76 | 3. Object Code Incorporating Material from Library Header Files.
77 |
78 | The object code form of an Application may incorporate material from
79 | a header file that is part of the Library. You may convey such object
80 | code under terms of your choice, provided that, if the incorporated
81 | material is not limited to numerical parameters, data structure
82 | layouts and accessors, or small macros, inline functions and templates
83 | (ten or fewer lines in length), you do both of the following:
84 |
85 | a) Give prominent notice with each copy of the object code that the
86 | Library is used in it and that the Library and its use are
87 | covered by this License.
88 |
89 | b) Accompany the object code with a copy of the GNU GPL and this license
90 | document.
91 |
92 | 4. Combined Works.
93 |
94 | You may convey a Combined Work under terms of your choice that,
95 | taken together, effectively do not restrict modification of the
96 | portions of the Library contained in the Combined Work and reverse
97 | engineering for debugging such modifications, if you also do each of
98 | the following:
99 |
100 | a) Give prominent notice with each copy of the Combined Work that
101 | the Library is used in it and that the Library and its use are
102 | covered by this License.
103 |
104 | b) Accompany the Combined Work with a copy of the GNU GPL and this license
105 | document.
106 |
107 | c) For a Combined Work that displays copyright notices during
108 | execution, include the copyright notice for the Library among
109 | these notices, as well as a reference directing the user to the
110 | copies of the GNU GPL and this license document.
111 |
112 | d) Do one of the following:
113 |
114 | 0) Convey the Minimal Corresponding Source under the terms of this
115 | License, and the Corresponding Application Code in a form
116 | suitable for, and under terms that permit, the user to
117 | recombine or relink the Application with a modified version of
118 | the Linked Version to produce a modified Combined Work, in the
119 | manner specified by section 6 of the GNU GPL for conveying
120 | Corresponding Source.
121 |
122 | 1) Use a suitable shared library mechanism for linking with the
123 | Library. A suitable mechanism is one that (a) uses at run time
124 | a copy of the Library already present on the user's computer
125 | system, and (b) will operate properly with a modified version
126 | of the Library that is interface-compatible with the Linked
127 | Version.
128 |
129 | e) Provide Installation Information, but only if you would otherwise
130 | be required to provide such information under section 6 of the
131 | GNU GPL, and only to the extent that such information is
132 | necessary to install and execute a modified version of the
133 | Combined Work produced by recombining or relinking the
134 | Application with a modified version of the Linked Version. (If
135 | you use option 4d0, the Installation Information must accompany
136 | the Minimal Corresponding Source and Corresponding Application
137 | Code. If you use option 4d1, you must provide the Installation
138 | Information in the manner specified by section 6 of the GNU GPL
139 | for conveying Corresponding Source.)
140 |
141 | 5. Combined Libraries.
142 |
143 | You may place library facilities that are a work based on the
144 | Library side by side in a single library together with other library
145 | facilities that are not Applications and are not covered by this
146 | License, and convey such a combined library under terms of your
147 | choice, if you do both of the following:
148 |
149 | a) Accompany the combined library with a copy of the same work based
150 | on the Library, uncombined with any other library facilities,
151 | conveyed under the terms of this License.
152 |
153 | b) Give prominent notice with the combined library that part of it
154 | is a work based on the Library, and explaining where to find the
155 | accompanying uncombined form of the same work.
156 |
157 | 6. Revised Versions of the GNU Lesser General Public License.
158 |
159 | The Free Software Foundation may publish revised and/or new versions
160 | of the GNU Lesser General Public License from time to time. Such new
161 | versions will be similar in spirit to the present version, but may
162 | differ in detail to address new problems or concerns.
163 |
164 | Each version is given a distinguishing version number. If the
165 | Library as you received it specifies that a certain numbered version
166 | of the GNU Lesser General Public License "or any later version"
167 | applies to it, you have the option of following the terms and
168 | conditions either of that published version or of any later version
169 | published by the Free Software Foundation. If the Library as you
170 | received it does not specify a version number of the GNU Lesser
171 | General Public License, you may choose any version of the GNU Lesser
172 | General Public License ever published by the Free Software Foundation.
173 |
174 | If the Library as you received it specifies that a proxy can decide
175 | whether future versions of the GNU Lesser General Public License shall
176 | apply, that proxy's public statement of acceptance of any version is
177 | permanent authorization for you to choose that version for the
178 | Library.
179 |
180 | **************************************************************************
181 |
182 | GNU GENERAL PUBLIC LICENSE
183 | Version 3, 29 June 2007
184 |
185 | Copyright (C) 2007 Free Software Foundation, Inc.
186 | Everyone is permitted to copy and distribute verbatim copies
187 | of this license document, but changing it is not allowed.
188 |
189 | Preamble
190 |
191 | The GNU General Public License is a free, copyleft license for
192 | software and other kinds of works.
193 |
194 | The licenses for most software and other practical works are designed
195 | to take away your freedom to share and change the works. By contrast,
196 | the GNU General Public License is intended to guarantee your freedom to
197 | share and change all versions of a program--to make sure it remains free
198 | software for all its users. We, the Free Software Foundation, use the
199 | GNU General Public License for most of our software; it applies also to
200 | any other work released this way by its authors. You can apply it to
201 | your programs, too.
202 |
203 | When we speak of free software, we are referring to freedom, not
204 | price. Our General Public Licenses are designed to make sure that you
205 | have the freedom to distribute copies of free software (and charge for
206 | them if you wish), that you receive source code or can get it if you
207 | want it, that you can change the software or use pieces of it in new
208 | free programs, and that you know you can do these things.
209 |
210 | To protect your rights, we need to prevent others from denying you
211 | these rights or asking you to surrender the rights. Therefore, you have
212 | certain responsibilities if you distribute copies of the software, or if
213 | you modify it: responsibilities to respect the freedom of others.
214 |
215 | For example, if you distribute copies of such a program, whether
216 | gratis or for a fee, you must pass on to the recipients the same
217 | freedoms that you received. You must make sure that they, too, receive
218 | or can get the source code. And you must show them these terms so they
219 | know their rights.
220 |
221 | Developers that use the GNU GPL protect your rights with two steps:
222 | (1) assert copyright on the software, and (2) offer you this License
223 | giving you legal permission to copy, distribute and/or modify it.
224 |
225 | For the developers' and authors' protection, the GPL clearly explains
226 | that there is no warranty for this free software. For both users' and
227 | authors' sake, the GPL requires that modified versions be marked as
228 | changed, so that their problems will not be attributed erroneously to
229 | authors of previous versions.
230 |
231 | Some devices are designed to deny users access to install or run
232 | modified versions of the software inside them, although the manufacturer
233 | can do so. This is fundamentally incompatible with the aim of
234 | protecting users' freedom to change the software. The systematic
235 | pattern of such abuse occurs in the area of products for individuals to
236 | use, which is precisely where it is most unacceptable. Therefore, we
237 | have designed this version of the GPL to prohibit the practice for those
238 | products. If such problems arise substantially in other domains, we
239 | stand ready to extend this provision to those domains in future versions
240 | of the GPL, as needed to protect the freedom of users.
241 |
242 | Finally, every program is threatened constantly by software patents.
243 | States should not allow patents to restrict development and use of
244 | software on general-purpose computers, but in those that do, we wish to
245 | avoid the special danger that patents applied to a free program could
246 | make it effectively proprietary. To prevent this, the GPL assures that
247 | patents cannot be used to render the program non-free.
248 |
249 | The precise terms and conditions for copying, distribution and
250 | modification follow.
251 |
252 | TERMS AND CONDITIONS
253 |
254 | 0. Definitions.
255 |
256 | "This License" refers to version 3 of the GNU General Public License.
257 |
258 | "Copyright" also means copyright-like laws that apply to other kinds of
259 | works, such as semiconductor masks.
260 |
261 | "The Program" refers to any copyrightable work licensed under this
262 | License. Each licensee is addressed as "you". "Licensees" and
263 | "recipients" may be individuals or organizations.
264 |
265 | To "modify" a work means to copy from or adapt all or part of the work
266 | in a fashion requiring copyright permission, other than the making of an
267 | exact copy. The resulting work is called a "modified version" of the
268 | earlier work or a work "based on" the earlier work.
269 |
270 | A "covered work" means either the unmodified Program or a work based
271 | on the Program.
272 |
273 | To "propagate" a work means to do anything with it that, without
274 | permission, would make you directly or secondarily liable for
275 | infringement under applicable copyright law, except executing it on a
276 | computer or modifying a private copy. Propagation includes copying,
277 | distribution (with or without modification), making available to the
278 | public, and in some countries other activities as well.
279 |
280 | To "convey" a work means any kind of propagation that enables other
281 | parties to make or receive copies. Mere interaction with a user through
282 | a computer network, with no transfer of a copy, is not conveying.
283 |
284 | An interactive user interface displays "Appropriate Legal Notices"
285 | to the extent that it includes a convenient and prominently visible
286 | feature that (1) displays an appropriate copyright notice, and (2)
287 | tells the user that there is no warranty for the work (except to the
288 | extent that warranties are provided), that licensees may convey the
289 | work under this License, and how to view a copy of this License. If
290 | the interface presents a list of user commands or options, such as a
291 | menu, a prominent item in the list meets this criterion.
292 |
293 | 1. Source Code.
294 |
295 | The "source code" for a work means the preferred form of the work
296 | for making modifications to it. "Object code" means any non-source
297 | form of a work.
298 |
299 | A "Standard Interface" means an interface that either is an official
300 | standard defined by a recognized standards body, or, in the case of
301 | interfaces specified for a particular programming language, one that
302 | is widely used among developers working in that language.
303 |
304 | The "System Libraries" of an executable work include anything, other
305 | than the work as a whole, that (a) is included in the normal form of
306 | packaging a Major Component, but which is not part of that Major
307 | Component, and (b) serves only to enable use of the work with that
308 | Major Component, or to implement a Standard Interface for which an
309 | implementation is available to the public in source code form. A
310 | "Major Component", in this context, means a major essential component
311 | (kernel, window system, and so on) of the specific operating system
312 | (if any) on which the executable work runs, or a compiler used to
313 | produce the work, or an object code interpreter used to run it.
314 |
315 | The "Corresponding Source" for a work in object code form means all
316 | the source code needed to generate, install, and (for an executable
317 | work) run the object code and to modify the work, including scripts to
318 | control those activities. However, it does not include the work's
319 | System Libraries, or general-purpose tools or generally available free
320 | programs which are used unmodified in performing those activities but
321 | which are not part of the work. For example, Corresponding Source
322 | includes interface definition files associated with source files for
323 | the work, and the source code for shared libraries and dynamically
324 | linked subprograms that the work is specifically designed to require,
325 | such as by intimate data communication or control flow between those
326 | subprograms and other parts of the work.
327 |
328 | The Corresponding Source need not include anything that users
329 | can regenerate automatically from other parts of the Corresponding
330 | Source.
331 |
332 | The Corresponding Source for a work in source code form is that
333 | same work.
334 |
335 | 2. Basic Permissions.
336 |
337 | All rights granted under this License are granted for the term of
338 | copyright on the Program, and are irrevocable provided the stated
339 | conditions are met. This License explicitly affirms your unlimited
340 | permission to run the unmodified Program. The output from running a
341 | covered work is covered by this License only if the output, given its
342 | content, constitutes a covered work. This License acknowledges your
343 | rights of fair use or other equivalent, as provided by copyright law.
344 |
345 | You may make, run and propagate covered works that you do not
346 | convey, without conditions so long as your license otherwise remains
347 | in force. You may convey covered works to others for the sole purpose
348 | of having them make modifications exclusively for you, or provide you
349 | with facilities for running those works, provided that you comply with
350 | the terms of this License in conveying all material for which you do
351 | not control copyright. Those thus making or running the covered works
352 | for you must do so exclusively on your behalf, under your direction
353 | and control, on terms that prohibit them from making any copies of
354 | your copyrighted material outside their relationship with you.
355 |
356 | Conveying under any other circumstances is permitted solely under
357 | the conditions stated below. Sublicensing is not allowed; section 10
358 | makes it unnecessary.
359 |
360 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
361 |
362 | No covered work shall be deemed part of an effective technological
363 | measure under any applicable law fulfilling obligations under article
364 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
365 | similar laws prohibiting or restricting circumvention of such
366 | measures.
367 |
368 | When you convey a covered work, you waive any legal power to forbid
369 | circumvention of technological measures to the extent such circumvention
370 | is effected by exercising rights under this License with respect to
371 | the covered work, and you disclaim any intention to limit operation or
372 | modification of the work as a means of enforcing, against the work's
373 | users, your or third parties' legal rights to forbid circumvention of
374 | technological measures.
375 |
376 | 4. Conveying Verbatim Copies.
377 |
378 | You may convey verbatim copies of the Program's source code as you
379 | receive it, in any medium, provided that you conspicuously and
380 | appropriately publish on each copy an appropriate copyright notice;
381 | keep intact all notices stating that this License and any
382 | non-permissive terms added in accord with section 7 apply to the code;
383 | keep intact all notices of the absence of any warranty; and give all
384 | recipients a copy of this License along with the Program.
385 |
386 | You may charge any price or no price for each copy that you convey,
387 | and you may offer support or warranty protection for a fee.
388 |
389 | 5. Conveying Modified Source Versions.
390 |
391 | You may convey a work based on the Program, or the modifications to
392 | produce it from the Program, in the form of source code under the
393 | terms of section 4, provided that you also meet all of these conditions:
394 |
395 | a) The work must carry prominent notices stating that you modified
396 | it, and giving a relevant date.
397 |
398 | b) The work must carry prominent notices stating that it is
399 | released under this License and any conditions added under section
400 | 7. This requirement modifies the requirement in section 4 to
401 | "keep intact all notices".
402 |
403 | c) You must license the entire work, as a whole, under this
404 | License to anyone who comes into possession of a copy. This
405 | License will therefore apply, along with any applicable section 7
406 | additional terms, to the whole of the work, and all its parts,
407 | regardless of how they are packaged. This License gives no
408 | permission to license the work in any other way, but it does not
409 | invalidate such permission if you have separately received it.
410 |
411 | d) If the work has interactive user interfaces, each must display
412 | Appropriate Legal Notices; however, if the Program has interactive
413 | interfaces that do not display Appropriate Legal Notices, your
414 | work need not make them do so.
415 |
416 | A compilation of a covered work with other separate and independent
417 | works, which are not by their nature extensions of the covered work,
418 | and which are not combined with it such as to form a larger program,
419 | in or on a volume of a storage or distribution medium, is called an
420 | "aggregate" if the compilation and its resulting copyright are not
421 | used to limit the access or legal rights of the compilation's users
422 | beyond what the individual works permit. Inclusion of a covered work
423 | in an aggregate does not cause this License to apply to the other
424 | parts of the aggregate.
425 |
426 | 6. Conveying Non-Source Forms.
427 |
428 | You may convey a covered work in object code form under the terms
429 | of sections 4 and 5, provided that you also convey the
430 | machine-readable Corresponding Source under the terms of this License,
431 | in one of these ways:
432 |
433 | a) Convey the object code in, or embodied in, a physical product
434 | (including a physical distribution medium), accompanied by the
435 | Corresponding Source fixed on a durable physical medium
436 | customarily used for software interchange.
437 |
438 | b) Convey the object code in, or embodied in, a physical product
439 | (including a physical distribution medium), accompanied by a
440 | written offer, valid for at least three years and valid for as
441 | long as you offer spare parts or customer support for that product
442 | model, to give anyone who possesses the object code either (1) a
443 | copy of the Corresponding Source for all the software in the
444 | product that is covered by this License, on a durable physical
445 | medium customarily used for software interchange, for a price no
446 | more than your reasonable cost of physically performing this
447 | conveying of source, or (2) access to copy the
448 | Corresponding Source from a network server at no charge.
449 |
450 | c) Convey individual copies of the object code with a copy of the
451 | written offer to provide the Corresponding Source. This
452 | alternative is allowed only occasionally and noncommercially, and
453 | only if you received the object code with such an offer, in accord
454 | with subsection 6b.
455 |
456 | d) Convey the object code by offering access from a designated
457 | place (gratis or for a charge), and offer equivalent access to the
458 | Corresponding Source in the same way through the same place at no
459 | further charge. You need not require recipients to copy the
460 | Corresponding Source along with the object code. If the place to
461 | copy the object code is a network server, the Corresponding Source
462 | may be on a different server (operated by you or a third party)
463 | that supports equivalent copying facilities, provided you maintain
464 | clear directions next to the object code saying where to find the
465 | Corresponding Source. Regardless of what server hosts the
466 | Corresponding Source, you remain obligated to ensure that it is
467 | available for as long as needed to satisfy these requirements.
468 |
469 | e) Convey the object code using peer-to-peer transmission, provided
470 | you inform other peers where the object code and Corresponding
471 | Source of the work are being offered to the general public at no
472 | charge under subsection 6d.
473 |
474 | A separable portion of the object code, whose source code is excluded
475 | from the Corresponding Source as a System Library, need not be
476 | included in conveying the object code work.
477 |
478 | A "User Product" is either (1) a "consumer product", which means any
479 | tangible personal property which is normally used for personal, family,
480 | or household purposes, or (2) anything designed or sold for incorporation
481 | into a dwelling. In determining whether a product is a consumer product,
482 | doubtful cases shall be resolved in favor of coverage. For a particular
483 | product received by a particular user, "normally used" refers to a
484 | typical or common use of that class of product, regardless of the status
485 | of the particular user or of the way in which the particular user
486 | actually uses, or expects or is expected to use, the product. A product
487 | is a consumer product regardless of whether the product has substantial
488 | commercial, industrial or non-consumer uses, unless such uses represent
489 | the only significant mode of use of the product.
490 |
491 | "Installation Information" for a User Product means any methods,
492 | procedures, authorization keys, or other information required to install
493 | and execute modified versions of a covered work in that User Product from
494 | a modified version of its Corresponding Source. The information must
495 | suffice to ensure that the continued functioning of the modified object
496 | code is in no case prevented or interfered with solely because
497 | modification has been made.
498 |
499 | If you convey an object code work under this section in, or with, or
500 | specifically for use in, a User Product, and the conveying occurs as
501 | part of a transaction in which the right of possession and use of the
502 | User Product is transferred to the recipient in perpetuity or for a
503 | fixed term (regardless of how the transaction is characterized), the
504 | Corresponding Source conveyed under this section must be accompanied
505 | by the Installation Information. But this requirement does not apply
506 | if neither you nor any third party retains the ability to install
507 | modified object code on the User Product (for example, the work has
508 | been installed in ROM).
509 |
510 | The requirement to provide Installation Information does not include a
511 | requirement to continue to provide support service, warranty, or updates
512 | for a work that has been modified or installed by the recipient, or for
513 | the User Product in which it has been modified or installed. Access to a
514 | network may be denied when the modification itself materially and
515 | adversely affects the operation of the network or violates the rules and
516 | protocols for communication across the network.
517 |
518 | Corresponding Source conveyed, and Installation Information provided,
519 | in accord with this section must be in a format that is publicly
520 | documented (and with an implementation available to the public in
521 | source code form), and must require no special password or key for
522 | unpacking, reading or copying.
523 |
524 | 7. Additional Terms.
525 |
526 | "Additional permissions" are terms that supplement the terms of this
527 | License by making exceptions from one or more of its conditions.
528 | Additional permissions that are applicable to the entire Program shall
529 | be treated as though they were included in this License, to the extent
530 | that they are valid under applicable law. If additional permissions
531 | apply only to part of the Program, that part may be used separately
532 | under those permissions, but the entire Program remains governed by
533 | this License without regard to the additional permissions.
534 |
535 | When you convey a copy of a covered work, you may at your option
536 | remove any additional permissions from that copy, or from any part of
537 | it. (Additional permissions may be written to require their own
538 | removal in certain cases when you modify the work.) You may place
539 | additional permissions on material, added by you to a covered work,
540 | for which you have or can give appropriate copyright permission.
541 |
542 | Notwithstanding any other provision of this License, for material you
543 | add to a covered work, you may (if authorized by the copyright holders of
544 | that material) supplement the terms of this License with terms:
545 |
546 | a) Disclaiming warranty or limiting liability differently from the
547 | terms of sections 15 and 16 of this License; or
548 |
549 | b) Requiring preservation of specified reasonable legal notices or
550 | author attributions in that material or in the Appropriate Legal
551 | Notices displayed by works containing it; or
552 |
553 | c) Prohibiting misrepresentation of the origin of that material, or
554 | requiring that modified versions of such material be marked in
555 | reasonable ways as different from the original version; or
556 |
557 | d) Limiting the use for publicity purposes of names of licensors or
558 | authors of the material; or
559 |
560 | e) Declining to grant rights under trademark law for use of some
561 | trade names, trademarks, or service marks; or
562 |
563 | f) Requiring indemnification of licensors and authors of that
564 | material by anyone who conveys the material (or modified versions of
565 | it) with contractual assumptions of liability to the recipient, for
566 | any liability that these contractual assumptions directly impose on
567 | those licensors and authors.
568 |
569 | All other non-permissive additional terms are considered "further
570 | restrictions" within the meaning of section 10. If the Program as you
571 | received it, or any part of it, contains a notice stating that it is
572 | governed by this License along with a term that is a further
573 | restriction, you may remove that term. If a license document contains
574 | a further restriction but permits relicensing or conveying under this
575 | License, you may add to a covered work material governed by the terms
576 | of that license document, provided that the further restriction does
577 | not survive such relicensing or conveying.
578 |
579 | If you add terms to a covered work in accord with this section, you
580 | must place, in the relevant source files, a statement of the
581 | additional terms that apply to those files, or a notice indicating
582 | where to find the applicable terms.
583 |
584 | Additional terms, permissive or non-permissive, may be stated in the
585 | form of a separately written license, or stated as exceptions;
586 | the above requirements apply either way.
587 |
588 | 8. Termination.
589 |
590 | You may not propagate or modify a covered work except as expressly
591 | provided under this License. Any attempt otherwise to propagate or
592 | modify it is void, and will automatically terminate your rights under
593 | this License (including any patent licenses granted under the third
594 | paragraph of section 11).
595 |
596 | However, if you cease all violation of this License, then your
597 | license from a particular copyright holder is reinstated (a)
598 | provisionally, unless and until the copyright holder explicitly and
599 | finally terminates your license, and (b) permanently, if the copyright
600 | holder fails to notify you of the violation by some reasonable means
601 | prior to 60 days after the cessation.
602 |
603 | Moreover, your license from a particular copyright holder is
604 | reinstated permanently if the copyright holder notifies you of the
605 | violation by some reasonable means, this is the first time you have
606 | received notice of violation of this License (for any work) from that
607 | copyright holder, and you cure the violation prior to 30 days after
608 | your receipt of the notice.
609 |
610 | Termination of your rights under this section does not terminate the
611 | licenses of parties who have received copies or rights from you under
612 | this License. If your rights have been terminated and not permanently
613 | reinstated, you do not qualify to receive new licenses for the same
614 | material under section 10.
615 |
616 | 9. Acceptance Not Required for Having Copies.
617 |
618 | You are not required to accept this License in order to receive or
619 | run a copy of the Program. Ancillary propagation of a covered work
620 | occurring solely as a consequence of using peer-to-peer transmission
621 | to receive a copy likewise does not require acceptance. However,
622 | nothing other than this License grants you permission to propagate or
623 | modify any covered work. These actions infringe copyright if you do
624 | not accept this License. Therefore, by modifying or propagating a
625 | covered work, you indicate your acceptance of this License to do so.
626 |
627 | 10. Automatic Licensing of Downstream Recipients.
628 |
629 | Each time you convey a covered work, the recipient automatically
630 | receives a license from the original licensors, to run, modify and
631 | propagate that work, subject to this License. You are not responsible
632 | for enforcing compliance by third parties with this License.
633 |
634 | An "entity transaction" is a transaction transferring control of an
635 | organization, or substantially all assets of one, or subdividing an
636 | organization, or merging organizations. If propagation of a covered
637 | work results from an entity transaction, each party to that
638 | transaction who receives a copy of the work also receives whatever
639 | licenses to the work the party's predecessor in interest had or could
640 | give under the previous paragraph, plus a right to possession of the
641 | Corresponding Source of the work from the predecessor in interest, if
642 | the predecessor has it or can get it with reasonable efforts.
643 |
644 | You may not impose any further restrictions on the exercise of the
645 | rights granted or affirmed under this License. For example, you may
646 | not impose a license fee, royalty, or other charge for exercise of
647 | rights granted under this License, and you may not initiate litigation
648 | (including a cross-claim or counterclaim in a lawsuit) alleging that
649 | any patent claim is infringed by making, using, selling, offering for
650 | sale, or importing the Program or any portion of it.
651 |
652 | 11. Patents.
653 |
654 | A "contributor" is a copyright holder who authorizes use under this
655 | License of the Program or a work on which the Program is based. The
656 | work thus licensed is called the contributor's "contributor version".
657 |
658 | A contributor's "essential patent claims" are all patent claims
659 | owned or controlled by the contributor, whether already acquired or
660 | hereafter acquired, that would be infringed by some manner, permitted
661 | by this License, of making, using, or selling its contributor version,
662 | but do not include claims that would be infringed only as a
663 | consequence of further modification of the contributor version. For
664 | purposes of this definition, "control" includes the right to grant
665 | patent sublicenses in a manner consistent with the requirements of
666 | this License.
667 |
668 | Each contributor grants you a non-exclusive, worldwide, royalty-free
669 | patent license under the contributor's essential patent claims, to
670 | make, use, sell, offer for sale, import and otherwise run, modify and
671 | propagate the contents of its contributor version.
672 |
673 | In the following three paragraphs, a "patent license" is any express
674 | agreement or commitment, however denominated, not to enforce a patent
675 | (such as an express permission to practice a patent or covenant not to
676 | sue for patent infringement). To "grant" such a patent license to a
677 | party means to make such an agreement or commitment not to enforce a
678 | patent against the party.
679 |
680 | If you convey a covered work, knowingly relying on a patent license,
681 | and the Corresponding Source of the work is not available for anyone
682 | to copy, free of charge and under the terms of this License, through a
683 | publicly available network server or other readily accessible means,
684 | then you must either (1) cause the Corresponding Source to be so
685 | available, or (2) arrange to deprive yourself of the benefit of the
686 | patent license for this particular work, or (3) arrange, in a manner
687 | consistent with the requirements of this License, to extend the patent
688 | license to downstream recipients. "Knowingly relying" means you have
689 | actual knowledge that, but for the patent license, your conveying the
690 | covered work in a country, or your recipient's use of the covered work
691 | in a country, would infringe one or more identifiable patents in that
692 | country that you have reason to believe are valid.
693 |
694 | If, pursuant to or in connection with a single transaction or
695 | arrangement, you convey, or propagate by procuring conveyance of, a
696 | covered work, and grant a patent license to some of the parties
697 | receiving the covered work authorizing them to use, propagate, modify
698 | or convey a specific copy of the covered work, then the patent license
699 | you grant is automatically extended to all recipients of the covered
700 | work and works based on it.
701 |
702 | A patent license is "discriminatory" if it does not include within
703 | the scope of its coverage, prohibits the exercise of, or is
704 | conditioned on the non-exercise of one or more of the rights that are
705 | specifically granted under this License. You may not convey a covered
706 | work if you are a party to an arrangement with a third party that is
707 | in the business of distributing software, under which you make payment
708 | to the third party based on the extent of your activity of conveying
709 | the work, and under which the third party grants, to any of the
710 | parties who would receive the covered work from you, a discriminatory
711 | patent license (a) in connection with copies of the covered work
712 | conveyed by you (or copies made from those copies), or (b) primarily
713 | for and in connection with specific products or compilations that
714 | contain the covered work, unless you entered into that arrangement,
715 | or that patent license was granted, prior to 28 March 2007.
716 |
717 | Nothing in this License shall be construed as excluding or limiting
718 | any implied license or other defenses to infringement that may
719 | otherwise be available to you under applicable patent law.
720 |
721 | 12. No Surrender of Others' Freedom.
722 |
723 | If conditions are imposed on you (whether by court order, agreement or
724 | otherwise) that contradict the conditions of this License, they do not
725 | excuse you from the conditions of this License. If you cannot convey a
726 | covered work so as to satisfy simultaneously your obligations under this
727 | License and any other pertinent obligations, then as a consequence you may
728 | not convey it at all. For example, if you agree to terms that obligate you
729 | to collect a royalty for further conveying from those to whom you convey
730 | the Program, the only way you could satisfy both those terms and this
731 | License would be to refrain entirely from conveying the Program.
732 |
733 | 13. Use with the GNU Affero General Public License.
734 |
735 | Notwithstanding any other provision of this License, you have
736 | permission to link or combine any covered work with a work licensed
737 | under version 3 of the GNU Affero General Public License into a single
738 | combined work, and to convey the resulting work. The terms of this
739 | License will continue to apply to the part which is the covered work,
740 | but the special requirements of the GNU Affero General Public License,
741 | section 13, concerning interaction through a network will apply to the
742 | combination as such.
743 |
744 | 14. Revised Versions of this License.
745 |
746 | The Free Software Foundation may publish revised and/or new versions of
747 | the GNU General Public License from time to time. Such new versions will
748 | be similar in spirit to the present version, but may differ in detail to
749 | address new problems or concerns.
750 |
751 | Each version is given a distinguishing version number. If the
752 | Program specifies that a certain numbered version of the GNU General
753 | Public License "or any later version" applies to it, you have the
754 | option of following the terms and conditions either of that numbered
755 | version or of any later version published by the Free Software
756 | Foundation. If the Program does not specify a version number of the
757 | GNU General Public License, you may choose any version ever published
758 | by the Free Software Foundation.
759 |
760 | If the Program specifies that a proxy can decide which future
761 | versions of the GNU General Public License can be used, that proxy's
762 | public statement of acceptance of a version permanently authorizes you
763 | to choose that version for the Program.
764 |
765 | Later license versions may give you additional or different
766 | permissions. However, no additional obligations are imposed on any
767 | author or copyright holder as a result of your choosing to follow a
768 | later version.
769 |
770 | 15. Disclaimer of Warranty.
771 |
772 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
773 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
774 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
775 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
776 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
777 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
778 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
779 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
780 |
781 | 16. Limitation of Liability.
782 |
783 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
784 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
785 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
786 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
787 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
788 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
789 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
790 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
791 | SUCH DAMAGES.
792 |
793 | 17. Interpretation of Sections 15 and 16.
794 |
795 | If the disclaimer of warranty and limitation of liability provided
796 | above cannot be given local legal effect according to their terms,
797 | reviewing courts shall apply local law that most closely approximates
798 | an absolute waiver of all civil liability in connection with the
799 | Program, unless a warranty or assumption of liability accompanies a
800 | copy of the Program in return for a fee.
801 |
802 | END OF TERMS AND CONDITIONS
803 |
804 | How to Apply These Terms to Your New Programs
805 |
806 | If you develop a new program, and you want it to be of the greatest
807 | possible use to the public, the best way to achieve this is to make it
808 | free software which everyone can redistribute and change under these terms.
809 |
810 | To do so, attach the following notices to the program. It is safest
811 | to attach them to the start of each source file to most effectively
812 | state the exclusion of warranty; and each file should have at least
813 | the "copyright" line and a pointer to where the full notice is found.
814 |
815 |
816 | Copyright (C)
817 |
818 | This program is free software: you can redistribute it and/or modify
819 | it under the terms of the GNU General Public License as published by
820 | the Free Software Foundation, either version 3 of the License, or
821 | (at your option) any later version.
822 |
823 | This program is distributed in the hope that it will be useful,
824 | but WITHOUT ANY WARRANTY; without even the implied warranty of
825 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
826 | GNU General Public License for more details.
827 |
828 | You should have received a copy of the GNU General Public License
829 | along with this program. If not, see .
830 |
831 | Also add information on how to contact you by electronic and paper mail.
832 |
833 | If the program does terminal interaction, make it output a short
834 | notice like this when it starts in an interactive mode:
835 |
836 | Copyright (C)
837 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
838 | This is free software, and you are welcome to redistribute it
839 | under certain conditions; type `show c' for details.
840 |
841 | The hypothetical commands `show w' and `show c' should show the appropriate
842 | parts of the General Public License. Of course, your program's commands
843 | might be different; for a GUI interface, you would use an "about box".
844 |
845 | You should also get your employer (if you work as a programmer) or school,
846 | if any, to sign a "copyright disclaimer" for the program, if necessary.
847 | For more information on this, and how to apply and follow the GNU GPL, see
848 | .
849 |
850 | The GNU General Public License does not permit incorporating your program
851 | into proprietary programs. If your program is a subroutine library, you
852 | may consider it more useful to permit linking proprietary applications with
853 | the library. If this is what you want to do, use the GNU Lesser General
854 | Public License instead of this License. But first, please read
855 | .
856 |
857 |
858 | **************************************************************************
--------------------------------------------------------------------------------
/l10n_do_currency_update/README.md:
--------------------------------------------------------------------------------
1 | Dominican Banks Currency Update
2 | ===============================
3 |
4 | Installation
5 | ============
6 |
7 | * Go to Apps
8 |
9 | * Search for Dominican Banks Currency Update
10 |
11 | * Press install button
12 |
13 | Setup
14 | =====
15 |
16 | Accounting Settings
17 | -------------------
18 |
19 | * Go to Accounting > Configuration > Settings
20 | * Scroll to **Currency** section
21 | * Activate Multi-currency feature
22 | * Setup your company Dominican Bank Rates parameters like bank, interval, base and offset
23 |
24 | Technical Settings
25 | ------------------
26 |
27 | You need to setup your API Key in order to authenticate with the external service.
28 | * Go to Settings > Technical > Parameters > System Parameters
29 | * Set your Key on `indexa.api.token` param record value
30 |
31 | You can setup the time when your currency update action will run
32 |
33 | * Go to Settings > Automation > Scheduled Actions
34 | * Click on **[CURRENCY] Update l10n_do banks currency** cron
35 | * Set your time on Next Execution Date
36 |
37 | Notes
38 | -----
39 | Do not change any other **Scheduled Actions** field. Your cron must run daily, even if your **Dominican Bank Rates** parameters don't.
40 |
41 | Usage
42 | =====
43 | * Your **Scheduled Actions** will fetch your bank rates from the given API on intervals you set up in your settings
44 |
45 |
46 | Support
47 | ========
48 |
49 | Please refer to `Module Description` support contacts.
50 |
--------------------------------------------------------------------------------
/l10n_do_currency_update/__init__.py:
--------------------------------------------------------------------------------
1 | from . import models
2 |
--------------------------------------------------------------------------------
/l10n_do_currency_update/__manifest__.py:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Dominican Banks Currency Update",
3 | "summary": """
4 | Updates company secondary currency rates from dominican banks
5 | """,
6 | "author": "Indexa",
7 | "website": "https://www.indexa.do",
8 | "category": "Accounting",
9 | "license": "LGPL-3",
10 | "version": "15.0.1.0.2",
11 | "depends": ["account"],
12 | "data": [
13 | "data/ir_cron_data.xml",
14 | "data/ir_config_parameter_data.xml",
15 | "views/res_config_settings_views.xml",
16 | ],
17 | "demo": [
18 | "demo/res_company_demo.xml",
19 | ],
20 | "installable": True,
21 | }
22 |
--------------------------------------------------------------------------------
/l10n_do_currency_update/data/ir_config_parameter_data.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | indexa.api.url
6 | https://api.indexa.do/api/rates
7 |
8 |
9 | indexa.api.token
10 | false
11 |
12 |
13 | indexa.api.token.name
14 | x-access-token
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/l10n_do_currency_update/data/ir_cron_data.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | [CURRENCY] Update l10n_do banks currency
6 | 1
7 | days
8 | code
9 | -1
10 |
11 |
12 | model.l10n_do_run_update_currency()
13 |
14 |
15 |
--------------------------------------------------------------------------------
/l10n_do_currency_update/demo/res_company_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Company_X
5 |
6 | Good Hope Street
7 |
8 | 90210
9 | Somewhere
10 | hello@company_1.com
11 | +1 (999) 555-44-33
12 | www.company_1.com
13 |
14 |
15 |
16 |
17 | Company_X
18 | bpd
19 | daily
20 |
21 |
22 | Company_Y
23 |
24 | Good Hope Street
25 |
26 | 90210
27 | Somewhere
28 | info@company_2.com
29 | +1 (999) 555-44-33
30 | www.company_2.com
31 |
32 |
33 |
34 |
35 | Company_Y
36 | bsc
37 | daily
38 |
39 |
40 |
--------------------------------------------------------------------------------
/l10n_do_currency_update/i18n/es_DO.po:
--------------------------------------------------------------------------------
1 | # Translation of Odoo Server.
2 | # This file contains the translation of the following modules:
3 | # * l10n_do_currency_update
4 | #
5 | msgid ""
6 | msgstr ""
7 | "Project-Id-Version: Odoo Server 15.0\n"
8 | "Report-Msgid-Bugs-To: \n"
9 | "POT-Creation-Date: 2021-10-22 22:16+0000\n"
10 | "PO-Revision-Date: 2021-10-22 18:17-0400\n"
11 | "Last-Translator: \n"
12 | "Language-Team: \n"
13 | "MIME-Version: 1.0\n"
14 | "Content-Type: text/plain; charset=UTF-8\n"
15 | "Content-Transfer-Encoding: 8bit\n"
16 | "Plural-Forms: \n"
17 | "Language: es_DO\n"
18 | "X-Generator: Poedit 3.0\n"
19 |
20 | #. module: l10n_do_currency_update
21 | #: model_terms:ir.ui.view,arch_db:l10n_do_currency_update.res_config_settings_view_form_inherited
22 | msgid ""
23 | msgstr ""
24 |
25 | #. module: l10n_do_currency_update
26 | #: code:addons/l10n_do_currency_update/models/res_company.py:0
27 | #, python-format
28 | msgid "API requests return the following error %s"
29 | msgstr "La petición al API retornó el siguiente error %s"
30 |
31 | #. module: l10n_do_currency_update
32 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_provider__bdi
33 | msgid "Banco BDI"
34 | msgstr ""
35 |
36 | #. module: l10n_do_currency_update
37 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_provider__bcd
38 | msgid "Banco Central Dominicano"
39 | msgstr ""
40 |
41 | #. module: l10n_do_currency_update
42 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_provider__bpd
43 | msgid "Banco Popular Dominicano"
44 | msgstr ""
45 |
46 | #. module: l10n_do_currency_update
47 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_provider__bpm
48 | msgid "Banco Promerica"
49 | msgstr ""
50 |
51 | #. module: l10n_do_currency_update
52 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_provider__bsc
53 | msgid "Banco Santa Cruz"
54 | msgstr ""
55 |
56 | #. module: l10n_do_currency_update
57 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_provider__bvm
58 | msgid "Banco Vimenca"
59 | msgstr ""
60 |
61 | #. module: l10n_do_currency_update
62 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_provider__bnr
63 | msgid "Banco de Reservas"
64 | msgstr ""
65 |
66 | #. module: l10n_do_currency_update
67 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_provider__bpr
68 | msgid "Banco del Progreso"
69 | msgstr ""
70 |
71 | #. module: l10n_do_currency_update
72 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_company__l10n_do_currency_provider
73 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_config_settings__l10n_do_currency_provider
74 | #: model_terms:ir.ui.view,arch_db:l10n_do_currency_update.res_config_settings_view_form_inherited
75 | msgid "Bank"
76 | msgstr "Banco"
77 |
78 | #. module: l10n_do_currency_update
79 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_company__l10n_do_currency_base
80 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_config_settings__l10n_do_currency_base
81 | #: model_terms:ir.ui.view,arch_db:l10n_do_currency_update.res_config_settings_view_form_inherited
82 | msgid "Base"
83 | msgstr ""
84 |
85 | #. module: l10n_do_currency_update
86 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_base__buyrate
87 | msgid "Buy rate"
88 | msgstr "Tasa de compra"
89 |
90 | #. module: l10n_do_currency_update
91 | #: model:ir.model,name:l10n_do_currency_update.model_res_company
92 | msgid "Companies"
93 | msgstr "Compañías"
94 |
95 | #. module: l10n_do_currency_update
96 | #: model:ir.model,name:l10n_do_currency_update.model_res_config_settings
97 | msgid "Config Settings"
98 | msgstr "Opciones de configuración"
99 |
100 | #. module: l10n_do_currency_update
101 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_company__l10n_do_currency_interval_unit
102 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_config_settings__l10n_do_currency_interval_unit
103 | msgid "Currency Interval"
104 | msgstr "Intervalo"
105 |
106 | #. module: l10n_do_currency_update
107 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_interval_unit__daily
108 | msgid "Daily"
109 | msgstr "Diario"
110 |
111 | #. module: l10n_do_currency_update
112 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_company__display_name
113 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_config_settings__display_name
114 | msgid "Display Name"
115 | msgstr "Nombre mostrado"
116 |
117 | #. module: l10n_do_currency_update
118 | #: model_terms:ir.ui.view,arch_db:l10n_do_currency_update.res_config_settings_view_form_inherited
119 | msgid "Dominican Banks Rates"
120 | msgstr "Tasas Bancos Dominicanos"
121 |
122 | #. module: l10n_do_currency_update
123 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_company__l10n_do_currency_next_execution_date
124 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_config_settings__l10n_do_currency_next_execution_date
125 | msgid "Following Execution Date"
126 | msgstr "Siguiente fecha de ejecución"
127 |
128 | #. module: l10n_do_currency_update
129 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_company__id
130 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_config_settings__id
131 | msgid "ID"
132 | msgstr "ID (identificación)"
133 |
134 | #. module: l10n_do_currency_update
135 | #: model_terms:ir.ui.view,arch_db:l10n_do_currency_update.res_config_settings_view_form_inherited
136 | msgid "Interval"
137 | msgstr "Intervalo"
138 |
139 | #. module: l10n_do_currency_update
140 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_company____last_update
141 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_config_settings____last_update
142 | msgid "Last Modified on"
143 | msgstr "Última modificación en"
144 |
145 | #. module: l10n_do_currency_update
146 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_company__l10n_do_last_currency_sync_date
147 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_config_settings__l10n_do_last_currency_sync_date
148 | #: model_terms:ir.ui.view,arch_db:l10n_do_currency_update.res_config_settings_view_form_inherited
149 | msgid "Last Sync Date"
150 | msgstr "Última fecha de sincronización"
151 |
152 | #. module: l10n_do_currency_update
153 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_interval_unit__manually
154 | msgid "Manually"
155 | msgstr "Manualmente"
156 |
157 | #. module: l10n_do_currency_update
158 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_interval_unit__monthly
159 | msgid "Monthly"
160 | msgstr "Mensual"
161 |
162 | #. module: l10n_do_currency_update
163 | #: model_terms:ir.ui.view,arch_db:l10n_do_currency_update.res_config_settings_view_form_inherited
164 | msgid "Next Run"
165 | msgstr "Siguiente ejecución"
166 |
167 | #. module: l10n_do_currency_update
168 | #: code:addons/l10n_do_currency_update/models/res_company.py:0
169 | #, python-format
170 | msgid "No serializable data from API response"
171 | msgstr "No hay data serializable en la respuesta de API"
172 |
173 | #. module: l10n_do_currency_update
174 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_company__l10n_do_rate_offset
175 | #: model:ir.model.fields,field_description:l10n_do_currency_update.field_res_config_settings__l10n_do_rate_offset
176 | #: model_terms:ir.ui.view,arch_db:l10n_do_currency_update.res_config_settings_view_form_inherited
177 | msgid "Offset"
178 | msgstr "Compensación"
179 |
180 | #. module: l10n_do_currency_update
181 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_base__sellrate
182 | msgid "Sell rate"
183 | msgstr "Tasa de venta"
184 |
185 | #. module: l10n_do_currency_update
186 | #: code:addons/l10n_do_currency_update/models/res_config_settings.py:0
187 | #, python-format
188 | msgid ""
189 | "Unable to fetch currency from given API. The service may be temporary down. "
190 | "Please try again in a moment."
191 | msgstr ""
192 | "Incapaz de traer las tasas de el API suministrada. El servicio puede estar "
193 | "temporalmente inactivo. Por favor, intentelo más tarde."
194 |
195 | #. module: l10n_do_currency_update
196 | #: code:addons/l10n_do_currency_update/models/res_company.py:0
197 | #, python-format
198 | msgid "Unable to fetch new rates records from API"
199 | msgstr "Incapaz de traer nuevos registros de tasas desde el API"
200 |
201 | #. module: l10n_do_currency_update
202 | #: model:ir.model.fields.selection,name:l10n_do_currency_update.selection__res_company__l10n_do_currency_interval_unit__weekly
203 | msgid "Weekly"
204 | msgstr "Semanal"
205 |
206 | #. module: l10n_do_currency_update
207 | #: model:ir.actions.server,name:l10n_do_currency_update.ir_cron_currency_update_ir_actions_server
208 | #: model:ir.cron,cron_name:l10n_do_currency_update.ir_cron_currency_update
209 | #: model:ir.cron,name:l10n_do_currency_update.ir_cron_currency_update
210 | msgid "[CURRENCY] Update l10n_do banks currency"
211 | msgstr "[TASAS] Actualizar tasas bancos dominicanos"
212 |
--------------------------------------------------------------------------------
/l10n_do_currency_update/models/__init__.py:
--------------------------------------------------------------------------------
1 | from . import res_config_settings
2 | from . import res_company
3 |
--------------------------------------------------------------------------------
/l10n_do_currency_update/models/res_company.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018 - Indexa SRL. (https://www.indexa.do)
2 | # See LICENSE file for full licensing details.
3 |
4 | import json
5 | import logging
6 | import requests
7 | import datetime
8 | import pytz
9 | from dateutil.relativedelta import relativedelta
10 |
11 | from odoo import models, fields, api, _
12 |
13 | _logger = logging.getLogger(__name__)
14 |
15 | CURRENCY_MAPPING = {
16 | "euro": "EUR",
17 | "cdol": "CAD",
18 | "doll": "USD",
19 | "poun": "GBP",
20 | "swis": "CHF",
21 | }
22 |
23 |
24 | class ResCompany(models.Model):
25 | _inherit = "res.company"
26 |
27 | l10n_do_currency_interval_unit = fields.Selection(
28 | [
29 | ("manually", "Manually"),
30 | ("daily", "Daily"),
31 | ("weekly", "Weekly"),
32 | ("monthly", "Monthly"),
33 | ],
34 | default="daily",
35 | string="Currency Interval",
36 | )
37 | l10n_do_currency_provider = fields.Selection(
38 | [
39 | ("bpd", "Banco Popular Dominicano"),
40 | ("bnr", "Banco de Reservas"),
41 | ("bpr", "Banco del Progreso"),
42 | ("bsc", "Banco Santa Cruz"),
43 | ("bdi", "Banco BDI"),
44 | ("bpm", "Banco Promerica"),
45 | ("bvm", "Banco Vimenca"),
46 | ("bcd", "Banco Central Dominicano"),
47 | ],
48 | default="bpd",
49 | string="Bank",
50 | )
51 | l10n_do_currency_base = fields.Selection(
52 | [("buyrate", "Buy rate"), ("sellrate", "Sell rate")],
53 | string="Base",
54 | default="sellrate",
55 | )
56 | l10n_do_rate_offset = fields.Float("Offset", default=0)
57 | l10n_do_currency_next_execution_date = fields.Date(
58 | string="Following Execution Date"
59 | )
60 | l10n_do_last_currency_sync_date = fields.Date(
61 | string="Last Sync Date", readonly=True
62 | )
63 |
64 | def get_currency_rates(self, params, token):
65 | api_url = self.env["ir.config_parameter"].sudo().get_param("indexa.api.url")
66 | token_name = (
67 | self.env["ir.config_parameter"].sudo().get_param("indexa.api.token.name")
68 | )
69 |
70 | try:
71 | response = requests.get(api_url, params, headers={token_name: token})
72 | except requests.exceptions.ConnectionError as e:
73 | _logger.warning(_("API requests return the following error %s" % e))
74 | return {}
75 | return response.text
76 |
77 | def l10n_do_update_currency_rates(self):
78 |
79 | all_good = True
80 | res = True
81 | for company in self:
82 | if company.l10n_do_currency_provider:
83 | _logger.info("Calling API rates resource.")
84 |
85 | tz = pytz.timezone("America/Santo_Domingo")
86 | today = datetime.datetime.now(tz)
87 | params = {
88 | "bank": company.l10n_do_currency_provider,
89 | "date": datetime.datetime.strftime(today, "%Y-%m-%d"),
90 | }
91 |
92 | token = (
93 | self.env["ir.config_parameter"].sudo().get_param("indexa.api.token")
94 | )
95 | rates_dict = self.get_currency_rates(params, token)
96 |
97 | d = {}
98 | try:
99 | d = json.loads(rates_dict)
100 | except TypeError:
101 | _logger.warning(_("No serializable data from API response"))
102 |
103 | Rate = self.env["res.currency.rate"]
104 |
105 | if "data" in d:
106 | for currency in d["data"]:
107 | if (
108 | str(currency["name"]).endswith(
109 | company.l10n_do_currency_base or "x"
110 | )
111 | and currency["rate"]
112 | ):
113 | inverse_rate = 1 / (
114 | float(currency["rate"]) + company.l10n_do_rate_offset
115 | )
116 |
117 | currency_id = self.env.ref(
118 | "base." + CURRENCY_MAPPING[str(currency["name"])[:4]]
119 | )
120 | if currency_id and currency_id.active:
121 | rate_id = Rate.search(
122 | [
123 | ("name", "=", fields.Date.today()),
124 | ("currency_id", "=", currency_id.id),
125 | ("company_id", "=", company.id),
126 | ]
127 | )
128 | if rate_id:
129 | rate_id.write({"rate": inverse_rate})
130 | else:
131 | Rate.create(
132 | {
133 | "currency_id": currency_id.id,
134 | "rate": inverse_rate,
135 | "company_id": company.id,
136 | }
137 | )
138 | company.l10n_do_last_currency_sync_date = fields.Date.today()
139 | else:
140 | res = False
141 | else:
142 | res = False
143 | if not res:
144 | all_good = False
145 | _logger.warning(_("Unable to fetch new rates records from API"))
146 | return all_good
147 |
148 | @api.model
149 | def l10n_do_run_update_currency(self):
150 |
151 | records = self.search([])
152 | if records:
153 | to_update = self.env["res.company"]
154 | for record in records:
155 | if record.l10n_do_currency_interval_unit == "daily":
156 | next_update = relativedelta(days=+1)
157 | elif record.l10n_do_currency_interval_unit == "weekly":
158 | next_update = relativedelta(weeks=+1)
159 | elif record.l10n_do_currency_interval_unit == "monthly":
160 | next_update = relativedelta(months=+1)
161 | else:
162 | record.l10n_do_currency_interval_unit = False
163 | continue
164 | record.l10n_do_currency_next_execution_date = (
165 | datetime.date.today() + next_update
166 | )
167 | to_update += record
168 | to_update.l10n_do_update_currency_rates()
169 |
--------------------------------------------------------------------------------
/l10n_do_currency_update/models/res_config_settings.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018 - Indexa SRL. ()
2 | # See LICENSE file for full copyright and licensing details.
3 |
4 | import datetime
5 | from dateutil.relativedelta import relativedelta
6 |
7 | from odoo import models, fields, api, _
8 | from odoo.exceptions import UserError
9 |
10 |
11 | class ResConfigSettings(models.TransientModel):
12 | _inherit = "res.config.settings"
13 |
14 | l10n_do_currency_interval_unit = fields.Selection(
15 | related="company_id.l10n_do_currency_interval_unit", readonly=False
16 | )
17 | l10n_do_currency_provider = fields.Selection(
18 | related="company_id.l10n_do_currency_provider", readonly=False
19 | )
20 | l10n_do_currency_next_execution_date = fields.Date(
21 | related="company_id.l10n_do_currency_next_execution_date", readonly=False
22 | )
23 | l10n_do_currency_base = fields.Selection(
24 | related="company_id.l10n_do_currency_base", readonly=False
25 | )
26 | l10n_do_rate_offset = fields.Float(
27 | related="company_id.l10n_do_rate_offset", readonly=False
28 | )
29 | l10n_do_last_currency_sync_date = fields.Date(
30 | related="company_id.l10n_do_last_currency_sync_date", readonly=False
31 | )
32 |
33 | @api.onchange("l10n_do_currency_interval_unit")
34 | def onchange_l10n_do_currency_interval_unit(self):
35 | # as the onchange is called upon each opening of the settings, we avoid overwriting
36 | # the next execution date if it has been already set
37 | if self.company_id.l10n_do_currency_next_execution_date:
38 | return
39 | if self.l10n_do_currency_interval_unit == "daily":
40 | next_update = relativedelta(days=+1)
41 | elif self.l10n_do_currency_interval_unit == "weekly":
42 | next_update = relativedelta(weeks=+1)
43 | elif self.l10n_do_currency_interval_unit == "monthly":
44 | next_update = relativedelta(months=+1)
45 | else:
46 | self.l10n_do_currency_next_execution_date = False
47 | return
48 | self.l10n_do_currency_next_execution_date = fields.Date.to_string(
49 | datetime.datetime.now() + next_update
50 | )
51 |
52 | def l10n_do_update_currency_rates(self):
53 | companies = self.env["res.company"].browse(
54 | [record.company_id.id for record in self]
55 | )
56 |
57 | if not companies.l10n_do_update_currency_rates():
58 | raise UserError(
59 | _(
60 | "Unable to fetch currency from given API. "
61 | "The service may be temporary down. Please try again in a moment."
62 | )
63 | )
64 |
--------------------------------------------------------------------------------
/l10n_do_currency_update/static/description/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/indexa-git/external-service-addons/057ec59ffab7ed896d5e925814555acaf9e4eb0c/l10n_do_currency_update/static/description/icon.png
--------------------------------------------------------------------------------
/l10n_do_currency_update/static/description/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Dominican Banks Currency Update
4 |
Update currency rates from dominican banks
5 |
INDEXA - www.indexa.do
6 |
7 |
8 |
9 |
10 |
Features
11 |
12 |
13 |
14 |
15 |
Multiple banks available
16 |
17 |
18 |
19 |
Banco Popular Dominicano
20 |
Banco de Reservas
21 |
Banco del Progreso
22 |
Banco Santa Cruz
23 |
Banco BDI
24 |
Banco Promerica
25 |
Banco Vimenca
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
Multicompany
35 |
36 |
37 |
38 | Run multicompany currency updates. You can choose a different bank per company!
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
Choose between selling rate & buying rate
48 |
Rates offset
49 |
50 |
51 |
52 |
53 |
Help and Support
54 |
Feel free to
55 | contact us, if you need any help or additional features.