This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name" : "Alumno", | |
"version" : "0.1", | |
"author" : "yaroslab", | |
"website" : "http://yaroslab.com/", | |
"category" : "Generic Modules/Others", | |
"depends" : ["base"], | |
"description" : "Registro alumno", | |
"init_xml" : ["alumno_view.xml",], | |
"demo_xml" : [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from osv import fields, osv | |
class alumno(osv.osv): | |
_name = "alumno" | |
_description = "Registro alumno" | |
_columns = { | |
'nombres' : fields.char('Nombres', size=64, required=True), | |
'apellido_paterno' : fields.char('Apellido Paterno', size=64), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<openerp> | |
<data> | |
<!-- Top menu item --> | |
<menuitem name="Alumno" id="alumno_menu_base"/> | |
<menuitem name="Registro alumno" id="alumno_menu_base_reg" parent="alumno_menu_base" /> | |
<!-- tree --> | |
<record model="ir.ui.view" id="alumno_tree_view"> | |
<field name="name">alumno.tree</field> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
columns = { | |
. | |
. | |
. | |
#agregar el nuevo atributo | |
'departamento_id' : fields.many2one('departamento', 'Departamento'), | |
} | |
class departamento(osv.osv): | |
_name = "departamento" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
. | |
. | |
<field name="nacionalidad"/> | |
<field name="departamento_id" attrs="{'readonly': [('nacionalidad','!=', 175)]}"/> | |
<field name="direccion"/> | |
. | |
. | |
. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<openerp> | |
<data> | |
<!-- Data departamentos --> | |
<record model="departamento" > | |
<field name="name">AMAZONAS</field> | |
<field name="codigo">PO1</field> | |
</record> | |
<record model="departamento" > | |
<field name="name">ANCASH</field> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from osv import fields, osv | |
from datetime import date | |
class popup(osv.osv): | |
_name = "popup" | |
_description = "Popup" | |
def procesar(self, cr, uid, ids, context= None): | |
print "Escribe tu código aquí" | |
print "ACTIVE_MODEL:", context["active_model"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<openerp> | |
<data> | |
<record id="view_popup_form" model="ir.ui.view"> | |
<field name="name">Popup procesar</field> | |
<field name="model">popup</field> | |
<field name="arch" type="xml"> | |
<form string="Procesar" version="7.0"> | |
<label string="Esta seguro que desea realizar su proceso?"/> | |
<group> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
. | |
. | |
<field name="arch" type="xml"> | |
<form string="Registro Alumnos" version="7.0"> | |
<header> | |
<button string="Llamar formulario" name="call_form" type='object' icon="gtk-go-forward"/> | |
</header> | |
. | |
. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from osv import fields, osv | |
class alumno(osv.osv): | |
. | |
. | |
. | |
def call_form(self, cr, uid, ids, context=None): | |
print "Estamos en el metodo: call_form" | |
#======================================================================================== |
OlderNewer