ultimos cambios
This commit is contained in:
parent
434e702e34
commit
8238855f1a
Binary file not shown.
29
recepcion.py
29
recepcion.py
@ -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 (ModelView, ModelSQL, fields)
|
from trytond.model import (ModelView, ModelSQL, 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"
|
||||||
tercero =fields.Many2One("party.party","Tercero" )
|
tercero =fields.Many2One("party.party","Tercero" )
|
||||||
@ -11,11 +11,32 @@ class Recepcion(ModelView,ModelSQL):
|
|||||||
referencia=fields.Char("Referencia")
|
referencia=fields.Char("Referencia")
|
||||||
fecha_entrada=fields.DateTime("Fecha y hora de entrada")
|
fecha_entrada=fields.DateTime("Fecha y hora de entrada")
|
||||||
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
|
||||||
|
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
|
@classmethod
|
||||||
def default_fecha_entrada(cls):
|
def default_fecha_entrada(cls):
|
||||||
return datetime.now()
|
return datetime.now()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def default_estado(cls):
|
def default_state(cls):
|
||||||
return "borrador"
|
return "borrador"
|
||||||
|
@ -8,5 +8,15 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<field name="type">form</field>
|
<field name="type">form</field>
|
||||||
<field name="name">recepcion_form</field>
|
<field name="name">recepcion_form</field>
|
||||||
</record>
|
</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 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,8 +15,9 @@ 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>
|
||||||
|
Loading…
Reference in New Issue
Block a user