Commit f2b5aee5 by Maria Agustina

AMB transportista

1 parent ea2945bb
{
"files.defaultLanguage": "Spanish"
}
\ No newline at end of file \ No newline at end of file
...@@ -20,13 +20,16 @@ ...@@ -20,13 +20,16 @@
'version': '0.1', 'version': '0.1',
# any module necessary for this one to work correctly # any module necessary for this one to work correctly
'depends': ['base'], 'depends': [
'base',
],
# always loaded # always loaded
'data': [ 'data': [
# 'security/ir.model.access.csv', 'security/ir.model.access.csv',
'views/views.xml', 'views/transportista_vista.xml',
'views/templates.xml', 'views/menu_vista.xml',
], ],
# only loaded in demonstration mode # only loaded in demonstration mode
'demo': [ 'demo': [
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from . import models
\ No newline at end of file \ No newline at end of file
from . import transportista
\ No newline at end of file \ No newline at end of file
No preview for this file type
No preview for this file type
# -*- coding: utf-8 -*-
from odoo import models, fields, api, exceptions
class trans_transportista(models.Model):
_name = 'trans.transportista'
_description = 'Transportista'
_rec_name = 'trans_nombre'
_order = 'trans_nombre'
_sql_constraints = [
('trans_cuit_unique', 'UNIQUE(trans_cuit)',
'Ya existe otro transportista con el mismo CUIT, por favor reviselo y vuelva a intentarlo'),
]
trans_razon_social = fields.Char(
string=u'Razon Social',
required=True,
)
trans_cuit = fields.Integer(
string=u'CUIT',
required=True,
)
trans_pagina_web = fields.Char(
string=u'Pagina web',
help='Ingrese su pagina web si es que posee',
)
trans_nombre = fields.Char(
string=u'Nombre',
required=True,
)
trans_logo = fields.Binary(
string=u'Logo',
help='Archivo png o jpg de menos de 2 Mb'
)
trans_categoria = fields.Selection(
string=u'Categoria',
selection=[('p', 'Paga'), ('np', 'No Paga')],
compute = '',
store = True,
readonly=True,
)
trans_telefono = fields.Integer(
string=u'Telefono',
required=True,
)
trans_email = fields.Char(
string = u'Correo Electronico',
)
trans_tipo_ent = fields.Selection(
string=u'Tipo de entidad',
selection=[('emp', 'Empresa'), ('ca', 'Camionero'), ('co', 'Comisionista')],
required = True,
)
trans_restriccion_elem = fields.Char(
string=u'Elementos que no transporta',
help='Aclarar aqui que elementos no transporta si los hubiera',
)
# trans_tipo = fields.Many2many(
# string=u'Tipo de Transporte',
# comodel_name='trans.tipo_transporte',
# relation='tipo_transporte_transportista_rel',
# column1='trans_tipo_transporte_id',
# column2='trans_transportista_id',
# )
# trans_pto_retiro = fields.Many2many(
# string=u'Punto de Retiro',
# comodel_name='trans.punto_retiro',
# relation='pto_retiro_transportista_rel',
# column1='trans_punto_retiro_id',
# column2='trans_transportista_id',
# )
trans_posee_ayu = fields.Boolean(
string=u'Posee ayudantes de carga?',
)
trans_observ = fields.Text(
string=u'Observaciones',
help = u'Utilice este campo para agregar cualquier observacion que desee',
)
@api.one
@api.constrains('trans_cuit', 'trans_telefono')
def _requerir_valores(self):
if self.trans_cuit == 0:
raise exceptions.ValidationError('Por favor ingrese el CUIT')
if self.trans_telefono == 0:
raise exceptions.ValidationError('Por favor ingrese el telefono')
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_my_module_my_module,my_module.my_module,model_my_module_my_module,,1,0,0,0
\ No newline at end of file \ No newline at end of file
trans_transportista,access_trans_transportista,model_trans_transportista,,1,0,0,0
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="0">
<!-- menu Root -->
<menuitem name="Transportar" id="hgt_transportar.menu_root"/>
<!-- menu categories -->
<menuitem name="Transportistas" id="hgt_transportar_transportistas" parent="hgt_transportar.menu_root"/>
<!-- actions -->
<menuitem name="Transportistas" id="hgt_transportar_transportistas_transportistas" parent="hgt_transportar_transportistas"
action="hgt_transportar.trans_transportista_action_window"/>
</data>
</odoo>
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="0">
<!-- explicit list view definition -->
<record model="ir.ui.view" id="hgt_transportar.trans_transportista_list">
<field name="name">Transportista</field>
<field name="model">trans.transportista</field>
<field name="arch" type="xml">
<tree>
<field name="trans_nombre"/>
<field name="trans_razon_social"/>
<field name="trans_tipo_ent"/>
<field name="trans_telefono"/>
<!-- <field name="trans_tipo"/> -->
</tree>
</field>
</record>
<record model="ir.ui.view" id="hgt_transportar.trans_transportista_form">
<field name="name">Transportista</field>
<field name="model">trans.transportista</field>
<field name="arch" type="xml">
<form>
<header>
</header>
<sheet>
<group col="2" string="Datos generales">
<field name="trans_nombre" colspan="2"/>
<field name="trans_razon_social" colspan="2" required="1"/>
<field name="trans_cuit" colspan="2" required="1"/>
</group>
<group col="2">
<field name="trans_telefono" colspan="2" required="1"/>
<field name="trans_email" colspan="2"/>
<field name="trans_pagina_web" colspan="2"/>
<field name="trans_logo" colspan="2"/>
</group>
<group col="2">
<field name="trans_tipo_ent" colspan="2" required="1"/>
<!-- <field name="trans_tipo" colspan="2" /> -->
<field name="trans_restriccion_elem" colspan="2"/>
<!-- <field name="trans_pto_retiro" colspan="2" /> -->
<field name="trans_posee_ayu" colspan="2"/>
<field name="trans_observ" colspan="2"/>
</group>
<group col="2" string="Datos de usuario">
<field name="trans_categoria" colspan="2"/>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="hgt_transportar.trans_transportista_search">
<field name="name">Transportista</field>
<field name="model">trans.transportista</field>
<field name="arch" type="xml">
<search string="Busqueda de transportista">
<field name="trans_nombre"/>
<field name="trans_razon_social"/>
<field name="trans_tipo_ent"/>
<!-- <field name="trans_tipo"/> -->
</search>
</field>
</record>
<!-- actions opening views on models -->
<record model="ir.actions.act_window" id="hgt_transportar.trans_transportista_action_window">
<field name="name">Transportista</field>
<field name="res_model">trans.transportista</field>
<field name="view_mode">tree,form</field>
</record>
</data>
</odoo>
\ No newline at end of file \ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!