add button registrado
This commit is contained in:
parent
ca137b324f
commit
92147163ad
Binary file not shown.
14
recepcion.py
14
recepcion.py
@ -1,6 +1,6 @@
|
|||||||
# 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):
|
||||||
@ -14,6 +14,7 @@ class Recepcion(ModelView, ModelSQL):
|
|||||||
descripcion = fields.Text("Descripcion")
|
descripcion = fields.Text("Descripcion")
|
||||||
estado = fields.Selection([("borrador","Borrador"),("registrado", "Registrado")],"Estado")
|
estado = 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()
|
||||||
@ -22,6 +23,17 @@ class Recepcion(ModelView, ModelSQL):
|
|||||||
def default_estado(cls):
|
def default_estado(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":{}})
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
@ModelView.button
|
||||||
|
@Workflow.transition("registrado")
|
||||||
|
def registrado(cls, records):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,6 +8,11 @@ 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>
|
||||||
</data>
|
</data>
|
||||||
</tryton>
|
</tryton>
|
||||||
|
|
||||||
|
@ -17,5 +17,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<field name="descripcion"/>
|
<field name="descripcion"/>
|
||||||
<label name="estado"/>
|
<label name="estado"/>
|
||||||
<field name="estado"/>
|
<field name="estado"/>
|
||||||
|
<button name="registrado"/>
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user