From 8238855f1af1bb937231156c2f377873ae22506d Mon Sep 17 00:00:00 2001 From: stark Date: Mon, 14 Aug 2023 18:11:03 -0500 Subject: [PATCH] ultimos cambios --- __pycache__/recepcion.cpython-39.opt-1.pyc | Bin 1159 -> 1790 bytes recepcion.py | 29 ++++++++++++++++++--- recepcion.xml | 12 ++++++++- view/recepcion_form.xml | 7 ++--- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/__pycache__/recepcion.cpython-39.opt-1.pyc b/__pycache__/recepcion.cpython-39.opt-1.pyc index 6351248763cbfd31f379e22b4866c8faad7d9ea6..f1192a08816971e2635ae4ddb79433eec3547f69 100644 GIT binary patch literal 1790 zcmah}&2Aev5GJXWwEA=8UpWbi`jA5fv=Yz)1quX3QK#*pt&7G+3-Gd7FGuz|`=gQ+ zTnWC}KwhE;>*$y0YXso6r@lZBJ#~hXEhi38E=Ybm^0IrYb79Vk!U*0)oq`tf}fD z>(~Cq6IefRjUP(|*)J)ayU@eKpMP+*Q3{zdF8sCBuSQvU-sdhK;tR0X>k;9!~M7wl48i#aYT zuEeRhU{U3QongsRmLiS*5OYq1!o*Y#`a(DGJ53ZtOp`bCYp!Z0W6-*eCfA4}19mcw zBG-;Ew!)+qlZj-CjwjXy@zuylhMh~+xiL+sr9uLP; zds-Hs4ZavEyzD3AIC&MHfEijn#naR;+s>uh~Z(VJyT-}o90TC!Ff3FaMW!HR;ck_O*u#_oR zDav!*Mf8q4x2<3lPcj>gh`G^{ug`GjA^bid&0qR`QFLxk zMxtBz=$`l9L+^f1|0xnMD&icFn9V3!u*Q=#`fUU!|Q^oO*7#Gt|e=0!M z?Ly!(TuQri!TxEiC2H_i%`SX_!5rZ)Qg+_Tjth?9cPm?JrD@kVgbWf=2C9cH;aXk- zIUw7W=dGqPx!OWCn#AjxD?zOUsGs1HeoE_|rH~THGQ5P(pC2}8i>D@uluB$q#v$YZ zK5cxO{^?c(U#kkVg?tUMp98_0h`qcI`gPY?DsO-}gv>{&>9^u@=Hv7n^84?F;NzeW ST=;yE{V)B`h%&v)+u}b|B(@>| delta 488 zcmY*WJ4*vW5T4oH95Kn|rJ{wl!dZxwjUsk78i=CE3CfY#VBpS^+k}9Pg#qhujraqE zU}tNUpJ02fm48Bz07!wLGP53GiWqzf#~}kIif`5DIm-9Z|FMJsGj>xYVgQrI>Hz9(@n7?GDy$V+KPuQ zPbBuK&oU*WQ*y$TEtrVrrIY(=Gh7)*(?qL>Du-sO)3W8ZQCE8-ia&SgFT diff --git a/recepcion.py b/recepcion.py index 32edcf4..639a242 100644 --- a/recepcion.py +++ b/recepcion.py @@ -1,9 +1,9 @@ # 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.model import (ModelView, ModelSQL, fields,Workflow) from datetime import datetime -class Recepcion(ModelView,ModelSQL): +class Recepcion(ModelView,ModelSQL,Workflow): "recepcion" __name__="taller.recepcion" tercero =fields.Many2One("party.party","Tercero" ) @@ -11,11 +11,32 @@ class Recepcion(ModelView,ModelSQL): referencia=fields.Char("Referencia") fecha_entrada=fields.DateTime("Fecha y hora de entrada") descripcion=fields.Text("Descripcion") - estado= fields.Selection([("borrador","Borrador"),("registrado","Registrado")],"Estado") + state= fields.Selection([("borrador","Borrador"),("registrado","Registrado")],"Estado") + + + @classmethod + 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 + + @classmethod def default_fecha_entrada(cls): return datetime.now() @classmethod - def default_estado(cls): + def default_state(cls): return "borrador" diff --git a/recepcion.xml b/recepcion.xml index 5fd43aa..e93d328 100644 --- a/recepcion.xml +++ b/recepcion.xml @@ -8,5 +8,15 @@ this repository contains the full copyright notices and license terms. --> form recepcion_form - + + registrado + Registrado + + + + borrador + Borrador + + + diff --git a/view/recepcion_form.xml b/view/recepcion_form.xml index bef5bf0..cb4ae32 100644 --- a/view/recepcion_form.xml +++ b/view/recepcion_form.xml @@ -15,8 +15,9 @@ this repository contains the full copyright notices and license terms. -->