creamos boton nuevo para cambiar estado, aun no aparecen los nombres
This commit is contained in:
parent
92147163ad
commit
926a34e124
218
.gitignore
vendored
Normal file
218
.gitignore
vendored
Normal 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
|
||||||
|
|
Binary file not shown.
Binary file not shown.
16
recepcion.py
16
recepcion.py
@ -3,7 +3,7 @@
|
|||||||
from trytond.model import (ModelSQL, ModelView, fields, Workflow)
|
from trytond.model import (ModelSQL, ModelView, fields, Workflow)
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
class Recepcion(ModelView, ModelSQL):
|
class Recepcion(ModelView, ModelSQL, Workflow):
|
||||||
"Recepcion"
|
"Recepcion"
|
||||||
__name__= "taller.recepcion"
|
__name__= "taller.recepcion"
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ class Recepcion(ModelView, ModelSQL):
|
|||||||
hora_entrada = fields.DateTime('Hora Entrada')
|
hora_entrada = fields.DateTime('Hora Entrada')
|
||||||
referencia = fields.Char("Referencia")
|
referencia = fields.Char("Referencia")
|
||||||
descripcion = fields.Text("Descripcion")
|
descripcion = fields.Text("Descripcion")
|
||||||
estado = fields.Selection([("borrador","Borrador"),("registrado", "Registrado")],"Estado")
|
state = fields.Selection([("borrador","Borrador"),("registrado", "Registrado")],"Estado")
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -20,14 +20,15 @@ class Recepcion(ModelView, ModelSQL):
|
|||||||
return datetime.now()
|
return datetime.now()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def default_estado(cls):
|
def default_state(cls):
|
||||||
return "borrador"
|
return "borrador"
|
||||||
|
|
||||||
@classmethod #constructor clase
|
@classmethod #constructor clase
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
super(Recepcion, cls).__setup__()
|
super(Recepcion, cls).__setup__()
|
||||||
cls._transitions=({("borrador","registrado"),("registrado","borrador") })
|
cls._transitions=({("borrador","registrado"),("registrado","borrador") })
|
||||||
cls._buttons.update({"registrado":{}})
|
cls._buttons.update({"registrado":{}, "borrador":{}})
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ModelView.button
|
@ModelView.button
|
||||||
@ -36,4 +37,11 @@ class Recepcion(ModelView, ModelSQL):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
@ModelView.button
|
||||||
|
@Workflow.transition("borrador")
|
||||||
|
def borrador(cls, records):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,6 +13,12 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<field name="string">Registrado</field>
|
<field name="string">Registrado</field>
|
||||||
<field name="model" search="[('model', '=', 'taller.recepcion')]"/>
|
<field name="model" search="[('model', '=', 'taller.recepcion')]"/>
|
||||||
</record>
|
</record>
|
||||||
|
<record model="ir.model.button" id="borrador_recepcion_button">
|
||||||
|
<field name="name">borrador</field>
|
||||||
|
<field name="string">Borrador</field>
|
||||||
|
<field name="model" search="[('model', '=', 'taller.recepcion')]"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</tryton>
|
</tryton>
|
||||||
|
|
||||||
|
@ -15,9 +15,11 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<newline />
|
<newline />
|
||||||
<label name="descripcion"/>
|
<label name="descripcion"/>
|
||||||
<field name="descripcion"/>
|
<field name="descripcion"/>
|
||||||
<label name="estado"/>
|
<label name="state"/>
|
||||||
<field name="estado"/>
|
<field name="state"/>
|
||||||
<button name="registrado"/>
|
<button name="registrado"/>
|
||||||
|
<button name="borrador"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user