Feat: First Commit

This commit is contained in:
Rodia 2024-06-15 11:00:00 -05:00
commit eb0c8b84e3
136 changed files with 39605 additions and 0 deletions

2
.dev/Procfile Executable file
View File

@ -0,0 +1,2 @@
trytond: while true; do trytond -d ${DB_NAME} --dev -v -c $SCRIPT_DIR/trytond.cfg; done
monitor: python3 $SCRIPT_DIR/dev.py

52
.dev/dev.py Executable file
View File

@ -0,0 +1,52 @@
# script para refrescar cambios de xml del modulo de tryton
import sys
import os
import logging
import time
import inotify.adapters
logging.basicConfig(level=logging.INFO, stream=sys.stderr)
SRC = os.environ['SRC'] + '/modules/'
MODULES = os.environ['MODULES'].split(':')
DB_NAME = os.environ['DB_NAME']
def _main():
i = inotify.adapters.Inotify()
logging.info("MONITOREANDO ARCHIVOS EN %s", SRC)
for module in MODULES:
logging.info('NOMBRE DEL MODULO A MONITOREAR%s', module)
i.add_watch(
SRC + module)
for event in i.event_gen(yield_nones=False):
(_, type_names, path, filename) = event
(_, ext) = os.path.splitext(filename)
if 'IN_CLOSE_WRITE' not in type_names:
continue
module_name = path.split('/')[-1]
logging.info('NOMBRE DEL MODULO %s', module_name)
if ext in ['.py', '.xml', '.cfg']:
for _ in range(0, 10):
command = "trytond-admin -d {} -u {} --act -vv".format(
DB_NAME, module_name)
logging.debug("Ejecutando comando: %s", command)
update_module = os.system(command)
if update_module != 0:
time.sleep(2)
logging.error("fallo trytond-admin")
else:
logging.info(
"ACTUALIZADO TRYTOND POR CAMBIO DE ARCHIVO %s",
filename)
break
if __name__ == '__main__':
_main()

60
.dev/install_module.sh Normal file
View File

@ -0,0 +1,60 @@
# este script fuerza que los cambios se vean reflejados
# directamente en trytond.
#
# variables exportadas:
# - module_name
[ ! -d "$SRC" ] && die "no se ubica ruta en SRC"
# dependencias minimas
pip3 install psycopg2 proteus==7.0.0 inotify honcho qrcode==6.1 pyshp==2.3.1 shapely==2.0.2 scipy==1.13.1 matplotlib==3.9.0
pip3 install trytond-country==7.0.0\
trytond-company==7.0.0\
trytond-party==7.0.0 \
trytond-company==7.0.0\
trytond-currency==7.0.0\
trytond-account_product==7.0.0\
trytond-account_invoice_stock==7.0.0\
trytond-account_stock_continental==7.0.0\
trytond-account_statement==7.0.0\
trytond-bank==7.0.0\
trytond-product==7.0.0\
trytond-purchase==7.0.0\
trytond-sale==7.0.0\
module_names=()
for module in modules/*/; do
pushd "$module"
# instalar dependencias de tryton desde paquete
python3 setup.py install
# usamos enlace al paquete
python3 setup.py develop
# instalar modulo
trytond_modules_path=`pip3 show trytond | grep Location | sed -nr 's/Location: +//gp'`/trytond/modules
module_name=`cat "setup.py" | fgrep -A 1 [trytond.modules] | sed 1d | cut -d '=' -f 1 | tr -d ' \n'`
# Añadir el nombre del módulo al arreglo
module_names+=("$module_name")
[ ! -d "$trytond_modules_path" ] && die "fallo al ubicar ruta de modulos de trytond"
ln -sf "$SRC/$module" "$trytond_modules_path/$module_name"
rm -rf "$SRC/$module/$module_name"
popd
done
trytond_path=`pip3 show trytond | grep Location | sed -nr 's/Location: +//gp'`/trytond
module_names=$(IFS=:; echo "${module_names[*]}")
if [ -d "locale_custom" ]; then
cp -f "locale_custom/ir/pt.po" "$trytond_path/ir/locale/"
fi

31
.dev/run.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
# script para iniciar entorno vivo
SCRIPT_DIR=$(dirname `realpath $0`)
die() {
echo $1
exit 1
}
[ ! -d "$SRC" ] && die "no se ubica ruta en SRC"
[ -z "$DB_NAME" ] && die "se requiere variable DB_NAME"
set -e
# instalar modulo
source ${SCRIPT_DIR}/install_module.sh
# inicializar base de datos
# https://docs.tryton.org/projects/server/en/latest/tutorial/module/setup_database.html
yes admin | trytond-admin -d ${DB_NAME} --all --act
# ejecutar servidor
export SCRIPT_DIR
export MODULES=$module_names
export DB_NAME
export SRC
honcho -d ${SCRIPT_DIR} start

3
.dev/trytond.cfg Executable file
View File

@ -0,0 +1,3 @@
[web]
listen = 0.0.0.0:8000
root=/var/lib/trytond/www

3
.flake8 Normal file
View File

@ -0,0 +1,3 @@
[flake8]
ignore=E123,E124,E126,E128,E741,W503
exclude=.git,__pycache__,docs/source/conf.py,old,build,dist,.dev

228
.gitignore vendored Normal file
View File

@ -0,0 +1,228 @@
# ---> Python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.bk
/.vscode
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
bin/
include/
wheels/
__pycache__
trytond_miac.egg-info/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script fkrom a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# ---> Emacs
# -*- mode: gitignore; -*-
*~
.~*
*#
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/
# projectiles files
.projectile
# directory configuration
.dir-locals.el
# network security
/network-security.data
# ---> Vim
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
# ---> VirtualEnv
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
.Python
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
.venv
pip-selfcheck.json
.tdd_cache
app

33
.woodpecker.yml Executable file
View File

@ -0,0 +1,33 @@
#
# variables que puedo usar? https://woodpecker-ci.org/docs/0.15/usage/environment#built-in-environment-variables
steps:
style:
image: python:3.9
commands:
- pip3 install flake8
- flake8
tests:
image: python:3.9
environment:
- SRC=/app
- DB_CACHE=/tmp
- DB_NAME=trytontest
- TRYTOND_DATABASE_URI=postgresql://tryton:tryton@postgres:5432/
commands:
- pip3 install psycopg2 proteus qrcode==6.1 image==1.5.33
- mkdir /app
- mv modules /app
- mv .dev /app
- cd /app
- /bin/bash .dev/install_module.sh
- python -m unittest discover -s modules
services:
postgres:
image: postgres:12
environment:
- POSTGRES_USER=tryton
- POSTGRES_PASSWORD=tryton
- POSTGRES_DB=demo

15
Dockerfile Executable file
View File

@ -0,0 +1,15 @@
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
FROM node as builder-node
ENV SERIES 7.0
RUN npm install -g bower
RUN curl https://downloads.tryton.org/${SERIES}/tryton-sao-last.tgz | tar zxf - -C /
RUN cd /package && bower install --allow-root
FROM python:3.11-bullseye
# trytond DB_CACHE requiere commandos `pg_dump` y `pg_restore`
RUN apt-get update && apt-get install -y postgresql-client
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
COPY --from=builder-node /package /var/lib/trytond/www

5
Dockerfile_Test Executable file
View File

@ -0,0 +1,5 @@
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
FROM python:3.11-bullseye
# trytond DB_CACHE requiere commandos `pg_dump` y `pg_restore`
RUN apt-get update && apt-get install -y postgresql-client

119
Rakefile Executable file
View File

@ -0,0 +1,119 @@
require 'yaml'
require 'digest'
WOODPECKER_YML='.woodpecker.yml'
DOCKER_COMPOSE='compose.test.yml'
desc 'iniciar entorno'
task :up do
compose('up', '--build', '-d')
end
desc 'poblar entorno'
task :init => [:up] do
compose('exec', 'app.dev', 'pip3 install psycopg2 flake8 trytond==7.0.0')
compose('exec', 'app.dev', "bash .dev/install_module.sh")
end
desc 'terminal'
task :sh do
compose('exec', 'app.dev', 'bash')
end
desc 'iterar'
task :tdd, [:name] do |_, args|
refresh_cache
test_dir = ''
if args.name
test_dir = "modules/#{args.name}"
compose('exec', 'app.dev', "bash -c 'cd #{test_dir} && flake8'")
compose('exec', 'app.dev', "bash -c 'cd #{test_dir}/tests && python3 -m unittest'")
else
compose('exec', 'app.dev', "bash -c 'cd modules && flake8 *'")
compose('exec', 'app.dev', "bash -c 'python -m unittest discover -s modules'")
end
end
desc 'detener entorno'
task :down do
compose('down')
end
desc 'entorno vivo'
namespace :live do
desc 'iniciar entorno'
task :up do
compose('up', '--build', '-d', compose: 'compose.yml')
end
desc 'monitorear salida'
task :tail do
compose('logs', '-f', 'live.dev', compose: 'compose.yml')
end
desc 'detener entorno'
task :down do
compose('down', compose: 'compose.yml')
end
desc 'reiniciar entorno'
task :restart do
compose('restart', compose: 'compose.yml')
end
desc 'terminal'
task :sh do
compose('exec', 'live.dev', 'bash')
end
end
def compose(*arg, compose: DOCKER_COMPOSE)
sh "docker-compose -f #{compose} #{arg.join(' ')}"
end
def refresh_cache
# cuando se realizan cambios sobre los modelos
# que afectan las tablas es necesario limpiar el cache
# de trytond
changes = []
has_git_dir = File.directory?(File.join(File.dirname(__FILE__), '.git'))
try_git = `which git`.then { $? }.success? && has_git_dir
try_fossil = system('fossil status', err: :close, out: :close)
if try_fossil
changes = %x{fossil diff}.split("\n").grep(/^[-+]/)
elsif try_git
changes = %x{git diff -- '*.xml' ':!*view*'}.split("\n").grep(/^[-+index]/)
else
warn <<WARN
no se detecta repositorio en control de versiones, debe manualmente
limpiar el cache si ahi cambios en el esquema de los modelos.
Eliminando en el contenedor los archivo /tmp/*.dump
WARN
end
refresh_trytond_cache(changes)
end
def refresh_trytond_cache(changes)
num = changes.grep(//).length
hash = Digest::MD5.hexdigest(changes.flatten.join(''))
# touch
File.open('.tdd_cache', 'a+').close
File.open('.tdd_cache', 'r+') do |cache|
tdd_cache = cache.read()
if num > 0 && (tdd_cache != hash)
compose('exec', 'app.dev', 'bash -c "rm -f /tmp/*.dump"')
cache.seek(0); cache.write(hash)
end
end
end

15
compose.test.yml Executable file
View File

@ -0,0 +1,15 @@
version: '3.9'
services:
app.dev:
build:
context: .
dockerfile: Dockerfile_Test
environment:
SRC: /app
DB_CACHE: /tmp
DB_NAME: ":memory:"
TRYTOND_DATABASE_URI: sqlite://
command: sleep 10h
volumes:
- .:/app
working_dir: /app

23
compose.yml Executable file
View File

@ -0,0 +1,23 @@
version: '3.9'
services:
db.dev:
image: postgres:12
environment:
- POSTGRES_USER=tryton
- POSTGRES_PASSWORD=tryton
- POSTGRES_DB=tryton
live.dev:
build:
context: .
depends_on:
- db.dev
command: bash .dev/run.sh
environment:
- DB_NAME=tryton
- SRC=/app
- TRYTOND_DATABASE_URI=postgresql://tryton:tryton@db.dev:5432/
volumes:
- .:/app
ports:
- "${TRYTON_PORT:-28000}:8000"
working_dir: /app

View File

@ -0,0 +1,56 @@
clone:
hg:
image: plugins/hg
environment:
- HG_SHARE_POOL=/root/.cache/hg
volumes:
- cache:/root/.cache
pipeline:
tox:
image: ${IMAGE}
environment:
- CFLAGS=-O0
- DB_CACHE=/cache
- TOX_TESTENV_PASSENV=CFLAGS DB_CACHE
- POSTGRESQL_URI=postgresql://postgres@postgresql:5432/
commands:
- echo "[extensions]" >> /root/.hgrc
- echo "hgext.share =" >> /root/.hgrc
- echo "[share]" >> /root/.hgrc
- echo "pool = /root/.cache/hg" >> /root/.hgrc
- pip install tox
- tox -e "${TOXENV}-${DATABASE}"
volumes:
- cache:/root/.cache
services:
postgresql:
image: postgres
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off"
when:
matrix:
DATABASE: postgresql
matrix:
include:
- IMAGE: python:3.6
TOXENV: py36
DATABASE: sqlite
- IMAGE: python:3.6
TOXENV: py36
DATABASE: postgresql
- IMAGE: python:3.7
TOXENV: py37
DATABASE: sqlite
- IMAGE: python:3.7
TOXENV: py37
DATABASE: postgresql
- IMAGE: python:3.8
TOXENV: py38
DATABASE: sqlite
- IMAGE: python:3.8
TOXENV: py38
DATABASE: postgresql

View File

@ -0,0 +1,2 @@
[flake8]
ignore=E123,E124,E126,E128,E741,W503

218
modules/account_co_co/.gitignore vendored Normal file
View File

@ -0,0 +1,218 @@
# ---> Python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.bk
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# ---> Emacs
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/
# projectiles files
.projectile
# directory configuration
.dir-locals.el
# network security
/network-security.data
# ---> Vim
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
# ---> VirtualEnv
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
.Python
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
.venv
pip-selfcheck.json

View File

@ -0,0 +1,14 @@
Copyright (C) 2020 Alus Tmp
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -0,0 +1,5 @@
include CHANGELOG
include COPYRIGHT
include LICENSE
include README.rst
include doc/*

View File

@ -0,0 +1 @@
doc/index.rst

View File

@ -0,0 +1,29 @@
from trytond.pool import Pool
from . import party
from . import country
from . import rut
from . import configuration
from . import account
from . import subdivision
__all__ = ['register']
def register():
Pool.register(
party.Party,
party.PartyIdentifier,
party.PartyTaxLevelCode,
party.Address,
country.Subdivision,
rut.TaxLevelCode,
configuration.Configuration,
account.Account,
account.Move,
account.Line,
subdivision.Subdivision,
module='account_co_co', type_='model')
Pool.register(
module='account_co_co', type_='wizard')
Pool.register(
module='account_co_co', type_='report')

View File

@ -0,0 +1,158 @@
from sql.aggregate import Sum
from sql.functions import Abs, Round
from sql.operators import Exists
from trytond.pool import Pool, PoolMeta
from trytond.model.exceptions import AccessError
from .exceptions import PostError
from trytond.i18n import gettext
from trytond.model import ModelView
from decimal import Decimal
from itertools import groupby
from trytond.transaction import Transaction
from trytond.tools import reduce_ids, grouped_slice
__all__ = ['Account', 'Move', 'Line']
class Account(metaclass=PoolMeta):
__name__ = 'account.account'
@classmethod
def __setup__(cls):
super(Account, cls).__setup__()
cls.party_required.domain = [()]
cls.party_required.states = {}
class Move(metaclass=PoolMeta):
__name__ = 'account.move'
@classmethod
def create(cls, vlist):
pool = Pool()
Journal = pool.get('account.journal')
context = Transaction().context
journals = {}
default_company = cls.default_company()
vlist = [x.copy() for x in vlist]
for vals in vlist:
if not vals.get('number'):
journal_id = vals.get('journal', context.get('journal'))
company_id = vals.get('company', default_company)
if journal_id:
if journal_id not in journals:
journal = journals[journal_id] = Journal(journal_id)
else:
journal = journals[journal_id]
sequence = journal.get_multivalue(
'sequence', company=company_id)
if sequence:
with Transaction().set_context(company=company_id):
vals['number'] = sequence.get()
return super().create(vlist)
@classmethod
@ModelView.button
def post(cls, moves):
pool = Pool()
Date = pool.get('ir.date')
Line = pool.get('account.move.line')
move = cls.__table__()
line = Line.__table__()
cursor = Transaction().connection.cursor()
to_reconcile = []
for company, c_moves in groupby(moves, lambda m: m.company):
currency = company.currency
for sub_moves in grouped_slice(list(c_moves)):
sub_moves_ids = [m.id for m in sub_moves]
cursor.execute(*move.select(
move.id,
where=reduce_ids(move.id, sub_moves_ids)
& ~Exists(line.select(
line.move,
where=line.move == move.id))))
try:
move_id, = cursor.fetchone()
except TypeError:
pass
else:
raise PostError(
gettext('account.msg_post_empty_move',
move=cls(move_id).rec_name))
cursor.execute(*line.select(
line.move,
where=reduce_ids(line.move, sub_moves_ids),
group_by=line.move,
having=Abs(Round(
Sum(line.debit - line.credit),
currency.digits)) >= abs(currency.rounding)))
try:
move_id, = cursor.fetchone()
except TypeError:
pass
else:
raise PostError(
gettext('account.msg_post_unbalanced_move',
move=cls(move_id).rec_name))
cursor.execute(*line.select(
line.id,
where=reduce_ids(line.move, sub_moves_ids)
& (line.debit == Decimal(0))
& (line.credit == Decimal(0))))
to_reconcile.extend(l for l, in cursor)
for move in moves:
move.state = 'posted'
if not move.post_number:
with Transaction().set_context(company=move.company.id):
move.post_date = Date.today()
move.post_number = move.period.post_move_sequence_used.get()
def keyfunc(line):
return line.party, line.account
to_reconcile = Line.browse(sorted(
[l for l in Line.browse(to_reconcile) if l.account.reconcile],
key=keyfunc))
for _, lines in groupby(to_reconcile, keyfunc):
Line.reconcile(list(lines))
cls.save(moves)
class Line(metaclass=PoolMeta):
__name__ = 'account.move.line'
@classmethod
def __setup__(cls):
super(Line, cls).__setup__()
cls.party.states = {}
@classmethod
def check_account(cls, lines, field_names=None):
if field_names and not (field_names & {'account', 'party'}):
return
for line in lines:
if not line.account.type or line.account.closed:
raise AccessError(
gettext('account.msg_line_closed_account',
account=line.account.rec_name))
if line.account.party_required:
if bool(line.party) != bool(line.account.party_required):
error = 'party_set' if line.party else 'party_required'
raise AccessError(
gettext('account.msg_line_%s' % error,
account=line.account.rec_name,
line=line.rec_name))

View File

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<menuitem parent="account.menu_entries"
action="account.act_move_line_form" id="menu_account_move_line"
sequence="10"/>
</data>
</tryton>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="address_view_form_simple">
<field name="model">party.address</field>
<field name="inherit" ref="party.address_view_form_simple"/>
<field name="name">address_form</field>
</record>
</data>
</tryton>

View File

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="party.address.subdivision_type" id="CO">
<field name="country_code">CO</field>
<field name="types" eval="['department', 'capital district']"/>
</record>
</data>
</tryton>

View File

@ -0,0 +1,11 @@
from trytond.model import fields
from trytond.pool import PoolMeta
__all__ = ['Configuration']
class Configuration(metaclass=PoolMeta):
__name__ = 'account.configuration'
default_draft_sequence = fields.Many2One(
'ir.sequence', "Draft Sequence")

View File

@ -0,0 +1,10 @@
<?xml version='1.0'?>
<tryton>
<data>
<record model="ir.ui.view" id="configuration_view_form">
<field name="model">account.configuration</field>
<field name="inherit" ref="account.configuration_view_form"/>
<field name="name">configuration_form</field>
</record>
</data>
</tryton>

View File

@ -0,0 +1,17 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, fields
from trytond.pool import PoolMeta
__all__ = ['Subdivision']
class Subdivision(ModelSQL, ModelView):
"Subdivision"
__metaclass__ = PoolMeta
__name__ = 'country.subdivision'
dane_code = fields.Char('Codigo Dane',
help="Codigo Dane, usado en Colombia")

View File

@ -0,0 +1,2 @@
Account Co Co Module
####################

View File

@ -0,0 +1,21 @@
code,name,department,dane_code
1100,Antonio Nariño,11,1115
1102,Barrios Unidos,11,1112
1103,Bosa,11,1107
1104,Chapinero,11,1102
1105,Ciudad Bolívar,11,1119
1106,Engativá,11,1110
1107,Fontibón,11,1109
1108,Kennedy,11,1108
1109,La Candelaria,11,1117
1110,Los Mártires,11,1114
1111,Puente Aranda,11,1116
1112,Rafael Uribe Uribe,11,1118
1113,San Cristóbal,11,1104
1114,Santa Fe,11,1103
1115,Suba,11,1111
1116,Sumapaz,11,1120
1117,Teusaquillo,11,1113
1118,Tunjuelito,11,1106
1119,Usaquén,11,1101
1120,Usme,11,1105
1 code name department dane_code
2 1100 Antonio Nariño 11 1115
3 1102 Barrios Unidos 11 1112
4 1103 Bosa 11 1107
5 1104 Chapinero 11 1102
6 1105 Ciudad Bolívar 11 1119
7 1106 Engativá 11 1110
8 1107 Fontibón 11 1109
9 1108 Kennedy 11 1108
10 1109 La Candelaria 11 1117
11 1110 Los Mártires 11 1114
12 1111 Puente Aranda 11 1116
13 1112 Rafael Uribe Uribe 11 1118
14 1113 San Cristóbal 11 1104
15 1114 Santa Fe 11 1103
16 1115 Suba 11 1111
17 1116 Sumapaz 11 1120
18 1117 Teusaquillo 11 1113
19 1118 Tunjuelito 11 1106
20 1119 Usaquén 11 1101
21 1120 Usme 11 1105

View File

@ -0,0 +1,64 @@
"""
Convierte el archivo municipios_colombia.csv y departamentos_colombia.csv
en municipios_colombia.xml
"""
import csv
model = 'country.subdivision'
municipalities = open('localities_colombia.csv', 'r')
subdivisions = open('subdivisions_colombia.csv', 'r')
municipalities_xml = open('localities_colombia.xml', 'w')
municipalities_reader = csv.reader(municipalities)
subdivisions_reader = csv.reader(subdivisions)
subdivisions_header = next(subdivisions_reader)
d_fields = {subdivisions_header[x]: x for x in range(
0, len(subdivisions_header))}
Subdivisions = {}
for subdivision in subdivisions_reader:
dane_code = int(subdivision[d_fields['DANE']])
Subdivisions[dane_code] = dict(zip(list(d_fields.keys()), subdivision))
subdivisions.close()
municipalities_header = next(municipalities_reader)
m_fields = {
municipalities_header[x]: x for x in range(
0, len(municipalities_header))}
municipalities_xml.write("""<?xml version="1.0"?>
<tryton>
<data>
""")
for row in municipalities_reader:
dane_code = row[m_fields['dane_code']]
depto_id = "CO-" + Subdivisions[int(row[m_fields['department']])]['DANE']
municipalities_xml.write(
"""
<record model="{model}" id="{id}">
<field name="name">{name}</field>
<field name="dane_code">{dane_code}</field>
<field name="country" ref="50"/>
<field name="type">{type}</field>
<field name="code">{code}</field>
<field name="parent" ref="{parent}"/>
</record>
""".format(
model=model,
id="CO-" + str(dane_code),
name=row[m_fields['name']],
code="CO-" + str(row[m_fields['code']]),
dane_code=dane_code,
depto_id=depto_id,
type="localities",
parent="CO-" + row[m_fields['department']],
))
municipalities_xml.write("""
</data>
</tryton>
"""
)
municipalities.close()
municipalities_xml.close()

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,61 @@
"""
Convierte el archivo municipios_colombia.csv y departamentos_colombia.csv
en municipios_colombia.xml
"""
import csv
model = 'country.subdivision'
municipalities = open('municipalities_colombia.csv', 'r')
subdivisions = open('subdivisions_colombia.csv', 'r')
municipalities_xml = open('municipalities_colombia.xml', 'w')
municipalities_reader = csv.reader(municipalities)
subdivisions_reader = csv.reader(subdivisions)
subdivisions_header = next(subdivisions_reader)
d_fields = {subdivisions_header[x]: x for x in range(
0, len(subdivisions_header))}
Subdivisions = {}
for subdivision in subdivisions_reader:
dane_code = int(subdivision[d_fields['DANE']])
Subdivisions[dane_code] = dict(zip(list(d_fields.keys()), subdivision))
subdivisions.close()
municipalities_header = next(municipalities_reader)
m_fields = {municipalities_header[x]: x for x in range(
0, len(municipalities_header))}
municipalities_xml.write("""<?xml version="1.0"?>
<tryton>
<data>
""")
for row in municipalities_reader:
dane_code = row[m_fields['department']] + row[m_fields['code']]
depto_id = "CO-" + Subdivisions[int(row[m_fields['department']])]['DANE']
municipalities_xml.write("""
<record model="{model}" id="{id}">
<field name="name">{name}</field>
<field name="dane_code">{dane_code}</field>
<field name="country" ref="50"/>
<field name="type">{type}</field>
<field name="code">{code}</field>
<field name="parent" ref="{parent}"/>
</record>""".format(
model=model,
id="CO-" + str(dane_code),
name=row[m_fields['name']],
code="CO-" + str(dane_code),
dane_code=dane_code,
depto_id=depto_id,
type="municipality",
parent="CO-" + row[m_fields['department']]
))
municipalities_xml.write("""
</data>
</tryton>
"""
)
municipalities.close()
municipalities_xml.close()

View File

@ -0,0 +1,34 @@
Department,HASC,ISO,FIPS,NUTE,DANE,Dane #,Iso-country,Type,Population,Area(km.²),Area(mi.²),Capital
Amazonas,CO.AM,AMA,CO01,20491,91,91,co-91,department,"46,95","109,665","42,342",Leticia
Antioquia,CO.AN,ANT,CO02,20505,05,05,co-5,department,"5,601,507","63,612","24,561",Medellín
Arauca,CO.AR,ARA,CO03,20781,81,81,co-81,department,"153,028","23,818","9,196",Arauca
Atlántico,CO.AT,ATL,CO04,20208,08,08,co-8,department,"2,112,001","3,388","1,308",Barranquilla
Bolívar,CO.BL,BOL,CO35,20213,13,13,co-13,department,"1,836,640","25,978","10,03",Cartagena
Boyacá,CO.BY,BOY,CO36,20615,15,15,co-15,department,"1,210,982","23,189","8,953",Tunja
Caldas,CO.CL,CAL,CO37,20617,17,17,co-17,department,"898,49","7,888","3,046",Manizales
Caquetá,CO.CQ,CAQ,CO08,20418,18,18,co-18,department,"337,932","88,965","34,35",Florencia
Casanare,CO.CS,CAS,CO32,20785,85,85,co-85,department,"281,294","44,64","17,236",Yopal
Cauca,CO.CA,CAU,CO09,20319,19,19,co-19,department,"1,182,022","29,308","11,316",Popayán
Cesar,CO.CE,CES,CO10,20220,20,20,co-20,department,"878,437","22,905","8,844",Valledupar
Chocó,CO.CH,CHO,CO11,20327,27,27,co-27,department,"388,476","46,53","17,965",Quibdó
Córdoba,CO.CO,COR,CO12,20223,23,23,co-23,department,"1,462,909","25,02","9,66",Montería
Cundinamarca,CO.CU,CUN,CO33,20625,25,25,co-25,department,"2,228,682","22,478","8,679",Bogotá
Bogotá,CO.DC,DC,CO34,20111,11,11,co-11,capital district,"6,778,691","1,732",669,Bogotá
Guainía,CO.GN,GUA,CO15,20494,94,94,co-94,department,"18,797","72,238","27,891",Puerto Inírida
Guaviare,CO.GV,GUV,CO14,20495,95,95,co-95,department,"56,758","42,327","16,343",San José del Guaviare
Huila,CO.HU,HUI,CO16,20641,41,41,co-41,department,"1,001,476","19,89","7,68",Neiva
La Guajira,CO.LG,LAG,CO17,20244,44,44,co-44,department,"655,943","20,848","8,049",Riohacha
Magdalena,CO.MA,MAG,CO38,20247,47,47,co-47,department,"1,136,819","23,188","8,953",Santa Marta
Meta,CO.ME,MET,CO19,20750,50,50,co-50,department,"713,772","85,635","33,064",Villavicencio
Nariño,CO.NA,NAR,CO20,20352,52,52,co-52,department,"1,498,234","33,268","12,845",Pasto
Norte de Santander,CO.NS,NSA,CO21,20554,54,54,co-54,department,"1,208,336","21,658","8,362",Cúcuta
Putumayo,CO.PU,PUT,CO22,20486,86,86,co-86,department,"237,197","24,885","9,608",Mocoa
Quindío,CO.QD,QUI,CO23,20663,63,63,co-63,department,"518,691","1,845",712,Armenia
Risaralda,CO.RI,RIS,CO24,20666,66,66,co-66,department,"859,666","4,14","1,598",Pereira
San Andrés y Providencia,CO.SA,SAP,CO25,20288,88,88,co-88,department,"59,573",44,17,San Andrés
Santander,CO.ST,SAN,CO26,20568,68,68,co-68,department,"1,913,444","30,537","11,79",Bucaramanga
Sucre,CO.SU,SUC,CO27,20270,70,70,co-70,department,"762,263","10,917","4,215",Sincelejo
Tolima,CO.TO,TOL,CO28,20673,73,73,co-73,department,"1,312,304","23,562","9,097",Ibagué
Valle del Cauca,CO.VC,VAC,CO29,20376,76,76,co-76,department,"4,052,535","22,14","8,548",Cali
Vaupés,CO.VP,VAU,CO30,20497,97,97,co-97,department,"19,943","65,268","25,2",Mitú
Vichada,CO.VD,VID,CO31,20799,99,99,co-99,department,"44,592","100,242","38,704",Puerto Carreño
1 Department HASC ISO FIPS NUTE DANE Dane # Iso-country Type Population Area(km.²) Area(mi.²) Capital
2 Amazonas CO.AM AMA CO01 20491 91 91 co-91 department 46,95 109,665 42,342 Leticia
3 Antioquia CO.AN ANT CO02 20505 05 05 co-5 department 5,601,507 63,612 24,561 Medellín
4 Arauca CO.AR ARA CO03 20781 81 81 co-81 department 153,028 23,818 9,196 Arauca
5 Atlántico CO.AT ATL CO04 20208 08 08 co-8 department 2,112,001 3,388 1,308 Barranquilla
6 Bolívar CO.BL BOL CO35 20213 13 13 co-13 department 1,836,640 25,978 10,03 Cartagena
7 Boyacá CO.BY BOY CO36 20615 15 15 co-15 department 1,210,982 23,189 8,953 Tunja
8 Caldas CO.CL CAL CO37 20617 17 17 co-17 department 898,49 7,888 3,046 Manizales
9 Caquetá CO.CQ CAQ CO08 20418 18 18 co-18 department 337,932 88,965 34,35 Florencia
10 Casanare CO.CS CAS CO32 20785 85 85 co-85 department 281,294 44,64 17,236 Yopal
11 Cauca CO.CA CAU CO09 20319 19 19 co-19 department 1,182,022 29,308 11,316 Popayán
12 Cesar CO.CE CES CO10 20220 20 20 co-20 department 878,437 22,905 8,844 Valledupar
13 Chocó CO.CH CHO CO11 20327 27 27 co-27 department 388,476 46,53 17,965 Quibdó
14 Córdoba CO.CO COR CO12 20223 23 23 co-23 department 1,462,909 25,02 9,66 Montería
15 Cundinamarca CO.CU CUN CO33 20625 25 25 co-25 department 2,228,682 22,478 8,679 Bogotá
16 Bogotá CO.DC DC CO34 20111 11 11 co-11 capital district 6,778,691 1,732 669 Bogotá
17 Guainía CO.GN GUA CO15 20494 94 94 co-94 department 18,797 72,238 27,891 Puerto Inírida
18 Guaviare CO.GV GUV CO14 20495 95 95 co-95 department 56,758 42,327 16,343 San José del Guaviare
19 Huila CO.HU HUI CO16 20641 41 41 co-41 department 1,001,476 19,89 7,68 Neiva
20 La Guajira CO.LG LAG CO17 20244 44 44 co-44 department 655,943 20,848 8,049 Riohacha
21 Magdalena CO.MA MAG CO38 20247 47 47 co-47 department 1,136,819 23,188 8,953 Santa Marta
22 Meta CO.ME MET CO19 20750 50 50 co-50 department 713,772 85,635 33,064 Villavicencio
23 Nariño CO.NA NAR CO20 20352 52 52 co-52 department 1,498,234 33,268 12,845 Pasto
24 Norte de Santander CO.NS NSA CO21 20554 54 54 co-54 department 1,208,336 21,658 8,362 Cúcuta
25 Putumayo CO.PU PUT CO22 20486 86 86 co-86 department 237,197 24,885 9,608 Mocoa
26 Quindío CO.QD QUI CO23 20663 63 63 co-63 department 518,691 1,845 712 Armenia
27 Risaralda CO.RI RIS CO24 20666 66 66 co-66 department 859,666 4,14 1,598 Pereira
28 San Andrés y Providencia CO.SA SAP CO25 20288 88 88 co-88 department 59,573 44 17 San Andrés
29 Santander CO.ST SAN CO26 20568 68 68 co-68 department 1,913,444 30,537 11,79 Bucaramanga
30 Sucre CO.SU SUC CO27 20270 70 70 co-70 department 762,263 10,917 4,215 Sincelejo
31 Tolima CO.TO TOL CO28 20673 73 73 co-73 department 1,312,304 23,562 9,097 Ibagué
32 Valle del Cauca CO.VC VAC CO29 20376 76 76 co-76 department 4,052,535 22,14 8,548 Cali
33 Vaupés CO.VP VAU CO30 20497 97 97 co-97 department 19,943 65,268 25,2 Mitú
34 Vichada CO.VD VID CO31 20799 99 99 co-99 department 44,592 100,242 38,704 Puerto Carreño

View File

@ -0,0 +1,56 @@
"""
Convierte el archivo departamentos_colombia.csv
en subdivisions_colombia.xml
"""
import csv
model = 'country.subdivision'
subdivisions = open('subdivisions_colombia.csv', 'r')
subdivisions_xml = open('subdivisions_colombia.xml', 'w')
subdivisions_reader = csv.reader(subdivisions)
subdivisions_header = next(subdivisions_reader)
d_fields = {subdivisions_header[x]: x for x in range(
0, len(subdivisions_header))}
Subdivisions = {}
subdivisions_xml.write('''<?xml version="1.0"?>
<tryton>
<data>
''')
subdivisions_xml.write(''' <record model="country.country" id="50">
<field name="name">Colombia</field>
<field name="code">CO</field>
<field name="code3">COL</field>
<field name="code_numeric">170</field>
</record>
''')
for row in subdivisions_reader:
dane_code = row[d_fields['DANE']]
country_id = "50"
subdivisions_xml.write(''' <record model="{model}" id="{id}">
<field name="name">{name}</field>
<field name="type">{types}</field>
<field name="country" ref="50"/>
<field name="code">{code}</field>
<field name="dane_code">{dane_code}</field>
</record>
'''.format(
model=model,
id="CO-" + str(dane_code),
name=row[d_fields['Department']],
types=row[d_fields['Type']],
code="CO-" + str(dane_code),
dane_code=dane_code
))
subdivisions_xml.write(""" </data>
</tryton>
"""
)
subdivisions.close()
subdivisions_xml.close()

View File

@ -0,0 +1,115 @@
"Código","Significado"
"O-07","Retención en la fuente a título de renta"
"O-08","Retención timbre nacional"
"O-09","Retención en la fuente en el impuesto sobre las ventas"
"O-13","Gran contribuyente"
"O-14","Informante de exógena"
"O-15","Autorretenedor"
"O-16","Obligación de facturar por ingresos de bienes y/o servicios excluidos"
"O-17","Profesionales de compra y venta de divisas"
"O-19","Productor y/o exportador de bienes exentos"
"O-22","Obligado a cumplir deberes formales a nombre de terceros"
"O-23","Agente de retención en el impuesto sobre las ventas"
"O-32","Impuesto Nacional a la Gasolina y al ACPM"
"O-33","Impuesto Nacional al consumo"
"O-34","Régimen simplificado impuesto nacional consumo rest y bares"
"O-36","Establecimiento Permanente"
"O-37","Obligado a Facturar Electrónicamente Modelo 2242"
"O-38","Facturación Electrónica Voluntaria Modelo 2242"
"O-39","Proveedor de Servicios Tecnológicos PST Modelo 2242"
"O-47","Régimen Simple de Tributación SIMPLE"
"O-48","Impuesto sobre las ventas IVA"
"O-49","No responsable de IVA"
"O-52","Facturador electrónico"
"O-99","Otro tipo de obligado"
"R-00-PN","Clientes del Exterior"
"R-12-PN","Factor PN"
"R-16-PN","Mandatario"
"R-25-PN","Agente Interventor"
"R-99-PN","No responsable"
"R-06-PJ","Apoderado especial"
"R-07-PJ","Apoderado general"
"R-12-PJ","Factor"
"R-16-PJ","Mandatario"
"R-99-PJ","Otro tipo de responsable"
"A-01","Agente de carga internacional"
"A-02","Agente marítimo"
"A-03","Almacén general de depósito"
"A-04","Comercializadora internacional (C.I.)"
"A-05","Comerciante de la zona aduanera especial de Inírida, Puerto Carreño, Cumaribo y Primavera"
"A-06","Comerciantes de la zona de régimen aduanero especial de Leticia"
"A-07","Comerciantes de la zona de régimen aduanero especial de Maicao, Uribia y Manaure"
"A-08","Comerciantes de la zona de régimen aduanero especial de Urabá, Tumaco y Guapí"
"A-09","Comerciantes del puerto libre de San Andrés, Providencia y Santa Catalina"
"A-10","Depósito público de apoyo logístico internacional"
"A-11","Depósito privado para procesamiento industrial"
"A-12","Depósito privado de transformación o ensamble"
"A-13","Depósito franco"
"A-14","Depósito privado aeronáutico"
"A-15","Depósito privado para distribución internacional"
"A-16","Depósito privado de provisiones de a bordo para consumo y para llevar"
"A-17","Depósito privado para envíos urgentes"
"A-18","Depósito privado"
"A-19","Depósito público"
"A-20","Depósito público para distribución internacional"
"A-21","Exportador de café"
"A-22","Exportador"
"A-23","Importador"
"A-24","Intermediario de tráfico postal y envíos urgentes"
"A-25","Operador de transporte multimodal"
"A-26","Sociedad de intermediación aduanera"
"A-27","Titular de puertos y muelles de servicio público o privado"
"A-28","Transportador 263nfor régimen de importación y/o exportación"
"A-29","Transportista nacional para operaciones del régimen de tránsito aduanero"
"A-30","Usuario comercial zona franca"
"A-32","Usuario industrial de bienes zona franca"
"A-34","Usuario industrial de servicios zona franca"
"A-36","Usuario operador de zona franca"
"A-37","Usuario aduanero permanente"
"A-38","Usuario altamente exportador"
"A-39","Usuario de zonas económicas especiales de exportación"
"A-40","Deposito privado de instalaciones industriales"
"A-41","Beneficiarios de programas especiales de exportación PEX"
"A-42","Depósitos privados para mercancías en tránsito San Andrés"
"A-43","Observadores de las operaciones de importación"
"A-44","Usuarios sistemas especiales Importación exportación"
"A-46","Transportador 263nformac régimen de importación y/o exportación"
"A-47","Transportador terrestre régimen de importación y/o exportación"
"A-48","Aeropuerto de servicio publico o privado"
"A-49","Transportador fluvial régimen de importación"
"A-50","Usuario industrial zona franca especial"
"A-53","Agencias de aduanas 1"
"A-54","Usuario Operador Zona Franca Especial"
"A-55","Agencias de aduanas 2"
"A-56","Agencias de aduanas 3"
"A-57","Agencias de aduanas 4"
"A-58","Transportador aéreo nacional"
"A-60","Transportador aéreo, marítimo o fluvial modalidad Cabotaje"
"A-61","Importador de alimentos de consumo humano y animal"
"A-62","Importador Ocasional"
"A-63","Importador de maquinaría y sus partes Decreto 2261 de 2012"
"A-64","Beneficiario Programa de Fomento Industria Automotriz-PROFIA"
"A-99","Otro tipo de agente aduanero"
"E-01","Agencia"
"E-02","Establecimiento de comercio"
"E-03","Centro de explotación agrícola"
"E-04","Centro de explotación animal"
"E-05","Centro de explotación minera"
"E-06","Centro de explotación de transformación"
"E-07","Centro de explotación de servicios"
"E-08","Oficina"
"E-09","Sede"
"E-10","Sucursal"
"E-11","Consultorio"
"E-12","Administraciones"
"E-13","Seccionales"
"E-14","Regionales"
"E-15","Intendencias"
"E-16","Local o negocio"
"E-17","Punto de venta"
"E-18","Fábrica"
"E-19","Taller"
"E-20","Cantera"
"E-21","Pozo de Petróleo y Gas"
"E-22","Otro lug de tipo de extrac explotación de recursos naturales"
"E-99","Otro tipo de establecimiento"
1 Código Significado
2 O-07 Retención en la fuente a título de renta
3 O-08 Retención timbre nacional
4 O-09 Retención en la fuente en el impuesto sobre las ventas
5 O-13 Gran contribuyente
6 O-14 Informante de exógena
7 O-15 Autorretenedor
8 O-16 Obligación de facturar por ingresos de bienes y/o servicios excluidos
9 O-17 Profesionales de compra y venta de divisas
10 O-19 Productor y/o exportador de bienes exentos
11 O-22 Obligado a cumplir deberes formales a nombre de terceros
12 O-23 Agente de retención en el impuesto sobre las ventas
13 O-32 Impuesto Nacional a la Gasolina y al ACPM
14 O-33 Impuesto Nacional al consumo
15 O-34 Régimen simplificado impuesto nacional consumo rest y bares
16 O-36 Establecimiento Permanente
17 O-37 Obligado a Facturar Electrónicamente Modelo 2242
18 O-38 Facturación Electrónica Voluntaria Modelo 2242
19 O-39 Proveedor de Servicios Tecnológicos PST Modelo 2242
20 O-47 Régimen Simple de Tributación – SIMPLE
21 O-48 Impuesto sobre las ventas – IVA
22 O-49 No responsable de IVA
23 O-52 Facturador electrónico
24 O-99 Otro tipo de obligado
25 R-00-PN Clientes del Exterior
26 R-12-PN Factor PN
27 R-16-PN Mandatario
28 R-25-PN Agente Interventor
29 R-99-PN No responsable
30 R-06-PJ Apoderado especial
31 R-07-PJ Apoderado general
32 R-12-PJ Factor
33 R-16-PJ Mandatario
34 R-99-PJ Otro tipo de responsable
35 A-01 Agente de carga internacional
36 A-02 Agente marítimo
37 A-03 Almacén general de depósito
38 A-04 Comercializadora internacional (C.I.)
39 A-05 Comerciante de la zona aduanera especial de Inírida, Puerto Carreño, Cumaribo y Primavera
40 A-06 Comerciantes de la zona de régimen aduanero especial de Leticia
41 A-07 Comerciantes de la zona de régimen aduanero especial de Maicao, Uribia y Manaure
42 A-08 Comerciantes de la zona de régimen aduanero especial de Urabá, Tumaco y Guapí
43 A-09 Comerciantes del puerto libre de San Andrés, Providencia y Santa Catalina
44 A-10 Depósito público de apoyo logístico internacional
45 A-11 Depósito privado para procesamiento industrial
46 A-12 Depósito privado de transformación o ensamble
47 A-13 Depósito franco
48 A-14 Depósito privado aeronáutico
49 A-15 Depósito privado para distribución internacional
50 A-16 Depósito privado de provisiones de a bordo para consumo y para llevar
51 A-17 Depósito privado para envíos urgentes
52 A-18 Depósito privado
53 A-19 Depósito público
54 A-20 Depósito público para distribución internacional
55 A-21 Exportador de café
56 A-22 Exportador
57 A-23 Importador
58 A-24 Intermediario de tráfico postal y envíos urgentes
59 A-25 Operador de transporte multimodal
60 A-26 Sociedad de intermediación aduanera
61 A-27 Titular de puertos y muelles de servicio público o privado
62 A-28 Transportador 263nfor régimen de importación y/o exportación
63 A-29 Transportista nacional para operaciones del régimen de tránsito aduanero
64 A-30 Usuario comercial zona franca
65 A-32 Usuario industrial de bienes zona franca
66 A-34 Usuario industrial de servicios zona franca
67 A-36 Usuario operador de zona franca
68 A-37 Usuario aduanero permanente
69 A-38 Usuario altamente exportador
70 A-39 Usuario de zonas económicas especiales de exportación
71 A-40 Deposito privado de instalaciones industriales
72 A-41 Beneficiarios de programas especiales de exportación PEX
73 A-42 Depósitos privados para mercancías en tránsito San Andrés
74 A-43 Observadores de las operaciones de importación
75 A-44 Usuarios sistemas especiales Importación exportación
76 A-46 Transportador 263nformac régimen de importación y/o exportación
77 A-47 Transportador terrestre régimen de importación y/o exportación
78 A-48 Aeropuerto de servicio publico o privado
79 A-49 Transportador fluvial régimen de importación
80 A-50 Usuario industrial zona franca especial
81 A-53 Agencias de aduanas 1
82 A-54 Usuario Operador Zona Franca Especial
83 A-55 Agencias de aduanas 2
84 A-56 Agencias de aduanas 3
85 A-57 Agencias de aduanas 4
86 A-58 Transportador aéreo nacional
87 A-60 Transportador aéreo, marítimo o fluvial modalidad Cabotaje
88 A-61 Importador de alimentos de consumo humano y animal
89 A-62 Importador Ocasional
90 A-63 Importador de maquinaría y sus partes Decreto 2261 de 2012
91 A-64 Beneficiario Programa de Fomento Industria Automotriz-PROFIA
92 A-99 Otro tipo de agente aduanero
93 E-01 Agencia
94 E-02 Establecimiento de comercio
95 E-03 Centro de explotación agrícola
96 E-04 Centro de explotación animal
97 E-05 Centro de explotación minera
98 E-06 Centro de explotación de transformación
99 E-07 Centro de explotación de servicios
100 E-08 Oficina
101 E-09 Sede
102 E-10 Sucursal
103 E-11 Consultorio
104 E-12 Administraciones
105 E-13 Seccionales
106 E-14 Regionales
107 E-15 Intendencias
108 E-16 Local o negocio
109 E-17 Punto de venta
110 E-18 Fábrica
111 E-19 Taller
112 E-20 Cantera
113 E-21 Pozo de Petróleo y Gas
114 E-22 Otro lug de tipo de extrac explotación de recursos naturales
115 E-99 Otro tipo de establecimiento

View File

@ -0,0 +1,42 @@
"""
Convierte el archivo departamentos_colombia.csv
en subdivisions_colombia.xml
"""
import csv
model = 'party.tax_level_code'
tipo_responsabilidad = open('tipo_responsabilidad.csv', 'r')
tipo_responsabilidad_xml = open('tipo_responsabilidad.xml', 'w')
tipo_responsabilidad_reader = csv.reader(tipo_responsabilidad)
tipo_responsabilidad_header = next(tipo_responsabilidad_reader)
d_fields = {tipo_responsabilidad_header[x]: x for x in range(
0, len(tipo_responsabilidad_header))}
TipoResponsabilidad = {}
tipo_responsabilidad_xml.write('''<?xml version="1.0"?>
<tryton>
<data>
''')
for row in tipo_responsabilidad_reader:
tipo_responsabilidad_xml.write(''' <record model="{model}" id="{id}">
<field name="name">{name}</field>
<field name="code">{code}</field>
</record>
'''.format(
model=model,
id=row[d_fields['Código']],
name=row[d_fields['Significado']],
code=row[d_fields['Código']]
))
tipo_responsabilidad_xml.write(""" </data>
</tryton>
"""
)
tipo_responsabilidad.close()
tipo_responsabilidad_xml.close()

View File

@ -0,0 +1,461 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="party.tax_level_code" id="O-07">
<field name="name">Retención en la fuente a título de renta</field>
<field name="code">O-07</field>
</record>
<record model="party.tax_level_code" id="O-08">
<field name="name">Retención timbre nacional</field>
<field name="code">O-08</field>
</record>
<record model="party.tax_level_code" id="O-09">
<field name="name">Retención en la fuente en el impuesto sobre las ventas</field>
<field name="code">O-09</field>
</record>
<record model="party.tax_level_code" id="O-13">
<field name="name">Gran contribuyente</field>
<field name="code">O-13</field>
</record>
<record model="party.tax_level_code" id="O-14">
<field name="name">Informante de exógena</field>
<field name="code">O-14</field>
</record>
<record model="party.tax_level_code" id="O-15">
<field name="name">Autorretenedor</field>
<field name="code">O-15</field>
</record>
<record model="party.tax_level_code" id="O-16">
<field name="name">Obligación de facturar por ingresos de bienes y/o servicios excluidos</field>
<field name="code">O-16</field>
</record>
<record model="party.tax_level_code" id="O-17">
<field name="name">Profesionales de compra y venta de divisas</field>
<field name="code">O-17</field>
</record>
<record model="party.tax_level_code" id="O-19">
<field name="name">Productor y/o exportador de bienes exentos</field>
<field name="code">O-19</field>
</record>
<record model="party.tax_level_code" id="O-22">
<field name="name">Obligado a cumplir deberes formales a nombre de terceros</field>
<field name="code">O-22</field>
</record>
<record model="party.tax_level_code" id="O-23">
<field name="name">Agente de retención en el impuesto sobre las ventas</field>
<field name="code">O-23</field>
</record>
<record model="party.tax_level_code" id="O-32">
<field name="name">Impuesto Nacional a la Gasolina y al ACPM</field>
<field name="code">O-32</field>
</record>
<record model="party.tax_level_code" id="O-33">
<field name="name">Impuesto Nacional al consumo</field>
<field name="code">O-33</field>
</record>
<record model="party.tax_level_code" id="O-34">
<field name="name">Régimen simplificado impuesto nacional consumo rest y bares</field>
<field name="code">O-34</field>
</record>
<record model="party.tax_level_code" id="O-36">
<field name="name">Establecimiento Permanente</field>
<field name="code">O-36</field>
</record>
<record model="party.tax_level_code" id="O-37">
<field name="name">Obligado a Facturar Electrónicamente Modelo 2242</field>
<field name="code">O-37</field>
</record>
<record model="party.tax_level_code" id="O-38">
<field name="name">Facturación Electrónica Voluntaria Modelo 2242</field>
<field name="code">O-38</field>
</record>
<record model="party.tax_level_code" id="O-39">
<field name="name">Proveedor de Servicios Tecnológicos PST Modelo 2242</field>
<field name="code">O-39</field>
</record>
<record model="party.tax_level_code" id="O-47">
<field name="name">Régimen Simple de Tributación SIMPLE</field>
<field name="code">O-47</field>
</record>
<record model="party.tax_level_code" id="O-48">
<field name="name">Impuesto sobre las ventas IVA</field>
<field name="code">O-48</field>
</record>
<record model="party.tax_level_code" id="O-49">
<field name="name">No responsable de IVA</field>
<field name="code">O-49</field>
</record>
<record model="party.tax_level_code" id="O-52">
<field name="name">Facturador electrónico</field>
<field name="code">O-52</field>
</record>
<record model="party.tax_level_code" id="O-99">
<field name="name">Otro tipo de obligado</field>
<field name="code">O-99</field>
</record>
<record model="party.tax_level_code" id="R-00-PN">
<field name="name">Clientes del Exterior</field>
<field name="code">R-00-PN</field>
</record>
<record model="party.tax_level_code" id="R-12-PN">
<field name="name">Factor PN</field>
<field name="code">R-12-PN</field>
</record>
<record model="party.tax_level_code" id="R-16-PN">
<field name="name">Mandatario</field>
<field name="code">R-16-PN</field>
</record>
<record model="party.tax_level_code" id="R-25-PN">
<field name="name">Agente Interventor</field>
<field name="code">R-25-PN</field>
</record>
<record model="party.tax_level_code" id="R-99-PN">
<field name="name">No responsable</field>
<field name="code">R-99-PN</field>
</record>
<record model="party.tax_level_code" id="R-06-PJ">
<field name="name">Apoderado especial</field>
<field name="code">R-06-PJ</field>
</record>
<record model="party.tax_level_code" id="R-07-PJ">
<field name="name">Apoderado general</field>
<field name="code">R-07-PJ</field>
</record>
<record model="party.tax_level_code" id="R-12-PJ">
<field name="name">Factor</field>
<field name="code">R-12-PJ</field>
</record>
<record model="party.tax_level_code" id="R-16-PJ">
<field name="name">Mandatario</field>
<field name="code">R-16-PJ</field>
</record>
<record model="party.tax_level_code" id="R-99-PJ">
<field name="name">Otro tipo de responsable</field>
<field name="code">R-99-PJ</field>
</record>
<record model="party.tax_level_code" id="A-01">
<field name="name">Agente de carga internacional</field>
<field name="code">A-01</field>
</record>
<record model="party.tax_level_code" id="A-02">
<field name="name">Agente marítimo</field>
<field name="code">A-02</field>
</record>
<record model="party.tax_level_code" id="A-03">
<field name="name">Almacén general de depósito</field>
<field name="code">A-03</field>
</record>
<record model="party.tax_level_code" id="A-04">
<field name="name">Comercializadora internacional (C.I.)</field>
<field name="code">A-04</field>
</record>
<record model="party.tax_level_code" id="A-05">
<field name="name">Comerciante de la zona aduanera especial de Inírida, Puerto Carreño, Cumaribo y Primavera</field>
<field name="code">A-05</field>
</record>
<record model="party.tax_level_code" id="A-06">
<field name="name">Comerciantes de la zona de régimen aduanero especial de Leticia</field>
<field name="code">A-06</field>
</record>
<record model="party.tax_level_code" id="A-07">
<field name="name">Comerciantes de la zona de régimen aduanero especial de Maicao, Uribia y Manaure</field>
<field name="code">A-07</field>
</record>
<record model="party.tax_level_code" id="A-08">
<field name="name">Comerciantes de la zona de régimen aduanero especial de Urabá, Tumaco y Guapí</field>
<field name="code">A-08</field>
</record>
<record model="party.tax_level_code" id="A-09">
<field name="name">Comerciantes del puerto libre de San Andrés, Providencia y Santa Catalina</field>
<field name="code">A-09</field>
</record>
<record model="party.tax_level_code" id="A-10">
<field name="name">Depósito público de apoyo logístico internacional</field>
<field name="code">A-10</field>
</record>
<record model="party.tax_level_code" id="A-11">
<field name="name">Depósito privado para procesamiento industrial</field>
<field name="code">A-11</field>
</record>
<record model="party.tax_level_code" id="A-12">
<field name="name">Depósito privado de transformación o ensamble</field>
<field name="code">A-12</field>
</record>
<record model="party.tax_level_code" id="A-13">
<field name="name">Depósito franco</field>
<field name="code">A-13</field>
</record>
<record model="party.tax_level_code" id="A-14">
<field name="name">Depósito privado aeronáutico</field>
<field name="code">A-14</field>
</record>
<record model="party.tax_level_code" id="A-15">
<field name="name">Depósito privado para distribución internacional</field>
<field name="code">A-15</field>
</record>
<record model="party.tax_level_code" id="A-16">
<field name="name">Depósito privado de provisiones de a bordo para consumo y para llevar</field>
<field name="code">A-16</field>
</record>
<record model="party.tax_level_code" id="A-17">
<field name="name">Depósito privado para envíos urgentes</field>
<field name="code">A-17</field>
</record>
<record model="party.tax_level_code" id="A-18">
<field name="name">Depósito privado</field>
<field name="code">A-18</field>
</record>
<record model="party.tax_level_code" id="A-19">
<field name="name">Depósito público</field>
<field name="code">A-19</field>
</record>
<record model="party.tax_level_code" id="A-20">
<field name="name">Depósito público para distribución internacional</field>
<field name="code">A-20</field>
</record>
<record model="party.tax_level_code" id="A-21">
<field name="name">Exportador de café</field>
<field name="code">A-21</field>
</record>
<record model="party.tax_level_code" id="A-22">
<field name="name">Exportador</field>
<field name="code">A-22</field>
</record>
<record model="party.tax_level_code" id="A-23">
<field name="name">Importador</field>
<field name="code">A-23</field>
</record>
<record model="party.tax_level_code" id="A-24">
<field name="name">Intermediario de tráfico postal y envíos urgentes</field>
<field name="code">A-24</field>
</record>
<record model="party.tax_level_code" id="A-25">
<field name="name">Operador de transporte multimodal</field>
<field name="code">A-25</field>
</record>
<record model="party.tax_level_code" id="A-26">
<field name="name">Sociedad de intermediación aduanera</field>
<field name="code">A-26</field>
</record>
<record model="party.tax_level_code" id="A-27">
<field name="name">Titular de puertos y muelles de servicio público o privado</field>
<field name="code">A-27</field>
</record>
<record model="party.tax_level_code" id="A-28">
<field name="name">Transportador 263nfor régimen de importación y/o exportación</field>
<field name="code">A-28</field>
</record>
<record model="party.tax_level_code" id="A-29">
<field name="name">Transportista nacional para operaciones del régimen de tránsito aduanero</field>
<field name="code">A-29</field>
</record>
<record model="party.tax_level_code" id="A-30">
<field name="name">Usuario comercial zona franca</field>
<field name="code">A-30</field>
</record>
<record model="party.tax_level_code" id="A-32">
<field name="name">Usuario industrial de bienes zona franca</field>
<field name="code">A-32</field>
</record>
<record model="party.tax_level_code" id="A-34">
<field name="name">Usuario industrial de servicios zona franca</field>
<field name="code">A-34</field>
</record>
<record model="party.tax_level_code" id="A-36">
<field name="name">Usuario operador de zona franca</field>
<field name="code">A-36</field>
</record>
<record model="party.tax_level_code" id="A-37">
<field name="name">Usuario aduanero permanente</field>
<field name="code">A-37</field>
</record>
<record model="party.tax_level_code" id="A-38">
<field name="name">Usuario altamente exportador</field>
<field name="code">A-38</field>
</record>
<record model="party.tax_level_code" id="A-39">
<field name="name">Usuario de zonas económicas especiales de exportación</field>
<field name="code">A-39</field>
</record>
<record model="party.tax_level_code" id="A-40">
<field name="name">Deposito privado de instalaciones industriales</field>
<field name="code">A-40</field>
</record>
<record model="party.tax_level_code" id="A-41">
<field name="name">Beneficiarios de programas especiales de exportación PEX</field>
<field name="code">A-41</field>
</record>
<record model="party.tax_level_code" id="A-42">
<field name="name">Depósitos privados para mercancías en tránsito San Andrés</field>
<field name="code">A-42</field>
</record>
<record model="party.tax_level_code" id="A-43">
<field name="name">Observadores de las operaciones de importación</field>
<field name="code">A-43</field>
</record>
<record model="party.tax_level_code" id="A-44">
<field name="name">Usuarios sistemas especiales Importación exportación</field>
<field name="code">A-44</field>
</record>
<record model="party.tax_level_code" id="A-46">
<field name="name">Transportador 263nformac régimen de importación y/o exportación</field>
<field name="code">A-46</field>
</record>
<record model="party.tax_level_code" id="A-47">
<field name="name">Transportador terrestre régimen de importación y/o exportación</field>
<field name="code">A-47</field>
</record>
<record model="party.tax_level_code" id="A-48">
<field name="name">Aeropuerto de servicio publico o privado</field>
<field name="code">A-48</field>
</record>
<record model="party.tax_level_code" id="A-49">
<field name="name">Transportador fluvial régimen de importación</field>
<field name="code">A-49</field>
</record>
<record model="party.tax_level_code" id="A-50">
<field name="name">Usuario industrial zona franca especial</field>
<field name="code">A-50</field>
</record>
<record model="party.tax_level_code" id="A-53">
<field name="name">Agencias de aduanas 1</field>
<field name="code">A-53</field>
</record>
<record model="party.tax_level_code" id="A-54">
<field name="name">Usuario Operador Zona Franca Especial</field>
<field name="code">A-54</field>
</record>
<record model="party.tax_level_code" id="A-55">
<field name="name">Agencias de aduanas 2</field>
<field name="code">A-55</field>
</record>
<record model="party.tax_level_code" id="A-56">
<field name="name">Agencias de aduanas 3</field>
<field name="code">A-56</field>
</record>
<record model="party.tax_level_code" id="A-57">
<field name="name">Agencias de aduanas 4</field>
<field name="code">A-57</field>
</record>
<record model="party.tax_level_code" id="A-58">
<field name="name">Transportador aéreo nacional</field>
<field name="code">A-58</field>
</record>
<record model="party.tax_level_code" id="A-60">
<field name="name">Transportador aéreo, marítimo o fluvial modalidad Cabotaje</field>
<field name="code">A-60</field>
</record>
<record model="party.tax_level_code" id="A-61">
<field name="name">Importador de alimentos de consumo humano y animal</field>
<field name="code">A-61</field>
</record>
<record model="party.tax_level_code" id="A-62">
<field name="name">Importador Ocasional</field>
<field name="code">A-62</field>
</record>
<record model="party.tax_level_code" id="A-63">
<field name="name">Importador de maquinaría y sus partes Decreto 2261 de 2012</field>
<field name="code">A-63</field>
</record>
<record model="party.tax_level_code" id="A-64">
<field name="name">Beneficiario Programa de Fomento Industria Automotriz-PROFIA</field>
<field name="code">A-64</field>
</record>
<record model="party.tax_level_code" id="A-99">
<field name="name">Otro tipo de agente aduanero</field>
<field name="code">A-99</field>
</record>
<record model="party.tax_level_code" id="E-01">
<field name="name">Agencia</field>
<field name="code">E-01</field>
</record>
<record model="party.tax_level_code" id="E-02">
<field name="name">Establecimiento de comercio</field>
<field name="code">E-02</field>
</record>
<record model="party.tax_level_code" id="E-03">
<field name="name">Centro de explotación agrícola</field>
<field name="code">E-03</field>
</record>
<record model="party.tax_level_code" id="E-04">
<field name="name">Centro de explotación animal</field>
<field name="code">E-04</field>
</record>
<record model="party.tax_level_code" id="E-05">
<field name="name">Centro de explotación minera</field>
<field name="code">E-05</field>
</record>
<record model="party.tax_level_code" id="E-06">
<field name="name">Centro de explotación de transformación</field>
<field name="code">E-06</field>
</record>
<record model="party.tax_level_code" id="E-07">
<field name="name">Centro de explotación de servicios</field>
<field name="code">E-07</field>
</record>
<record model="party.tax_level_code" id="E-08">
<field name="name">Oficina</field>
<field name="code">E-08</field>
</record>
<record model="party.tax_level_code" id="E-09">
<field name="name">Sede</field>
<field name="code">E-09</field>
</record>
<record model="party.tax_level_code" id="E-10">
<field name="name">Sucursal</field>
<field name="code">E-10</field>
</record>
<record model="party.tax_level_code" id="E-11">
<field name="name">Consultorio</field>
<field name="code">E-11</field>
</record>
<record model="party.tax_level_code" id="E-12">
<field name="name">Administraciones</field>
<field name="code">E-12</field>
</record>
<record model="party.tax_level_code" id="E-13">
<field name="name">Seccionales</field>
<field name="code">E-13</field>
</record>
<record model="party.tax_level_code" id="E-14">
<field name="name">Regionales</field>
<field name="code">E-14</field>
</record>
<record model="party.tax_level_code" id="E-15">
<field name="name">Intendencias</field>
<field name="code">E-15</field>
</record>
<record model="party.tax_level_code" id="E-16">
<field name="name">Local o negocio</field>
<field name="code">E-16</field>
</record>
<record model="party.tax_level_code" id="E-17">
<field name="name">Punto de venta</field>
<field name="code">E-17</field>
</record>
<record model="party.tax_level_code" id="E-18">
<field name="name">Fábrica</field>
<field name="code">E-18</field>
</record>
<record model="party.tax_level_code" id="E-19">
<field name="name">Taller</field>
<field name="code">E-19</field>
</record>
<record model="party.tax_level_code" id="E-20">
<field name="name">Cantera</field>
<field name="code">E-20</field>
</record>
<record model="party.tax_level_code" id="E-21">
<field name="name">Pozo de Petróleo y Gas</field>
<field name="code">E-21</field>
</record>
<record model="party.tax_level_code" id="E-22">
<field name="name">Otro lug de tipo de extrac explotación de recursos naturales</field>
<field name="code">E-22</field>
</record>
<record model="party.tax_level_code" id="E-99">
<field name="name">Otro tipo de establecimiento</field>
<field name="code">E-99</field>
</record>
</data>
</tryton>

View File

@ -0,0 +1,13 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.exceptions import UserError
from trytond.model.exceptions import ValidationError
class PartyIdentifierError(ValidationError):
pass
class PostError(UserError):
pass

View File

@ -0,0 +1,91 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,subdivision_municipality:"
msgid "Municipality"
msgstr "Municipio"
msgctxt "field:party.address,subdivision_localities:"
msgid "Localities"
msgstr "Localidades"
msgctxt "field:party.tax_level_code,code:"
msgid "Code"
msgstr "Código"
msgctxt "field:party.tax_level_code,name:"
msgid "Name"
msgstr "Nombre"
msgctxt "field:party.party,tax_level_code:"
msgid "TaxLevelCode"
msgstr "Responsabilidades"
msgctxt "field:party.party,tax_regime:"
msgid "Tax Regime"
msgstr "Régimen Fiscal"
msgctxt "field:party.party,type_taxpayer:"
msgid "Type Taxpayer"
msgstr "Tipo de Contribuyente"
msgctxt "field:party.party,self_withholding:"
msgid "Self Withholding"
msgstr "Autoretenedor"
msgctxt "field:party.party,declarant:"
msgid "Declarant"
msgstr "Declarante"
msgctxt "field:party.party,main_ciiu:"
msgid "Main Activity"
msgstr "Actividad Principal"
msgctxt "field:party.party,secondary_ciiu:"
msgid "Secondary Activity"
msgstr "Actividad Secundaria"
msgctxt "field:party.party,other_ciiu:"
msgid "Other Activity"
msgstr "Otra Actividad"
msgctxt "field:party.party,type_person:"
msgid "Type Person"
msgstr "Tipo de Persona"
msgctxt "field:account.configuration,default_draft_sequence:"
msgid "Draft Sequence"
msgstr "Secuencia Borrador"
msgctxt "view:party.party:"
msgid "Economic Activity"
msgstr "Actividad Económica"
msgctxt "model:ir.message,text:msg_invalid_vat"
msgid ""
"The value of the code \"%(code)s\" is not valid"
msgstr ""
"El valor del código \"%(code)s\" no es valido"
msgctxt "model:ir.message,text:msg_invalid_vat_str"
msgid ""
"The value of the code can only be numbers"
msgstr ""
"El valor del código solo pueden ser números"
msgctxt "model:ir.message,text:msg_not_identifier"
msgid ""
"The party has to have a identifier"
msgstr ""
"El tercero debe tener un identificador"
msgctxt "model:ir.message,text:msg_stdnum_error"
msgid ""
"Is required module stdnum"
msgstr ""
"El módulo stdnum es requerido"
msgctxt "model:ir.ui.menu,name:menu_account_move_line"
msgid "Account Move Lines"
msgstr "Apuntes Contables"

View File

@ -0,0 +1,166 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="country.subdivision" id="CO-1115">
<field name="name">Antonio Nariño</field>
<field name="dane_code">1115</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1100</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1112">
<field name="name">Barrios Unidos</field>
<field name="dane_code">1112</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1102</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1107">
<field name="name">Bosa</field>
<field name="dane_code">1107</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1103</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1102">
<field name="name">Chapinero</field>
<field name="dane_code">1102</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1104</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1119">
<field name="name">Ciudad Bolívar</field>
<field name="dane_code">1119</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1105</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1110">
<field name="name">Engativá</field>
<field name="dane_code">1110</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1106</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1109">
<field name="name">Fontibón</field>
<field name="dane_code">1109</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1107</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1108">
<field name="name">Kennedy</field>
<field name="dane_code">1108</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1108</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1117">
<field name="name">La Candelaria</field>
<field name="dane_code">1117</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1109</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1114">
<field name="name">Los Mártires</field>
<field name="dane_code">1114</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1110</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1116">
<field name="name">Puente Aranda</field>
<field name="dane_code">1116</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1111</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1118">
<field name="name">Rafael Uribe Uribe</field>
<field name="dane_code">1118</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1112</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1104">
<field name="name">San Cristóbal</field>
<field name="dane_code">1104</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1113</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1103">
<field name="name">Santa Fe</field>
<field name="dane_code">1103</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1114</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1111">
<field name="name">Suba</field>
<field name="dane_code">1111</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1115</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1120">
<field name="name">Sumapaz</field>
<field name="dane_code">1120</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1116</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1113">
<field name="name">Teusaquillo</field>
<field name="dane_code">1113</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1117</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1106">
<field name="name">Tunjuelito</field>
<field name="dane_code">1106</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1118</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1101">
<field name="name">Usaquén</field>
<field name="dane_code">1101</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1119</field>
<field name="parent" ref="CO-11"/>
</record>
<record model="country.subdivision" id="CO-1105">
<field name="name">Usme</field>
<field name="dane_code">1105</field>
<field name="country" ref="50"/>
<field name="type">localities</field>
<field name="code">CO-1120</field>
<field name="parent" ref="CO-11"/>
</record>
</data>
</tryton>

View File

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data grouped="1">
<record model="ir.message" id="msg_invalid_vat">
<field name="text">The value of the code "%(code)s" is not valid</field>
</record>
<record model="ir.message" id="msg_not_identifier">
<field name="text">The party has to have a identifier</field>
</record>
<record model="ir.message" id="msg_stdnum_error">
<field name="text">Is required module stdnum</field>
</record>
<record model="ir.message" id="msg_invalid_vat_str">
<field name="text">The value of the code can only be numbers</field>
</record>
</data>
</tryton>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,419 @@
from trytond.model import fields, ModelSQL, ModelView, Unique, sequence_ordered
from trytond.pool import PoolMeta, Pool
from trytond.pyson import Eval, Not, Equal, And
from trytond.i18n import gettext
from .exceptions import PartyIdentifierError
import logging
logger = logging.getLogger(__name__)
__all__ = [
'PartyIdentifier',
'Party',
'ContactMechanism',
'Address',
'PartyTaxLevelCode'
]
TAX_CO_IDENTIFIERS = [
(None, ''),
('11', 'Registro Civil'),
('12', 'Tarjeta de Identidad'),
('13', 'Cedula de Ciudadania'),
('21', 'Tarjeta de Extranjeria'),
('22', 'Cedula de Extranjeria'),
('31', 'NIT'),
('41', 'Pasaporte'),
('42', 'Tipo de Documento Extranjero'),
('43', 'Documento de identificación extranjero'),
('50', 'NIT de otro país'),
('91', 'NUIP')
]
CO_CONTACT_MECHANISM_TYPES = [
('sms', 'SMS')
]
class Party(metaclass=PoolMeta):
"Party Colombian"
__name__ = 'party.party'
first_name = fields.Char("Primer Nombre", states={
'invisible': Not(Eval('type_person') == '2'), }
)
second_name = fields.Char("Segundo Nombre", states={
'invisible': Not(Eval('type_person') == '2'), }
)
first_surname = fields.Char("Primer Apellido", states={
'invisible': Not(Eval('type_person') == '2'), }
)
second_surname = fields.Char("Segundo Apellido", states={
'invisible': Not(Eval('type_person') == '2'), },
depends=['type_person'])
birth_date = fields.Date('Fecha de nacimiento')
tax_regime = fields.Selection([
(None, ''),
('48', 'Responsable del impuesto sobre las ventas IVA'),
('49', 'No responsable de IVA')
], 'Tax Regime')
type_taxpayer = fields.Selection([
(None, ''),
('regimen_simplificado', 'Regimen Simplificado'),
('regimen_comun', 'Regimen Comun'),
('gran_contribuyente', 'Gran Contribuyente'),
('entidad_estatal', 'Entidad Estatal'),
('domiciliado_extranjero', 'Domiciliado en Extranjero'),
], 'Type Taxpayer')
type_person = fields.Selection([
(None, ''),
('1', 'Persona Juridica'),
('2', 'Persona Natural'),
], 'Type Person')
self_withholding = fields.Boolean('Self Withholding')
declarant = fields.Boolean('Declarant')
main_ciiu = fields.Char('Main Activity', size=4)
secondary_ciiu = fields.Char('Secondary Activity', size=4)
other_ciiu = fields.Char('Other Activity', size=4)
age = fields.Function(fields.Integer('Edad'), 'on_change_with_age')
type_tax_identifier = fields.Function(
fields.Selection('get_types_identifier', 'Tipo de Identidad'),
'on_change_with_type_tax_identifier')
tax_level_code = fields.Many2Many(
'party.party_tax_level_code', 'party', 'tax_level_code',
"TaxLevelCode")
@classmethod
def __setup__(cls):
super(Party, cls).__setup__()
cls.name.required = True
@staticmethod
def default_type_person():
return '2'
@classmethod
def tax_identifier_types(cls):
return ['12', '13', '31']
@classmethod
def get_tax_level_code(cls):
pool = Pool()
TaxLevelCode = pool.get('party.tax_level_code')
return TaxLevelCode.fields_get(['code'])['code']
@fields.depends('birth_date')
def on_change_with_age(self, name=None):
if self.birth_date:
Date = Pool().get('ir.date')
today = Date.today()
age = today.year - self.birth_date.year
age -= (today.month, today.day) < (
self.birth_date.month, self.birth_date.day)
return age
@fields.depends('name', 'first_name', 'second_name', 'first_surname',
'second_surname', 'type_person')
def on_change_type_person(self):
if self.type_person == '2':
self.on_change_name()
if self.type_person == '1':
pass
@fields.depends('name', 'first_name', 'second_name', 'first_surname',
'second_surname', 'type_person')
def on_change_name(self):
self.rebuild_name()
@fields.depends('name', 'first_name', 'second_name', 'first_surname',
'second_surname', 'type_person')
def on_change_first_name(self):
self.rebuild_name()
@fields.depends('name', 'first_name', 'second_name', 'first_surname',
'second_surname', 'type_person')
def on_change_second_name(self):
self.rebuild_name()
@fields.depends('name', 'first_name', 'second_name', 'first_surname',
'second_surname', 'type_person')
def on_change_second_surname(self):
self.rebuild_name()
@fields.depends('name', 'first_name', 'second_name', 'first_surname',
'second_surname', 'type_person')
def on_change_first_surname(self):
self.rebuild_name()
def rebuild_name(self):
"""reconstruye los campos relacionados con el nombre dependiendo de
estos y del tipo de persona."""
if self.type_person == '2':
if not (self.first_name or self.second_name
or self.first_surname or self.second_surname):
if self.name:
self.first_name, self.second_name, self.first_surname, \
self.second_surname = self.split_name(self.name)
else:
return
else:
self.name = self.get_full_name()
if self.type_person == '1':
if self.name:
self.clean_split_name()
else:
self.name = self.get_full_name()
def clean_split_name(self):
self.first_name = self.second_name = self.first_surname = self.second_surname = ''
@staticmethod
def split_name(name):
"""Divide un nombre completo en una lista de 4 elementos"""
second_surname = None
first_surname = None
second_name = None
first_name = None
names = name.split(' ')
if len(names) > 0:
first_name = names[0]
if len(names) == 2:
second_surname = None
first_surname = names[1]
elif len(names) == 3:
first_surname = names[1]
second_surname = names[2]
elif len(names) >= 4:
second_name = names[1]
first_surname = names[2]
second_surname = " ".join(names[3:])
return [first_name, second_name, first_surname, second_surname]
@fields.depends('identifiers')
def on_change_with_type_tax_identifier(self, name=None):
types = self._tax_identifier_types()
if self.identifiers:
for identifier in self.identifiers:
if identifier.type in types:
return identifier.type
@fields.depends('identifiers')
def on_change_with_tax_identifier(self, name=None):
if self.identifiers:
return self.get_tax_identifier(name)
@classmethod
def _tax_identifier_types(cls):
types = super(Party, cls).tax_identifier_types()
types.extend(['31', '13'])
return types
def get_full_name(self, name=None):
if self.type_person == '2':
name_list = [self.first_name, self.second_name,
self.first_surname, self.second_surname]
return " ".join([x for x in name_list if x])
return self.name
@staticmethod
def get_types_identifier():
PartyIdentifier = Pool().get('party.identifier')
return PartyIdentifier.type.selection
def pre_validate(self):
super(Party, self).pre_validate()
if not self.identifiers:
raise PartyIdentifierError(gettext(
'account_co_co.msg_not_identifier'))
class PartyIdentifier(metaclass=PoolMeta):
"Party Identifier Colombian"
__name__ = "party.identifier"
expedition_city = fields.Many2One(
"country.subdivision", 'Ciudad de Expedicion',
help="Lugar donde fue expedido el documento de identidad",
domain=[
('parent', '!=', None)],
states={'invisible': Not(Equal(Eval('type'), '13')), }
)
rut = fields.Boolean('Rut',
states={
'invisible': And(
Not(Equal(Eval('type'), ('12'))),
Not(Equal(Eval('type'), ('13'))),
Not(Equal(Eval('type'), ('31')))),
'readonly': Equal(Eval('type'), ('31'))})
check_digit = fields.Function(
fields.Integer('DV',
help='Digito de Verificacion colombiano',
states={'invisible': ~Eval('rut', False)}),
'on_change_with_check_digit')
@classmethod
def __setup__(cls):
super(PartyIdentifier, cls).__setup__()
cls.type.selection = TAX_CO_IDENTIFIERS
cls.type.required = True
table = cls.__table__()
cls._sql_constraints += [
('UniqueIdentifier', Unique(table, table.code, table.type),
'La identificacion ya existe')
]
@fields.depends('rut', 'type')
def on_change_type(self):
if self.type == '31':
self.rut = True
@fields.depends('type', 'code')
def on_change_with_check_digit(self, name=None):
try:
import stdnum.co.nit # la version debe ser mayor a la 1.2 o 1.3
except BaseException:
raise PartyIdentifierError(gettext(
'account_co_co.msg_stdnum_error'))
if self.type and self.code:
if self.type in ('12', '13', '31') and self.code.isdigit():
return int(stdnum.co.nit.calc_check_digit(self.code))
@fields.depends('type', 'party', 'code', 'rut')
def check_code(self):
super(PartyIdentifier, self).check_code()
tax_identifiers = ['12', '13', '31']
if self.type == '31':
self.rut = True
if self.rut is not False and self.type in tax_identifiers:
# generalizar multiples paises
# puede ser por el country del party de la company actual
try:
# la version debe ser mayor a la 1.2 o 1.3
import stdnum.co.nit
except BaseException:
raise PartyIdentifierError(gettext(
'account_co_co.msg_stdnum_error'))
if self.code.isdigit() is not True:
raise PartyIdentifierError(gettext(
'account_co_co.msg_invalid_vat_str'))
if not stdnum.co.nit.is_valid(self.code + str(self.check_digit)):
if self.party and self.party.id > 0:
party = self.party.rec_name
else:
party = ''
raise PartyIdentifierError(
gettext('account_co_co.msg_invalid_vat',
code=self.code))
if self.type in tax_identifiers and not self.code.isdigit():
if self.party and self.party.id > 0:
party = self.party.rec_name
else:
party = ''
raise PartyIdentifierError(
gettext('account_co_co.msg_invalid_vat',
code=self.code))
@staticmethod
def default_rut():
return False
def get_rec_name(self, name=None):
if self.code:
return self.code
elif self.id:
return self.id
return ''
class PartyTaxLevelCode(ModelSQL, ModelView):
"Party Tax Level Code"
__name__ = 'party.party_tax_level_code'
party = fields.Many2One('party.party', 'Party', )
tax_level_code = fields.Many2One('party.tax_level_code', 'TaxLevelCode')
class ContactMechanism(sequence_ordered(), ModelSQL, ModelView):
"Contact Mechanism"
__name__ = 'party.contact_mechanism'
__metaclass__ = PoolMeta
@classmethod
def __setup__(cls):
super(ContactMechanism, cls).__setup__()
cls.type.selection.extend(CO_CONTACT_MECHANISM_TYPES)
class Address(ModelSQL, ModelView):
"Address"
__metaclass__ = PoolMeta
__name__ = 'party.address'
subdivision_municipality = fields.Many2One(
"country.subdivision",
'Municipality',
domain=[
('country', '=', Eval('country', -1)),
('parent', '=', Eval('subdivision', -1)),
('type', '=', 'municipality')
],
depends=['country', 'subdivision', 'city'],
required=True
)
subdivision_localities = fields.Many2One(
"country.subdivision",
'Localities',
domain=[
('country', '=', Eval('country', -1)),
('parent', '=', Eval('subdivision', -1)),
('type', '=', 'localities'),
],
depends=['country', 'subdivision'],
)
@fields.depends('subdivision', 'subdivision_municipality', 'country')
def on_change_country(self):
super(Address, self).on_change_country()
if (self.subdivision_municipality
and self.subdivision_municipality.parent != self.subdivision):
self.subdivision_municipality = None
self.subdivision_localities = None
@fields.depends('subdivision', 'subdivision_municipality',
'subdivision_localities')
def on_change_subdivision(self):
pool = Pool()
Subdivision = pool.get('country.subdivision')
bogota = Subdivision.search(['code', '=', 'CO-11001'])
if hasattr(super(Address, self), 'on_change_subdivision'):
super(Address, self).on_change_subdivision()
if (self.subdivision_municipality
and self.subdivision_municipality.parent != self.subdivision):
self.subdivision_municipality = None
self.subdivision_localities = None
if self.subdivision and self.subdivision.code == "CO-11":
self.subdivision_municipality = bogota[0].id
else:
self.subdivision_localities = None
if self.subdivision_localities and self.subdivision.code != "CO-11":
self.subdivision_localities = None
@fields.depends('city', 'subdivision_municipality')
def on_change_subdivision_municipality(self):
if self.subdivision_municipality:
self.city = self.subdivision_municipality.name
else:
self.city = None
self.subdivision_localities = None

View File

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="party_view_form">
<field name="model">party.party</field>
<field name="inherit" ref="party.party_view_form"/>
<field name="name">party_form</field>
</record>
<record model="ir.ui.view" id="party_view_tree">
<field name="model">party.party</field>
<field name="inherit" ref="party.party_view_tree"/>
<field name="name">party_tree</field>
</record>
<record model="ir.ui.view" id="identifier_view_form">
<field name="model">party.identifier</field>
<field name="inherit" ref="party.identifier_form"/>
<field name="name">identifier_form</field>
</record>
<record model="ir.ui.view" id="identifier_view_tree">
<field name="model">party.identifier</field>
<field name="inherit" ref="party.identifier_list"/>
<field name="name">identifier_tree</field>
</record>
</data>
</tryton>

View File

@ -0,0 +1,9 @@
from trytond.model import fields, ModelSQL, ModelView
class TaxLevelCode(ModelSQL, ModelView):
"Tax Level Code"
__name__ = 'party.tax_level_code'
code = fields.Char('Code', required=True)
name = fields.Char('Name', required=True)

View File

@ -0,0 +1,34 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.action.act_window" id="act_party_tax_level_code_form">
<field name="name">Parties Tax Level Code</field>
<field name="res_model">party.tax_level_code</field>
</record>
<record model="ir.ui.view" id="party_tax_level_code_view_tree">
<field name="model">party.tax_level_code</field>
<field name="type">tree</field>
<field name="name">party_tax_level_code_tree</field>
</record>
<record model="ir.ui.view" id="party_tax_level_code_view_form">
<field name="model">party.tax_level_code</field>
<field name="type">form</field>
<field name="name">party_tax_level_code_form</field>
</record>
<record model="ir.action.act_window.view" id="act_party_tax_level_code_form_view1">
<field name="sequence" eval="80"/>
<field name="view" ref="party_tax_level_code_view_tree"/>
<field name="act_window" ref="act_party_tax_level_code_form"/>
</record>
<record model="ir.action.act_window.view" id="act_party_tax_level_code_form_view2">
<field name="sequence" eval="90"/>
<field name="view" ref="party_tax_level_code_view_form"/>
<field name="act_window" ref="act_party_tax_level_code_form"/>
</record>
</data>
</tryton>

119
modules/account_co_co/setup.py Executable file
View File

@ -0,0 +1,119 @@
#!/usr/bin/env python3
import io
import os
import re
from configparser import ConfigParser
from setuptools import find_packages, setup
MODULE2PREFIX = {}
def read(fname):
content = io.open(
os.path.join(os.path.dirname(__file__), fname),
'r', encoding='utf-8').read()
content = re.sub(
r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content)
return content
def get_require_version(name):
require = '%s >= %s.%s, < %s.%s'
require %= (name, major_version, minor_version,
major_version, minor_version + 1)
return require
config = ConfigParser()
config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg')))
info = dict(config.items('tryton'))
for key in ('depends', 'extras_depend', 'xml'):
if key in info:
info[key] = info[key].strip().splitlines()
version = info.get('version', '0.0.1')
major_version, minor_version, _ = version.split('.', 2)
major_version = int(major_version)
minor_version = int(minor_version)
name = 'trytondo_account_co_co'
requires = []
for dep in info.get('depends', []):
if not re.match(r'(ir|res)(\W|$)', dep):
prefix = MODULE2PREFIX.get(dep, 'trytond')
requires.append(get_require_version('%s_%s' % (prefix, dep)))
requires.append(get_require_version('trytond'))
tests_require = [get_require_version('proteus')]
setup(name=name,
version=version,
description='Account for Colombia',
long_description=read('README.rst'),
author='OneCluster',
author_email='info@onecluster.org',
url='https://gitea.onecluster.org/OneTeam/trytondo-account_co_co',
keywords='account, colombia',
package_dir={'trytond.modules.account_co_co': '.'},
packages=(
['trytond.modules.account_co_co']
+ ['trytond.modules.account_co_co.%s' % p
for p in find_packages()]
),
package_data={
'trytond.modules.account_co_co': (info.get('xml', [])
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt',
'icons/*.svg', 'tests/*.rst', 'tests/*.json']),
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Plugins',
'Framework :: Tryton',
'Intended Audience :: Developers',
'Intended Audience :: Financial and Insurance Industry',
'Intended Audience :: Legal Industry',
'License :: OSI Approved :: '
'GNU General Public License v3 or later (GPLv3+)',
'Natural Language :: Bulgarian',
'Natural Language :: Catalan',
'Natural Language :: Chinese (Simplified)',
'Natural Language :: Czech',
'Natural Language :: Dutch',
'Natural Language :: English',
'Natural Language :: Finnish',
'Natural Language :: French',
'Natural Language :: German',
'Natural Language :: Hungarian',
'Natural Language :: Indonesian',
'Natural Language :: Italian',
'Natural Language :: Persian',
'Natural Language :: Polish',
'Natural Language :: Portuguese (Brazilian)',
'Natural Language :: Romanian',
'Natural Language :: Russian',
'Natural Language :: Slovenian',
'Natural Language :: Spanish',
'Natural Language :: Turkish',
'Natural Language :: Ukrainian',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Office/Business',
],
license='GPL-3',
python_requires='>=3.8',
# install_requires=requires,
extras_require={
'test': tests_require,
},
zip_safe=False,
entry_points="""
[trytond.modules]
account_co_co = trytond.modules.account_co_co
""", # noqa: E501
)

View File

@ -0,0 +1,10 @@
from trytond.pool import PoolMeta
class Subdivision(metaclass=PoolMeta):
__name__ = 'country.subdivision'
@classmethod
def __setup__(cls):
super(Subdivision, cls).__setup__()
cls.type.selection.append(('localities', 'Localities'))

View File

@ -0,0 +1,242 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="country.country" id="50">
<field name="name">Colombia</field>
<field name="code">CO</field>
<field name="code3">COL</field>
<field name="code_numeric">170</field>
</record>
<record model="country.subdivision" id="CO-91">
<field name="name">Amazonas</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-91</field>
<field name="dane_code">91</field>
</record>
<record model="country.subdivision" id="CO-05">
<field name="name">Antioquia</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-05</field>
<field name="dane_code">05</field>
</record>
<record model="country.subdivision" id="CO-81">
<field name="name">Arauca</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-81</field>
<field name="dane_code">81</field>
</record>
<record model="country.subdivision" id="CO-08">
<field name="name">Atlántico</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-08</field>
<field name="dane_code">08</field>
</record>
<record model="country.subdivision" id="CO-13">
<field name="name">Bolívar</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-13</field>
<field name="dane_code">13</field>
</record>
<record model="country.subdivision" id="CO-15">
<field name="name">Boyacá</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-15</field>
<field name="dane_code">15</field>
</record>
<record model="country.subdivision" id="CO-17">
<field name="name">Caldas</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-17</field>
<field name="dane_code">17</field>
</record>
<record model="country.subdivision" id="CO-18">
<field name="name">Caquetá</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-18</field>
<field name="dane_code">18</field>
</record>
<record model="country.subdivision" id="CO-85">
<field name="name">Casanare</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-85</field>
<field name="dane_code">85</field>
</record>
<record model="country.subdivision" id="CO-19">
<field name="name">Cauca</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-19</field>
<field name="dane_code">19</field>
</record>
<record model="country.subdivision" id="CO-20">
<field name="name">Cesar</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-20</field>
<field name="dane_code">20</field>
</record>
<record model="country.subdivision" id="CO-27">
<field name="name">Chocó</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-27</field>
<field name="dane_code">27</field>
</record>
<record model="country.subdivision" id="CO-23">
<field name="name">Córdoba</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-23</field>
<field name="dane_code">23</field>
</record>
<record model="country.subdivision" id="CO-25">
<field name="name">Cundinamarca</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-25</field>
<field name="dane_code">25</field>
</record>
<record model="country.subdivision" id="CO-11">
<field name="name">Bogotá</field>
<field name="type">capital district</field>
<field name="country" ref="50"/>
<field name="code">CO-11</field>
<field name="dane_code">11</field>
</record>
<record model="country.subdivision" id="CO-94">
<field name="name">Guainía</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-94</field>
<field name="dane_code">94</field>
</record>
<record model="country.subdivision" id="CO-95">
<field name="name">Guaviare</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-95</field>
<field name="dane_code">95</field>
</record>
<record model="country.subdivision" id="CO-41">
<field name="name">Huila</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-41</field>
<field name="dane_code">41</field>
</record>
<record model="country.subdivision" id="CO-44">
<field name="name">La Guajira</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-44</field>
<field name="dane_code">44</field>
</record>
<record model="country.subdivision" id="CO-47">
<field name="name">Magdalena</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-47</field>
<field name="dane_code">47</field>
</record>
<record model="country.subdivision" id="CO-50">
<field name="name">Meta</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-50</field>
<field name="dane_code">50</field>
</record>
<record model="country.subdivision" id="CO-52">
<field name="name">Nariño</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-52</field>
<field name="dane_code">52</field>
</record>
<record model="country.subdivision" id="CO-54">
<field name="name">Norte de Santander</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-54</field>
<field name="dane_code">54</field>
</record>
<record model="country.subdivision" id="CO-86">
<field name="name">Putumayo</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-86</field>
<field name="dane_code">86</field>
</record>
<record model="country.subdivision" id="CO-63">
<field name="name">Quindío</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-63</field>
<field name="dane_code">63</field>
</record>
<record model="country.subdivision" id="CO-66">
<field name="name">Risaralda</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-66</field>
<field name="dane_code">66</field>
</record>
<record model="country.subdivision" id="CO-88">
<field name="name">San Andrés y Providencia</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-88</field>
<field name="dane_code">88</field>
</record>
<record model="country.subdivision" id="CO-68">
<field name="name">Santander</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-68</field>
<field name="dane_code">68</field>
</record>
<record model="country.subdivision" id="CO-70">
<field name="name">Sucre</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-70</field>
<field name="dane_code">70</field>
</record>
<record model="country.subdivision" id="CO-73">
<field name="name">Tolima</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-73</field>
<field name="dane_code">73</field>
</record>
<record model="country.subdivision" id="CO-76">
<field name="name">Valle del Cauca</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-76</field>
<field name="dane_code">76</field>
</record>
<record model="country.subdivision" id="CO-97">
<field name="name">Vaupés</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-97</field>
<field name="dane_code">97</field>
</record>
<record model="country.subdivision" id="CO-99">
<field name="name">Vichada</field>
<field name="type">department</field>
<field name="country" ref="50"/>
<field name="code">CO-99</field>
<field name="dane_code">99</field>
</record>
</data>
</tryton>

View File

View File

@ -0,0 +1,9 @@
from trytond.tests.test_tryton import ModuleTestCase
class AccountCoCoTestCase(ModuleTestCase):
'Test Account Co Co module'
module = 'account_co_co'
del ModuleTestCase

View File

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="party.tax_level_code" id="O-13">
<field name="name">Gran contribuyente</field>
<field name="code">O-13</field>
</record>
<record model="party.tax_level_code" id="O-15">
<field name="name">Autorretenedor</field>
<field name="code">O-15</field>
</record>
<record model="party.tax_level_code" id="O-23">
<field name="name">Agente de retención en el impuesto sobre las ventas</field>
<field name="code">O-23</field>
</record>
<record model="party.tax_level_code" id="O-47">
<field name="name">Régimen Simple de Tributación SIMPLE</field>
<field name="code">O-47</field>
</record>
<record model="party.tax_level_code" id="O-48">
<field name="name">Impuesto sobre las ventas</field>
<field name="code">O-48</field>
</record>
<record model="party.tax_level_code" id="O-49">
<field name="name">No responsable de IVA</field>
<field name="code">O-49</field>
</record>
<record model="party.tax_level_code" id="R-99-PN">
<field name="name">No aplica - Otros</field>
<field name="code">R-99-PN</field>
</record>
</data>
</tryton>

View File

@ -0,0 +1,15 @@
[tox]
envlist = {py36,py37,py38}-{sqlite,postgresql},pypy3-{sqlite,postgresql}
[testenv]
commands = {envpython} setup.py test
deps =
{py36,py37,py38}-postgresql: psycopg2 >= 2.5
pypy3-postgresql: psycopg2cffi >= 2.5
py36-sqlite: sqlitebck
setenv =
sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://}
postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://}
sqlite: DB_NAME={env:SQLITE_NAME::memory:}
postgresql: DB_NAME={env:POSTGRESQL_NAME:test}
install_command = pip install --pre --find-links https://trydevpi.tryton.org/?mirror=github {opts} {packages}

View File

@ -0,0 +1,19 @@
[tryton]
version=6.8.0
depends:
ir
party
country
account
xml:
account.xml
party.xml
address.xml
rut.xml
message.xml
subdivisions_colombia.xml
municipalities_colombia.xml
localities_colombia.xml
address_subdivision_types_colombia.xml
tipo_responsabilidad.xml
configuration.xml

View File

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<data>
<xpath expr="//label[@name='city']" position="replace"></xpath>
<xpath expr="//field[@name='city']" position="replace"></xpath>
<xpath expr="//field[@name='subdivision']" position="after">
<label name="subdivision_municipality"/>
<field name="subdivision_municipality" widget="selection"/>
<label name="subdivision_localities"/>
<field name="subdivision_localities" widget="selection"/>
</xpath>
</data>

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="/form/field[@name='default_supplier_tax_rule']"
position="after">
<label name="default_draft_sequence"/>
<field name="default_draft_sequence"/>
</xpath>
</data>

View File

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<data>
<xpath expr="/form/field[@name='code']" position="after">
<label name="expedition_city"/>
<field name="expedition_city"/>
<label name="check_digit"/>
<field name="check_digit"/>
<label name="rut"/>
<field name="rut"/>
</xpath>
</data>

View File

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<data>
<xpath
expr="/tree/field[@name='code']"
position="after">
<field name="expedition_city"/>
<field name="check_digit"/>
</xpath>
</data>

View File

@ -0,0 +1,58 @@
<?xml version="1.0"?>
<data>
<xpath
expr="//label[@name='name']" position="before">
<label name="type_person"/>
<field name="type_person"/>
<newline/>
</xpath>
<xpath
expr="/form/group/group[@id='checkboxes']"
position="after">
<label name="first_name"/>
<field name="first_name"/>
<label name="second_name"/>
<field name="second_name"/>
<label name="first_surname"/>
<field name="first_surname"/>
<label name="second_surname"/>
<field name="second_surname"/>
<label name="type_tax_identifier"/>
<field name="type_tax_identifier"/>
<label name="tax_identifier"/>
<field name="tax_identifier"/>
<label name="birth_date"/>
<field name="birth_date"/>
<label name="age"/>
<field name="age"/>
</xpath>
<xpath
expr="/form/notebook/page[@name='identifiers']"
position="after">
<page string="Colombia" id="party_co">
<label name="tax_regime"/>
<field name="tax_regime"/>
<label name="type_taxpayer"/>
<field name="type_taxpayer"/>
<label name="self_withholding"/>
<field name="self_withholding"/>
<label name="declarant"/>
<field name="declarant"/>
<label name="tax_level_code"/>
<field name="tax_level_code"/>
<separator string="Economic Activity" id="economic_activity" colspan="4"/>
<label name="main_ciiu"/>
<field name="main_ciiu"/>
<label name="secondary_ciiu"/>
<field name="secondary_ciiu"/>
<label name="other_ciiu"/>
<field name="other_ciiu"/>
</page>
</xpath>
</data>

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<form col="6">
<label name="code"/>
<field name="code"/>
<label name="name"/>
<field name="name"/>
</form>

View File

@ -0,0 +1,5 @@
<?xml version="1.0"?>
<tree>
<field name="code"/>
<field name="name" expand="1"/>
</tree>

View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<data>
<xpath
expr="/tree/field[@name='name']"
position="after">
<field name="first_name"/>
<field name="second_name"/>
<field name="first_surname"/>
<field name="second_surname"/>
<field name="age"/>
</xpath>
<xpath
expr="/tree/field[@name='tax_identifier']"
position="before">
<field name="type_tax_identifier"/>
</xpath>
</data>

29
modules/account_co_pyme/.gitignore vendored Normal file
View File

@ -0,0 +1,29 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/build
/dist
*egg-info
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock*
/__pycache__
/app/__pycache__
/app/commons/__pycache__

View File

@ -0,0 +1,4 @@
Version 3.2.0 - 2014-04-24
* Bug fixes (see mercurial logs for details)
* Add the types account for colombia

View File

@ -0,0 +1,17 @@
Copyright (C) 2009 Juan Fernando Jaramillo
Copyright (C) 2009 Igor Támara
Copyright (C) 2010 Gustavo Andrés Angulo
Copyright (C) 2013 Oscar Andres Alvarez
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -0,0 +1,29 @@
Installing trytond_account_co
=============================
Prerequisites
-------------
* Python 2.4 or later (http://www.python.org/)
* trytond (http://www.tryton.org/)
* trytond_account (http://www.tryton.org/)
Installation
------------
Once you've downloaded and unpacked the trytond_account_co source release, enter the directory where the archive was unpacked, and run:
python setup.py install
Note that you may need administrator/root privileges for this step, as
this command will by default attempt to install module to the Python
site-packages directory on your system.
For advanced options, please refer to the easy_install and/or the distutils
documentation:
http://peak.telecommunity.com/DevCenter/EasyInstall
http://docs.python.org/inst/inst.html
To use without installation, extract the archive into ``trytond/modules`` with
the directory name account_co.

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -0,0 +1,11 @@
include INSTALL
include README
include TODO
include COPYRIGHT
include CHANGELOG
include LICENSE
include tryton.cfg
include view/*.xml
include *.xml
include *.odt
include locale/*.po

View File

@ -0,0 +1,38 @@
trytond_account_co
==================
The account_co module of the Tryton application platform.
See __tryton__.py
Installing
----------
See INSTALL
Support
-------
If you encounter any problems with Tryton, please don't hesitate to ask
questions on the Tryton bug tracker, mailing list, wiki or IRC channel:
http://bugs.tryton.org/
http://groups.tryton.org/
http://wiki.tryton.org/
http://www.presik.com/
irc://irc.freenode.net/tryton
irc://irc.freenode.net/tryton-es
License
-------
See LICENSE
Copyright
---------
See COPYRIGHT
For more information please visit the Tryton web site:
http://www.presik.com/

View File

@ -0,0 +1,15 @@
######################
Account Co Pyme Module
######################
.. to remove, see https://www.tryton.org/develop/guidelines/documentation#index.rst
.. toctree::
:maxdepth: 2
setup
usage
configuration
design
reference
releases

View File

View File

@ -0,0 +1,11 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
from . import account
def register():
Pool.register(
account.AccountTemplate,
account.Account,
module='account_co_pyme', type_='model')

View File

@ -0,0 +1,25 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import fields
from trytond.pool import PoolMeta
class AccountTemplate(metaclass=PoolMeta):
__name__ = 'account.account.template'
party_required = fields.Boolean('Party Required')
@classmethod
def __setup__(cls):
super(AccountTemplate, cls).__setup__()
cls.party_required.domain = []
class Account(metaclass=PoolMeta):
__name__ = 'account.account'
party_required = fields.Boolean('Party Required')
@classmethod
def __setup__(cls):
super(Account, cls).__setup__()
cls.party_required.domain = []

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
Account For Colombia / Plan de Cuentas para Colombia
#######################################################
Modulo que agrega el plan de cuentas para Gestion Contable,
incluye el PUC.

View File

@ -0,0 +1,108 @@
<?xml version='1.0' encoding='utf-8'?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.sequence" id="journal_cash">
<field name="name">Libro Efectivo</field>
<field name="sequence_type" ref="account.sequence_type_account_journal"/>
<field name="number_next_internal">1</field>
<field name="prefix">ASE-</field>
<field name="type">incremental</field>
<field name="padding">6</field>
<field name="active">True</field>
</record>
<record model="ir.sequence" id="journal_expenses">
<field name="name">Libro Gastos</field>
<field name="sequence_type" ref="account.sequence_type_account_journal"/>
<field name="number_next_internal">1</field>
<field name="prefix">ASG-</field>
<field name="type">incremental</field>
<field name="padding">6</field>
<field name="active">True</field>
</record>
<record model="ir.sequence" id="journal_ingress">
<field name="name">Libro Ingresos</field>
<field name="sequence_type" ref="account.sequence_type_account_journal"/>
<field name="number_next_internal">1</field>
<field name="prefix">ASI-</field>
<field name="type">incremental</field>
<field name="padding">6</field>
<field name="active">True</field>
</record>
<record model="ir.sequence" id="journal_inventory">
<field name="name">Libro Inventarios</field>
<field name="sequence_type" ref="account.sequence_type_account_journal"/>
<field name="number_next_internal">1</field>
<field name="prefix">ASX-</field>
<field name="type">incremental</field>
<field name="padding">6</field>
<field name="active">True</field>
</record>
<record model="ir.sequence" id="journal_banks">
<field name="name">Libro Bancos</field>
<field name="sequence_type" ref="account.sequence_type_account_journal"/>
<field name="number_next_internal">1</field>
<field name="prefix">ASB-</field>
<field name="type">incremental</field>
<field name="padding">6</field>
<field name="active">True</field>
</record>
<record model="ir.sequence" id="journal_cash_minor">
<field name="name">Libro Caja Menor</field>
<field name="sequence_type" ref="account.sequence_type_account_journal"/>
<field name="number_next_internal">1</field>
<field name="prefix">ASC-</field>
<field name="type">incremental</field>
<field name="padding">6</field>
<field name="active">True</field>
</record>
<record model="ir.sequence" id="journal_assets">
<field name="name">Libro Activo Fijo</field>
<field name="sequence_type" ref="account.sequence_type_account_journal"/>
<field name="number_next_internal">1</field>
<field name="prefix">ASF-</field>
<field name="type">incremental</field>
<field name="padding">6</field>
<field name="active">True</field>
</record>
<record model="ir.sequence" id="journal_situation">
<field name="name">Libro Situacion</field>
<field name="sequence_type" ref="account.sequence_type_account_journal"/>
<field name="number_next_internal">1</field>
<field name="prefix">AST-</field>
<field name="type">incremental</field>
<field name="padding">6</field>
<field name="active">True</field>
</record>
<record model="ir.sequence" id="journal_general">
<field name="name">Libro General</field>
<field name="sequence_type" ref="account.sequence_type_account_journal"/>
<field name="number_next_internal">1</field>
<field name="prefix">ASL-</field>
<field name="type">incremental</field>
<field name="padding">6</field>
<field name="active">True</field>
</record>
<record model="ir.sequence" id="account_move">
<field name="name">Asiento Contabilizado</field>
<field name="sequence_type" ref="account.sequence_type_account_journal"/>
<field name="number_next_internal">1</field>
<field name="prefix">ACO-</field>
<field name="type">incremental</field>
<field name="padding">6</field>
<field name="active">True</field>
</record>
</data>
</tryton>

View File

@ -0,0 +1,11 @@
<?xml version='1.0' encoding='utf-8'?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<!-- CREATE PAYMENT TERM -->
<record model="account.invoice.payment_term" id="payment_cash">
<field name="name">CONTADO</field>
</record>
</data>
</tryton>

View File

@ -0,0 +1,119 @@
#!/usr/bin/env python3
import io
import os
import re
from configparser import ConfigParser
from setuptools import find_packages, setup
MODULE2PREFIX = {}
def read(fname):
content = io.open(
os.path.join(os.path.dirname(__file__), fname),
'r', encoding='utf-8').read()
content = re.sub(
r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content)
return content
def get_require_version(name):
require = '%s >= %s.%s, < %s.%s'
require %= (name, major_version, minor_version,
major_version, minor_version + 1)
return require
config = ConfigParser()
config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg')))
info = dict(config.items('tryton'))
for key in ('depends', 'extras_depend', 'xml'):
if key in info:
info[key] = info[key].strip().splitlines()
version = info.get('version', '0.0.1')
major_version, minor_version, _ = version.split('.', 2)
major_version = int(major_version)
minor_version = int(minor_version)
name = 'trytondo_account_co_pyme'
requires = []
for dep in info.get('depends', []):
if not re.match(r'(ir|res)(\W|$)', dep):
prefix = MODULE2PREFIX.get(dep, 'trytond')
requires.append(get_require_version('%s_%s' % (prefix, dep)))
requires.append(get_require_version('trytond'))
tests_require = [get_require_version('proteus')]
setup(name=name,
version=version,
description='Account Chart for Colombia',
long_description=read('README.rst'),
author='OneCluster',
author_email='info@onecluster.org',
url='https://gitea.onecluster.org/OneTeam/trytondo-account_co_pyme',
keywords='Account Chart CO',
package_dir={'trytond.modules.account_co_pyme': '.'},
packages=(
['trytond.modules.account_co_pyme']
+ ['trytond.modules.account_co_pyme.%s' % p
for p in find_packages()]
),
package_data={
'trytond.modules.account_co_pyme': (info.get('xml', [])
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt',
'icons/*.svg', 'tests/*.rst', 'tests/*.json']),
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Plugins',
'Framework :: Tryton',
'Intended Audience :: Developers',
'Intended Audience :: Financial and Insurance Industry',
'Intended Audience :: Legal Industry',
'License :: OSI Approved :: '
'GNU General Public License v3 or later (GPLv3+)',
'Natural Language :: Bulgarian',
'Natural Language :: Catalan',
'Natural Language :: Chinese (Simplified)',
'Natural Language :: Czech',
'Natural Language :: Dutch',
'Natural Language :: English',
'Natural Language :: Finnish',
'Natural Language :: French',
'Natural Language :: German',
'Natural Language :: Hungarian',
'Natural Language :: Indonesian',
'Natural Language :: Italian',
'Natural Language :: Persian',
'Natural Language :: Polish',
'Natural Language :: Portuguese (Brazilian)',
'Natural Language :: Romanian',
'Natural Language :: Russian',
'Natural Language :: Slovenian',
'Natural Language :: Spanish',
'Natural Language :: Turkish',
'Natural Language :: Ukrainian',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Office/Business',
],
license='GPL-3',
python_requires='>=3.8',
# install_requires=requires,
extras_require={
'test': tests_require,
},
zip_safe=False,
entry_points="""
[trytond.modules]
account_co_pyme = trytond.modules.account_co_pyme
""", # noqa: E501
)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

View File

@ -0,0 +1,12 @@
# This file is part of the sale_payment module for Tryton.
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.tests.test_tryton import ModuleTestCase
class AccountCoPymeTestCase(ModuleTestCase):
'Test Purchase Payment module'
module = 'account_co_pyme'
del ModuleTestCase

View File

@ -0,0 +1,9 @@
[tryton]
version=6.8.0
depends:
party
account
xml:
account.xml
tax.xml
journal_sequences.xml

218
modules/account_co_reports/.gitignore vendored Normal file
View File

@ -0,0 +1,218 @@
# ---> Python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.bk
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# ---> Emacs
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/
# projectiles files
.projectile
# directory configuration
.dir-locals.el
# network security
/network-security.data
# ---> Vim
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
# ---> VirtualEnv
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
.Python
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
.venv
pip-selfcheck.json

View File

@ -0,0 +1,15 @@
Copyright (C) 2013-2019 Oscar Andres Alvarez
Copyright (C) 2020 Ángel A Bran
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -0,0 +1,5 @@
include CHANGELOG
include COPYRIGHT
include LICENSE
include README.rst
include doc/*

View File

@ -0,0 +1 @@
doc/index.rst

View File

@ -0,0 +1,50 @@
from trytond.pool import Pool
from . import auxiliary_party
from . import auxiliary_book
from . import party_book_account
from . import trial_balance
from . import trial_balance_detailed
from . import balance_sheet
from . import balance_sheet_colgaap
from . import income_statement
from . import income_statement_colgaap
from . import balance_invoice_party
def register():
Pool.register(
auxiliary_party.AuxiliaryPartyStart,
auxiliary_book.AuxiliaryBookStart,
trial_balance.PrintTrialBalanceStart,
party_book_account.PartyBookAccount,
party_book_account.PartyBookAccountContext,
trial_balance_detailed.PrintTrialBalanceDetailedStart,
balance_sheet.BalanceSheet,
balance_sheet_colgaap.PrintBalanceSheetCOLGAAPStart,
income_statement.IncomeStatement,
income_statement_colgaap.PrintIncomeStatementCOLGAAPStart,
balance_invoice_party.BalanceInvoicePartyStart,
module='account_co_reports',type_='model')
Pool.register(
auxiliary_party.PrintAuxiliaryParty,
auxiliary_book.PrintAuxiliaryBook,
trial_balance.PrintTrialBalance,
trial_balance_detailed.PrintTrialBalanceDetailed,
balance_sheet_colgaap.PrintBalanceSheetCOLGAAP,
income_statement_colgaap.PrintIncomeStatementCOLGAAP,
balance_invoice_party.PrintBalanceInvoiceParty,
module='account_co_reports',type_='wizard')
Pool.register(
auxiliary_party.AuxiliaryParty,
auxiliary_book.AuxiliaryBook,
trial_balance.TrialBalanceClassic,
balance_sheet.BalanceSheet,
balance_sheet_colgaap.BalanceSheetCOLGAAP,
trial_balance_detailed.TrialBalanceDetailed,
income_statement.IncomeStatement,
income_statement_colgaap.IncomeStatementCOLGAAP,
balance_invoice_party.BalanceInvoiceParty,
module='account_co_reports',type_='report')

View File

@ -0,0 +1,308 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.model import ModelView, fields
from trytond.wizard import Wizard, StateView, Button, StateReport
from trytond.report import Report
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
from trytond.pyson import Eval
from timeit import default_timer as timer
from decimal import Decimal
import operator
from itertools import groupby
_ZERO = Decimal('0.0')
class AuxiliaryBookStart(ModelView):
'Auxiliary Book Start'
__name__ = 'account_co_reports.print_auxiliary_book.start'
fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
required=True)
start_period = fields.Many2One('account.period', 'Start Period',
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('start_date', '<=', (Eval('end_period'), 'start_date')),
], depends=['fiscalyear', 'end_period'])
end_period = fields.Many2One('account.period', 'End Period',
domain=[
('fiscalyear', '=', Eval('fiscalyear')),
('start_date', '>=', (Eval('start_period'), 'start_date'))
],
depends=['fiscalyear', 'start_period'])
start_account = fields.Many2One('account.account', 'Start Account',
domain=[
('type', '!=', None),
('code', '!=', None),
])
end_account = fields.Many2One('account.account', 'End Account',
domain=[
('type', '!=', None),
('code', '!=', None),
])
start_code = fields.Char('Start Code Account')
end_code = fields.Char('End Code Account')
party = fields.Many2One('party.party', 'Party')
company = fields.Many2One('company.company', 'Company', required=True)
posted = fields.Boolean('Posted Move', help='Show only posted move')
empty_account = fields.Boolean('Empty Account',
help='With account without move')
@staticmethod
def default_fiscalyear():
FiscalYear = Pool().get('account.fiscalyear')
return FiscalYear.find(
Transaction().context.get('company'), exception=False)
@staticmethod
def default_company():
return Transaction().context.get('company')
@staticmethod
def default_posted():
return False
@staticmethod
def default_empty_account():
return False
@fields.depends('fiscalyear')
def on_change_fiscalyear(self):
self.start_period = None
self.end_period = None
class PrintAuxiliaryBook(Wizard):
'Print Auxiliary Book'
__name__ = 'account_co_reports.print_auxiliary_book'
start = StateView('account_co_reports.print_auxiliary_book.start',
'account_co_reports.print_auxiliary_book_start_view_form', [
Button('Cancel', 'end', 'tryton-cancel'),
Button('Print', 'print_', 'tryton-print', default=True),
]
)
print_ = StateReport('account_co_reports.auxiliary_book')
def _search_records(self):
pass
def do_print_(self, action):
if self.start.start_period:
start_period = self.start.start_period.id
else:
start_period = None
if self.start.end_period:
end_period = self.start.end_period.id
else:
end_period = None
if not self.start.party:
party = None
else:
party = self.start.party.id
start_account_id = None
if self.start.start_account:
start_account_id = self.start.start_account.id
end_account_id = None
if self.start.end_account:
end_account_id = self.start.end_account.id
data = {
'ids': [],
'company': self.start.company.id,
'fiscalyear': self.start.fiscalyear.id,
'start_period': start_period,
'end_period': end_period,
'posted': self.start.posted,
'start_account': start_account_id,
'end_account': end_account_id,
'party': party,
'empty_account': self.start.empty_account,
'fiscalyearname': self.start.fiscalyear.name
}
return action, data
def transition_print_(self):
return 'end'
class AuxiliaryBook(Report):
__name__ = 'account_co_reports.auxiliary_book'
@classmethod
def get_context(cls, records, header, data):
start = timer()
report_context = super().get_context(records, header, data)
pool = Pool()
Account = pool.get('account.account')
Period = pool.get('account.period')
Company = pool.get('company.company')
Party = pool.get('party.party')
company = Company(data['company'])
start_period_name = None
end_period_name = None
dom_accounts = [
('company', '=', data['company']),
('type', '!=', None),
]
start_code = None
if data['start_account']:
start_acc = Account(data['start_account'])
start_code = start_acc.code
dom_accounts.append(
('code', '>=', start_acc.code)
)
end_code = None
if data['end_account']:
end_acc = Account(data['end_account'])
end_code = end_acc.code
dom_accounts.append(
('code', '<=', end_acc.code)
)
accounts = Account.search(dom_accounts, order=[('code', 'ASC')])
party = None
if data['party']:
party, = Party.search([('id', '=', data['party'])])
# --------------------------------------------------------------
start_period_ids = [0]
start_periods = []
if data['start_period']:
start_period = Period(data['start_period'])
start_periods = Period.search([
('fiscalyear', '=', data['fiscalyear']),
('end_date', '<=', start_period.start_date),
])
start_period_ids += [p.id for p in start_periods]
start_period_name = start_period.name
with Transaction().set_context(
fiscalyear=data['fiscalyear'],
periods=start_period_ids,
party=data['party'],
posted=data['posted']):
start_accounts = Account.browse(accounts)
end1 = timer()
delta1 = (end1 - start)
print('Delta 1.... ', delta1)
id2start_account = {}
for account in start_accounts:
id2start_account[account.id] = account
# --------------------------------------------------------------
end_period_ids = []
if data['end_period']:
end_period = Period(data['end_period'])
end_periods = Period.search([
('fiscalyear', '=', data['fiscalyear']),
('end_date', '<=', end_period.start_date),
])
if end_period not in end_periods:
end_periods.append(end_period)
end_period_name = end_period.name
else:
end_periods = Period.search([
('fiscalyear', '=', data['fiscalyear']),
])
end_period_ids = [p.id for p in end_periods]
with Transaction().set_context(
fiscalyear=data['fiscalyear'],
periods=end_period_ids,
party=data['party'],
posted=data['posted']):
end_accounts = Account.browse(accounts)
end2 = timer()
delta2 = (end2 - end1)
print('Delta 2.... ', delta2)
id2end_account = {}
for account in end_accounts:
id2end_account[account.id] = account
if not data['empty_account']:
accounts_ids = [a.id for a in accounts]
account2lines = dict(cls.get_lines(accounts,
end_periods, data['posted'], data['party']))
accounts_ = account2lines.keys()
accounts = Account.browse(
[a for a in accounts_ids if a in accounts_]
)
end3 = timer()
delta3 = (end3 - end2)
print('Delta 3.... ', delta3)
account_id2lines = cls.lines(accounts,
list(set(end_periods).difference(set(start_periods))),
data['posted'], data['party'])
report_context['start_period_name'] = start_period_name
report_context['end_period_name'] = end_period_name
report_context['start_code'] = start_code
report_context['end_code'] = end_code
report_context['party'] = party
report_context['accounts'] = accounts
report_context['id2start_account'] = id2start_account
report_context['id2end_account'] = id2end_account
report_context['digits'] = company.currency.digits
report_context['lines'] = lambda account_id: account_id2lines[account_id]
report_context['company'] = company
end4 = timer()
delta4 = (end4 - end3)
print('Delta 4.... ', delta4)
end = timer()
delta_total = (end - start)
print('tiempo total --- :', delta_total)
return report_context
@classmethod
def get_lines(cls, accounts, periods, posted, party=None):
MoveLine = Pool().get('account.move.line')
clause = [
('account', 'in', [a.id for a in accounts]),
('period', 'in', [p.id for p in periods]),
]
if party:
clause.append(('party', '=', party))
if posted:
clause.append(('move.state', '=', 'posted'))
lines = MoveLine.search_read(clause,
order=[
('account', 'ASC'),
('date', 'ASC'),
], fields_names=[
'description', 'move.number', 'account', 'debit',
'credit', 'date', 'party.name',
'move_origin.rec_name',
])
key = operator.itemgetter('account')
lines.sort(key=key)
val = groupby(lines, key)
return val
@classmethod
def lines(cls, accounts, periods, posted, party=None):
res = dict((a.id, []) for a in accounts)
account2lines = cls.get_lines(accounts, periods, posted, party)
for account_id, lines in account2lines:
balance = _ZERO
rec_append = res[account_id].append
for line in lines:
balance += line['debit'] - line['credit']
line['balance'] = balance
rec_append(line)
return res

View File

@ -0,0 +1,23 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="ir.ui.view" id="print_auxiliary_book_start_view_form">
<field name="model">account_co_reports.print_auxiliary_book.start</field>
<field name="type">form</field>
<field name="name">print_auxiliary_book_start_form</field>
</record>
<record model="ir.action.wizard" id="wizard_print_auxiliary_book">
<field name="name">Print Auxiliary Book</field>
<field name="wiz_name">account_co_reports.print_auxiliary_book</field>
</record>
<record model="ir.action.report" id="report_auxiliary_book">
<field name="name">Auxiliary Book</field>
<field name="model"></field>
<field name="report_name">account_co_reports.auxiliary_book</field>
<field name="report">account_co_reports/report/auxiliary_book.fods</field>
<field name="template_extension">ods</field>
</record>
<menuitem parent="account.menu_reporting" action="wizard_print_auxiliary_book"
id="menu_print_auxiliary_book" icon="tryton-print"/>
</data>
</tryton>

View File

@ -0,0 +1,200 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.model import ModelView, fields
from trytond.wizard import Wizard, StateView, Button, StateReport
from trytond.report import Report
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
from trytond.pyson import Eval
from trytond.exceptions import UserError
__all__ = ['AuxiliaryPartyStart', 'PrintAuxiliaryParty', 'AuxiliaryParty']
class AuxiliaryPartyStart(ModelView):
'Auxiliary Party Start'
__name__ = 'account_co_reports.print_auxiliary_party.start'
start_period = fields.Many2One('account.period', 'Start Period',
domain=[
('start_date', '<=', (Eval('end_period'), 'start_date')),
], depends=['fiscalyear', 'end_period'])
end_period = fields.Many2One('account.period', 'End Period',
domain=[
('start_date', '>=', (Eval('start_period'), 'start_date'))
],
depends=['start_period'])
party = fields.Many2One('party.party', 'Party')
accounts = fields.Many2Many('account.account', None, None, 'Accounts',
domain=[
('type', '!=', ''),
])
company = fields.Many2One('company.company', 'Company', required=True)
posted = fields.Boolean('Posted Move', help='Show only posted move')
grouped_by_account = fields.Boolean('Grouped by Account')
empty_account = fields.Boolean('Empty Account',
help='With account without move')
@staticmethod
def default_company():
return Transaction().context.get('company')
@staticmethod
def default_posted():
return False
@staticmethod
def default_empty_account():
return False
@fields.depends('fiscalyear')
def on_change_fiscalyear(self):
self.start_period = None
self.end_period = None
class PrintAuxiliaryParty(Wizard):
'Print Auxiliary Party'
__name__ = 'account_co_reports.print_auxiliary_party'
start = StateView('account_co_reports.print_auxiliary_party.start',
'account_co_reports.print_auxiliary_party_start_view_form', [
Button('Cancel', 'end', 'tryton-cancel'),
Button('Print', 'print_', 'tryton-print', default=True),
])
print_ = StateReport('account_co_reports.auxiliary_party')
def do_print_(self, action):
if self.start.start_period:
start_period = self.start.start_period.id
else:
start_period = None
if self.start.end_period:
end_period = self.start.end_period.id
else:
end_period = None
if not self.start.party:
party = None
else:
party = self.start.party.id
if self.start.accounts:
accounts_ids = [acc.id for acc in self.start.accounts]
else:
accounts_ids = []
data = {
'company': self.start.company.id,
'start_period': start_period,
'end_period': end_period,
'posted': self.start.posted,
'party': party,
'empty_account': self.start.empty_account,
'accounts': accounts_ids,
'grouped_by_account': self.start.grouped_by_account,
}
return action, data
def transition_print_(self):
return 'end'
class AuxiliaryParty(Report):
__name__ = 'account_co_reports.auxiliary_party'
@classmethod
def get_context(cls, records, header, data):
report_context = super(AuxiliaryParty, cls).get_context(records, header, data)
pool = Pool()
Period = pool.get('account.period')
Company = pool.get('company.company')
Move = pool.get('account.move')
MoveLine = pool.get('account.move.line')
company = Company(data['company'])
dom_move = []
#Add context Transaction for company and fiscalyear
# dom_move = [('company', '=', company)]
if data.get('posted'):
dom_move.append(('state', '=', 'posted'))
start_period = None
end_period = None
if data.get('start_period'):
start_period = Period(data['start_period'])
dom_move.append(('period.start_date', '>=', start_period.start_date))
if data.get('end_period'):
end_period = Period(data['end_period'])
dom_move.append(('period.start_date', '<=', end_period.start_date))
moves = Move.search_read(dom_move,
order=[
('date', 'ASC'), ('id', 'ASC')
], fields_names=['id'],
)
moves_ids = [move['id'] for move in moves]
dom_lines = [
('move', 'in', moves_ids)
]
if data.get('accounts'):
accounts_dom = ('account', 'in', data['accounts'])
dom_lines.append(accounts_dom)
if data.get('party'):
parties_dom = ('party', '=', data['party'])
dom_lines.append(parties_dom)
lines = MoveLine.search(dom_lines, order=[('move.date', 'ASC')])
#raise UserError(str(lines))
res = {}
dict_location = {}
if lines:
for line in lines:
if not line.party:
continue
id_ = line.party.id
name = line.party.rec_name
try:
# TODO se toma el primer identificador del party
# este es totalmente incorrecto
if line.party.identifiers:
id_number = line.party.identifiers[0].code
else:
id_number = ''
except IndexError:
pass
# agrupar por unico identificador party/reference
if id_ not in res.keys():
res[id_] = {
'name': name,
'id_number': id_number,
'accounts': {},
}
#inicializar saldos sin valores de registro
if line.account not in res[id_]['accounts'].keys():
res[id_]['accounts'][line.account] = {
'lines': [],
'sum_debit': [],
'sum_credit': [],
'balance': [],
}
res[id_]['accounts'][line.account]['lines'].append(line)
res[id_]['accounts'][line.account]['sum_debit'].append(line.debit)
res[id_]['accounts'][line.account]['sum_credit'].append(line.credit)
res[id_]['accounts'][line.account]['balance'].append(line.debit - line.credit)
report_context['records'] = res.values()
report_context['grouped_by_account'] = data['grouped_by_account']
report_context['start_period'] = start_period.name if start_period else '*'
report_context['end_period'] = end_period.name if end_period else '*'
report_context['company'] = company
return report_context

View File

@ -0,0 +1,23 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="ir.action.report" id="report_auxiliary_party">
<field name="name">Account Move by Party</field>
<field name="model"></field>
<field name="report_name">account_co_reports.auxiliary_party</field>
<field name="report">account_co_reports/report/auxiliary_party.fods</field>
<field name="template_extension">ods</field>
</record>
<record model="ir.ui.view" id="print_auxiliary_party_start_view_form">
<field name="model">account_co_reports.print_auxiliary_party.start</field>
<field name="type">form</field>
<field name="name">print_auxiliary_party_start_form</field>
</record>
<record model="ir.action.wizard" id="wizard_print_auxiliary_party">
<field name="name">Print Move by Party</field>
<field name="wiz_name">account_co_reports.print_auxiliary_party</field>
</record>
<menuitem parent="account.menu_reporting" action="wizard_print_auxiliary_party"
id="menu_print_auxiliary_party" icon="tryton-print"/>
</data>
</tryton>

View File

@ -0,0 +1,142 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.model import ModelView, fields
from trytond.wizard import Wizard, StateView, Button, StateReport
from trytond.report import Report
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
from trytond.pyson import Eval
from trytond.exceptions import UserError
__all__ = ['BalancePartyStart', 'PrintBalanceParty', 'BalanceParty']
class BalanceInvoicePartyStart(ModelView):
'Balance Party Start'
__name__ = 'account_co_reports.print_balance_invoice_party.start'
party = fields.Many2One('party.party', 'Party', required=True)
start_period = fields.Many2One('account.period', 'Start Period',
domain=[
('start_date', '<=', (Eval('end_period'), 'start_date')),
], depends=['fiscalyear', 'end_period'])
end_period = fields.Many2One('account.period', 'End Period',
domain=[
('start_date', '>=', (Eval('start_period'), 'start_date'))
],
depends=['start_period'])
company = fields.Many2One('company.company', 'Company', required=True)
party_type = fields.Selection([('out', 'Customer'),
('in', 'Supplier')], "Party Type", required=True)
@staticmethod
def default_company():
return Transaction().context.get('company')
class PrintBalanceInvoiceParty(Wizard):
'Print Balance Invoice Party'
__name__ = 'account_co_reports.print_balance_invoice_party'
start = StateView('account_co_reports.print_balance_invoice_party.start',
'account_co_reports.print_balance_invoice_party_start_view_form', [
Button('Cancel', 'end', 'tryton-cancel'),
Button('Print', 'print_', 'tryton-print', default=True),
])
print_ = StateReport('account_co_reports.balance_invoice_party')
def do_print_(self, action):
party = None
party_type = None
if self.start.party:
party = self.start.party.id
if self.start.party_type:
party_type = self.start.party_type
data = {
'company': self.start.company.id,
'party': party,
'party_type': party_type
}
return action, data
def transition_print_(self):
return 'end'
class BalanceInvoiceParty(Report):
__name__ = 'account_co_reports.balance_invoice_party'
@classmethod
def get_context(cls, records, header, data):
report_context = super(BalanceInvoiceParty, cls).get_context(records, header, data)
pool = Pool()
Company = pool.get('company.company')
Period = pool.get('account.period')
Invoice = pool.get('account.invoice')
Party = pool.get('party.party')
start_period = None
end_period = None
party = None
company = Company(data['company'])
dom_invoice = [('state', 'in', ["posted", "paid"])]
if data.get('party'):
party = data['party']
dom_invoice.append(('party', '=', party))
if data.get('party_type') == 'in':
dom_invoice.append(('type', '=', "in"))
elif data.get('party_type') == 'out':
dom_invoice.append(('type', '=', "out"))
else:
dom_invoice.append(('type', 'in', ["out", "in"]))
party_type = data.get('party_type')
if data.get('start_period'):
start_period = Period(data['start_period'])
dom_invoice.append(('invoice_date', '>=', start_period.start_date))
if data.get('end_period'):
end_period = Period(data['end_period'])
dom_invoice.append(('invoice_date', '<=', end_period.start_date))
invoices = Invoice.search(dom_invoice,
order=[('invoice_date', 'DESC'),
('id', 'DESC')],)
res = {}
dict_location = {}
id_ = party
party_ = Party.search(['id', '=', party])[0]
name = party_.rec_name
try:
if party_.identifiers:
id_number = party_.identifiers[0].code
else:
id_number = ''
except IndexError:
pass
res[id_] = {'name': name,
'id_number': id_number,
'party': party_
}
if invoices:
res[id_]['invoices'] = invoices
else:
if party_type == 'in':
raise UserError(str("Este Tercero no Cuenta Con Facturas de Proveedor."))
else:
raise UserError(str("Este Tercero no Cuenta Con Facturas de Cliente."))
report_context['records'] = res.values()
report_context['start_period'] = start_period.name if start_period else '*'
report_context['end_period'] = end_period.name if end_period else '*'
report_context['company'] = company
report_context['party_type'] = party_type
return report_context

View File

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="ir.action.report" id="report_balance_invoice_party">
<field name="name">Balance Invoice by Party</field>
<field name="model"></field>
<field name="report_name">account_co_reports.balance_invoice_party</field>
<field name="report">account_co_reports/report/balance_invoice_party.fods</field>
<field name="template_extension">ods</field>
</record>
<record model="ir.ui.view" id="print_balance_invoice_party_start_view_form">
<field name="model">account_co_reports.print_balance_invoice_party.start</field>
<field name="type">form</field>
<field name="name">print_balance_invoice_party_start_form</field>
</record>
<record model="ir.action.wizard" id="wizard_print_balance_invoice_party">
<field name="name">Print Balance Invoice by Party</field>
<field name="wiz_name">account_co_reports.print_balance_invoice_party</field>
</record>
<menuitem
parent="account.menu_reporting"
action="wizard_print_balance_invoice_party"
id="menu_print_balance_invoice_party"
icon="tryton-print"/>
</data>
</tryton>

View File

@ -0,0 +1,57 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, fields
from trytond.report import Report
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
class Account(metaclass=PoolMeta):
'Balance Sheet Context'
__name__ = 'account.balance_sheet.context'
utility_temp = fields.Boolean('Utility Temp', help='Permited see the utility without have any account move')
class BalanceSheet(Report):
'Balance Sheet Report'
__name__ = 'account.balance_sheet'
@classmethod
def get_context(cls, records, header, data):
report_context = super(BalanceSheet, cls).get_context(records, header, data)
Company = Pool().get('company.company')
report_context['company'] = Company(Transaction().context.get('company'))
report_context['date'] = Transaction().context.get('date')
report_context['comparison'] = Transaction().context.get('comparison')
report_context['date_cmp'] = Transaction().context.get('date_cmp')
value_accounts = report_context['records']
account_child_list = []
utility = {}
value_comp = 0
for account in value_accounts:
if account.amount != 0:
for child in account.childs:
if child.name == 'PATRIMONIO NETO Y PASIVOS':
child.amount = child.amount + account.amount
if child.amount_cmp and account.amount_cmp:
child.amount_cmp = child.amount_cmp + account.amount_cmp
for child1 in child.childs:
if child1.name == 'PATRIMONIO NETO':
child1.amount = child1.amount + account.amount
if child1.amount_cmp and account.amount_cmp:
child1.amount_cmp = child1.amount_cmp + account.amount_cmp
child1.childs[0].amount = child1.childs[0].amount + account.amount
if child1.childs[0].amount_cmp and account.amount_cmp:
child1.childs[0].amount_cmp = child1.childs[0].amount_cmp + account.amount_cmp
account_child_list = [child for child in child1.childs[0].childs]
if account.amount_cmp:
value_comp = account.amount_cmp
utility = {
'amount': account.amount,
'amount_cmp': value_comp,
'name': 'UTILIDAD / PERDIDA ESTIMADA DEL PERIODO',
'childs': None,
}
account_child_list.append(utility)
child1.childs[0].childs = account_child_list
return report_context

View File

@ -0,0 +1,25 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="ir.ui.view" id="balance_sheet_context_view_form_2">
<field name="model">account.balance_sheet.col.context</field>
<field name="inherit" ref="account.balance_sheet_context_view_form"/>
<field name="name">balance_sheet_context_col_form</field>
</record>
<!-- Balance Sheet -->
<record model="ir.action.report" id="report_balance_sheet">
<field name="name">Balance Sheet</field>
<field name="model">account.account.type</field>
<field name="report_name">account.balance_sheet</field>
<field name="report">account_co_reports/report/balance_sheet.fods</field>
<field name="template_extension">ods</field>
</record>
<record model="ir.action.keyword" id="report_balance_sheet_keyword">
<field name="keyword">form_print</field>
<field name="model">account.account.type,-1</field>
<field name="action" ref="report_balance_sheet"/>
</record>
</data>
</tryton>

View File

@ -0,0 +1,215 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
import operator
from trytond.model import ModelView, ModelSQL, fields
from trytond.wizard import Wizard, StateView, Button, StateReport
from trytond.transaction import Transaction
from trytond.report import Report
from trytond.pyson import Eval, PYSONEncoder
from trytond.pool import Pool
def compute_report(data, domain, codes, statement='income'):
pool = Pool()
Fiscalyear = pool.get('account.fiscalyear')
Period = pool.get('account.period')
Account = pool.get('account.account')
period = None
amount_profit = 0
res = {}
ctx = {
'posted': data['posted'],
}
if data.get('period'):
period = Period(data['period'])
periods = Period.search([
('start_date', '<=', period.start_date),
])
periods_ids = [period.id]
periods_ids.extend([p.id for p in periods])
ctx['periods'] = periods_ids
elif data.get('periods'):
ctx['periods'] = data.get('periods')
else:
ctx['fiscalyear'] = data['fiscalyear']
if data.get('detailed'):
len_code = 6
else:
len_code = 5
domain.append(
('type', '=', ''),
)
view_accounts = Account.search(domain)
reduce_ids = [a.id for a in view_accounts
if len(a.code) <= len_code]
with Transaction().set_context(ctx):
accounts = Account.search([
('id', 'in', reduce_ids),
], order=[('code', 'ASC')]
)
if data.get('account_profit'):
account_profit = Account(data['account_profit'])
profit_accounts = Account.search(['OR',
('code', 'in', ['4', '5', '6', '7']),
])
amount_profit = sum([a.balance for a in profit_accounts])
records = []
for a in accounts:
if (len(a.code) == 1) or not(a.balance == 0 and len(a.code) >= (len_code - 1)):
if statement == 'income':
a.balance = a.balance * (-1)
records.append(a)
res['records'] = records
main_accounts = Account.search(['OR',
('code', 'in', codes),
])
# Crea una cuenta virtual temporal con la utilidad para ponerla en el Balance
if data.get('account_profit'):
tree_account_assets = []
def _add_parents(acc):
if acc in res['records']:
acc = res['records'].pop(res['records'].index(acc))
acc.balance = acc.balance + amount_profit
tree_account_assets.append(acc)
if acc.parent and acc.parent.code:
_add_parents(acc.parent)
# Split records for keep order
_add_parents(account_profit)
res['records'].extend(tree_account_assets)
new_records = [(rec.code, rec) for rec in res['records']]
def getKey(item):
return item[1]
new_records.sort(key=operator.itemgetter(0))
res['records'] = [nr[1] for nr in new_records]
global_result = sum([a.balance for a in main_accounts]) + amount_profit
if statement == 'income':
global_result = global_result * (-1)
res['global_result'] = global_result
fiscalyear = Fiscalyear(data['fiscalyear'])
if period:
res['start_date'] = period.start_date
res['end_date'] = period.end_date
else:
periods_dates = []
for p in fiscalyear.periods:
periods_dates.extend([p.start_date, p.end_date])
res['start_date'] = min(periods_dates)
res['end_date'] = max(periods_dates)
res['period'] = period
res['fiscalyear'] = fiscalyear
return res
class PrintBalanceSheetCOLGAAPStart(ModelView):
'Print Balance Sheet COLGAAP Start'
__name__ = 'account_co_reports.print_balance_sheet_colgaap.start'
fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
help='Leave empty for all open fiscal year', required=True)
posted = fields.Boolean('Posted Moves', help='Show posted moves only')
period = fields.Many2One('account.period', 'Period', domain=[
('fiscalyear', '=', Eval('fiscalyear')),
], depends=['fiscalyear'])
company = fields.Many2One('company.company', 'Company', required=True)
detailed = fields.Boolean('Detailed')
account_profit = fields.Many2One('account.account',
'Account Profit', domain=[
('type', '!=', ''),
('code', 'like', '36%'),
])
@staticmethod
def default_posted():
return False
@staticmethod
def default_company():
return Transaction().context.get('company')
class PrintBalanceSheetCOLGAAP(Wizard):
'Print Balance Sheet COLGAAP'
__name__ = 'account_co_reports.print_balance_sheet_colgaap'
start = StateView('account_co_reports.print_balance_sheet_colgaap.start',
'account_co_reports.print_balance_sheet_colgaap_start_view_form', [
Button('Cancel', 'end', 'tryton-cancel'),
Button('Print', 'print_', 'tryton-print', default=True),
])
print_ = StateReport('account_co_reports.balance_sheet_colgaap')
def do_print_(self, action):
Period = Pool().get('account.period')
account_profit_id = None
ctx = {
'fiscalyear': (self.start.fiscalyear.id
if self.start.fiscalyear else None),
'posted': self.start.posted,
'cumulate': True,
}
if self.start.account_profit:
account_profit_id = self.start.account_profit.id
if self.start.period:
periods = Period.search([
('end_date', '<', self.start.period.start_date),
])
periods_ids = [self.start.period.id]
periods_ids.extend([p.id for p in periods])
ctx['periods'] = periods_ids
action['pyson_context'] = PYSONEncoder().encode(ctx)
period_id = None
if self.start.period:
period_id = self.start.period.id
data = {
'fiscalyear': self.start.fiscalyear.id,
'period': period_id,
'company': self.start.company.id,
'detailed': self.start.detailed,
'posted': self.start.posted,
'account_profit': account_profit_id,
}
return action, data
def transition_print_(self):
return 'end'
class BalanceSheetCOLGAAP(Report):
__name__ = 'account_co_reports.balance_sheet_colgaap'
@classmethod
def get_context(cls, records, header, data):
report_context = super(BalanceSheetCOLGAAP, cls).get_context(records, header, data)
pool = Pool()
Company = pool.get('company.company')
company = Company(data['company'])
codes = ['2', '3']
domain = [
('code', '<', '4'),
]
res = compute_report(data, domain, codes, statement='balance')
report_context.update(res)
report_context['detailed'] = data['detailed']
report_context['company'] = company
report_context['fiscalyear2'] = None
return report_context

View File

@ -0,0 +1,28 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<!-- Print Balance Sheet COLGAAP -->
<record model="ir.action.report" id="report_balance_sheet_colgaap">
<field name="name">Balance Sheet COLGAAP</field>
<field name="model"></field>
<field name="report_name">account_co_reports.balance_sheet_colgaap</field>
<field name="report">account_co_reports/report/balance_sheet_colgaap.fods</field>
<field name="template_extension">ods</field>
</record>
<record model="ir.ui.view" id="print_balance_sheet_colgaap_start_view_form">
<field name="model">account_co_reports.print_balance_sheet_colgaap.start</field>
<field name="type">form</field>
<field name="name">print_balance_sheet_colgaap_start_form</field>
</record>
<record model="ir.action.wizard" id="wizard_print_balance_sheet_colgaap">
<field name="name">Balance Sheet COLGAAP</field>
<field name="wiz_name">account_co_reports.print_balance_sheet_colgaap</field>
</record>
<menuitem parent="account.menu_reporting" action="wizard_print_balance_sheet_colgaap"
id="menu_print_balance_sheet_colgaap" icon="tryton-print"/>
</data>
</tryton>

View File

@ -0,0 +1,30 @@
================================
Reportes Contables para Colombia
================================
Basado en: `trytonpsk-account_col: <https://bitbucket.org/presik/trytonpsk-account_col>`_
Diferencias con la versión original:
1. Se actualiza a la versón 5.4 y superiores
2. Se cambian los archivos de extensión .ods a .fods
3. Cada informe queda separado en un archivo .py y .fodt, con la intención de integrarlos posteriormente en categorías de informes
4. No necesita ninguna dependencia por fuera de los módulos oficiales
5. No hay cambios en los módulos oficiales como party, account u otro
6. Se agrega reporte Party Book Account, el cual no incluye impresión
7. Se hacen parches y cambios menores a los archivos .ods convertidos en .fods
8. No se incluyen los informes certificado de retención, impuestos por factura e impuestos contabilizados, no están incluidos
Aclaraciones:
1. Los informes Balance General y Perdidas y Ganancias, depende de la estructura del PUC para Colombia en el módulo account_co_pymes, como se describen a continuación:
1 => Activo
2 => Pasivo
3 => Patrimonio
4 => Ingresos
5 => Gastos
6 y 7 => Costos

Some files were not shown because too many files have changed in this diff Show More