From 92147163ad5ffb9b2b882378095194fa920d177e Mon Sep 17 00:00:00 2001 From: root Date: Fri, 28 Jul 2023 07:54:31 +0000 Subject: [PATCH] add button registrado --- __pycache__/recepcion.cpython-39.opt-1.pyc | Bin 1146 -> 1629 bytes recepcion.py | 14 +++++++++++++- recepcion.xml | 5 +++++ view/recepcion_form.xml | 2 ++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/__pycache__/recepcion.cpython-39.opt-1.pyc b/__pycache__/recepcion.cpython-39.opt-1.pyc index 8d1f519504dcfda51d753aa7f10e3865702a7abe..6d20a0500018e9888d601c5ff739eca5f61da9bf 100644 GIT binary patch delta 816 zcmYjPJ!>055Z&3^lg{FFmaPvvB7zi#SP)#MNE?DX6Otlu&E)=59*^IwFaj>jC3hrH2 z{O-~{PpV!xj?+MyG?Ymz1M6rS0hVr!a)EB4n`anOmcoS1_>!*}>H(5}py2z$bXX6rkd|ao<&|4}F82WYTSC z$JY00jX?J((7c)i&PyAbnqEp?xmTb7&Z}Fpk&5G6!bR@`0w}1Hj>Os=VQ@fz;4Zi* n0IizEp|W*v*XCGuppgEoTh5+}Zj-J*;Itu@y%#NU2rmB*$rGjF delta 346 zcmY*Uu}Z{15Z#&C#F$IM9V&=;oy}TUS{*8gSO`I|axEk{xhgSSa)%$FKM)qdU%1|0 z#ln9$@B{n>v2ZuViMz~W-_CoFna}7uNU}H%g*~H>SH7e+**@O4j0Hm>O3+ZE#*#FF z`@=$(QcDo0f{EpWV3}hM_fmW8T?plWxhO^LWY|6pLutv8t)^~YCO-GAVqnJb2-^I> z$(DjtVeMJLf^Mt3IV|X=Xy&5snJb$*FmHIiw_@9M&%x^Q)zQfL63)ljte9Ts%{1d` z!yM8MrE1N*%jdJ$8Iu35rM32L!&S3sApi*yBZwgEZXXdsLg-Yf@{Q-K-Ol?5-2lO; Qtaw)B2jrsM!s`&>FGD^*H~;_u diff --git a/recepcion.py b/recepcion.py index 65cc963..6a5bd7e 100644 --- a/recepcion.py +++ b/recepcion.py @@ -1,6 +1,6 @@ # 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 (ModelSQL, ModelView, fields) +from trytond.model import (ModelSQL, ModelView, fields, Workflow) from datetime import datetime class Recepcion(ModelView, ModelSQL): @@ -14,6 +14,7 @@ class Recepcion(ModelView, ModelSQL): descripcion = fields.Text("Descripcion") estado = fields.Selection([("borrador","Borrador"),("registrado", "Registrado")],"Estado") + @classmethod def default_hora_entrada(cls): return datetime.now() @@ -22,6 +23,17 @@ class Recepcion(ModelView, ModelSQL): def default_estado(cls): return "borrador" + @classmethod #constructor clase + def __setup__(cls): + super(Recepcion, cls).__setup__() + cls._transitions=({("borrador","registrado"),("registrado","borrador") }) + cls._buttons.update({"registrado":{}}) + + @classmethod + @ModelView.button + @Workflow.transition("registrado") + def registrado(cls, records): + pass diff --git a/recepcion.xml b/recepcion.xml index 9cf5e95..8ab22ca 100644 --- a/recepcion.xml +++ b/recepcion.xml @@ -7,6 +7,11 @@ this repository contains the full copyright notices and license terms. --> taller.recepcion form recepcion_form + + + registrado + Registrado + diff --git a/view/recepcion_form.xml b/view/recepcion_form.xml index b2a6693..ea419f0 100644 --- a/view/recepcion_form.xml +++ b/view/recepcion_form.xml @@ -17,5 +17,7 @@ this repository contains the full copyright notices and license terms. -->