Compare commits

..

2 Commits

Author SHA1 Message Date
root
926a34e124 creamos boton nuevo para cambiar estado, aun no aparecen los nombres 2023-08-12 16:26:08 +00:00
root
92147163ad add button registrado 2023-07-28 07:54:31 +00:00
6 changed files with 260 additions and 7 deletions

218
.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

@@ -1,9 +1,9 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms. # this repository contains the full copyright notices and license terms.
from trytond.model import (ModelSQL, ModelView, fields) 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,16 +12,36 @@ 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
def default_hora_entrada(cls): def default_hora_entrada(cls):
return datetime.now() return datetime.now()
@classmethod @classmethod
def default_estado(cls): def default_state(cls):
return "borrador" return "borrador"
@classmethod #constructor clase
def __setup__(cls):
super(Recepcion, cls).__setup__()
cls._transitions=({("borrador","registrado"),("registrado","borrador") })
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

View File

@@ -7,7 +7,18 @@ this repository contains the full copyright notices and license terms. -->
<field name="model">taller.recepcion</field> <field name="model">taller.recepcion</field>
<field name="type">form</field> <field name="type">form</field>
<field name="name">recepcion_form</field> <field name="name">recepcion_form</field>
</record>
<record model="ir.model.button" id="registrado_recepcion_button">
<field name="name">registrado</field>
<field name="string">Registrado</field>
<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>

View File

@@ -15,7 +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="borrador"/>
</form> </form>