diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9c46d92
--- /dev/null
+++ b/.gitignore
@@ -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
+
diff --git a/__pycache__/__init__.cpython-39.opt-1.pyc b/__pycache__/__init__.cpython-39.opt-1.pyc
deleted file mode 100644
index 0d2fb63..0000000
Binary files a/__pycache__/__init__.cpython-39.opt-1.pyc and /dev/null differ
diff --git a/__pycache__/recepcion.cpython-39.opt-1.pyc b/__pycache__/recepcion.cpython-39.opt-1.pyc
deleted file mode 100644
index 6d20a05..0000000
Binary files a/__pycache__/recepcion.cpython-39.opt-1.pyc and /dev/null differ
diff --git a/recepcion.py b/recepcion.py
index 6a5bd7e..b05f7da 100644
--- a/recepcion.py
+++ b/recepcion.py
@@ -3,7 +3,7 @@
from trytond.model import (ModelSQL, ModelView, fields, Workflow)
from datetime import datetime
-class Recepcion(ModelView, ModelSQL):
+class Recepcion(ModelView, ModelSQL, Workflow):
"Recepcion"
__name__= "taller.recepcion"
@@ -12,7 +12,7 @@ class Recepcion(ModelView, ModelSQL):
hora_entrada = fields.DateTime('Hora Entrada')
referencia = fields.Char("Referencia")
descripcion = fields.Text("Descripcion")
- estado = fields.Selection([("borrador","Borrador"),("registrado", "Registrado")],"Estado")
+ state = fields.Selection([("borrador","Borrador"),("registrado", "Registrado")],"Estado")
@classmethod
@@ -20,20 +20,28 @@ class Recepcion(ModelView, ModelSQL):
return datetime.now()
@classmethod
- def default_estado(cls):
+ def default_state(cls):
return "borrador"
@classmethod #constructor clase
def __setup__(cls):
super(Recepcion, cls).__setup__()
cls._transitions=({("borrador","registrado"),("registrado","borrador") })
- cls._buttons.update({"registrado":{}})
-
+ cls._buttons.update({"registrado":{}, "borrador":{}})
+
+
@classmethod
@ModelView.button
@Workflow.transition("registrado")
def registrado(cls, records):
pass
-
+
+
+ @classmethod
+ @ModelView.button
+ @Workflow.transition("borrador")
+ def borrador(cls, records):
+ pass
+
diff --git a/recepcion.xml b/recepcion.xml
index 8ab22ca..0ff66f1 100644
--- a/recepcion.xml
+++ b/recepcion.xml
@@ -13,6 +13,12 @@ this repository contains the full copyright notices and license terms. -->
Registrado
+
+ borrador
+ Borrador
+
+
+
diff --git a/view/recepcion_form.xml b/view/recepcion_form.xml
index ea419f0..24f218a 100644
--- a/view/recepcion_form.xml
+++ b/view/recepcion_form.xml
@@ -15,9 +15,11 @@ this repository contains the full copyright notices and license terms. -->
-
-
+
+
+
+