Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Maria Agustina
/
tpv_correcciones
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit cb021cf2
authored
2021-07-01 16:14:17 -0300
by
Juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
soporte mobil
1 parent
179e8869
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
150 additions
and
8 deletions
__manifest__.py
models/__init__.py
models/gastosmobil.py
security/ir.model.access.csv
views/gastosmobil.xml
views/menu_compras.xml
__manifest__.py
View file @
cb021cf
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
automatica
automatica
Se Agrega generacion manual para notas de credito y notas
Se Agrega generacion manual para notas de credito y notas
de debito
de debito
Se agrega soporte a gastos mobil
"""
,
"""
,
'author'
:
'HGT'
,
'author'
:
'HGT'
,
...
@@ -22,13 +23,14 @@
...
@@ -22,13 +23,14 @@
# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
# for the full list
# for the full list
'category'
:
'Localization/Argentina'
,
'category'
:
'Localization/Argentina'
,
'version'
:
'1.0
6.25
.21'
,
'version'
:
'1.0
7.01
.21'
,
# any module necessary for this one to work correctly
# any module necessary for this one to work correctly
'depends'
:
[
'base'
,
'depends'
:
[
'base'
,
'asw_tpv'
,
'asw_tpv'
,
'asw_afipws_fe'
,
'asw_afipws_fe'
,
'asw_tpv_impuestos'
'asw_tpv_impuestos'
,
'asw_cajas'
,
],
],
# always loaded
# always loaded
...
@@ -38,6 +40,7 @@
...
@@ -38,6 +40,7 @@
'wizard/vista_prod_pfinal.xml'
,
'wizard/vista_prod_pfinal.xml'
,
'wizard/vista_corregir_nro_tal.xml'
,
'wizard/vista_corregir_nro_tal.xml'
,
'views/referencias.xml'
,
'views/referencias.xml'
,
'views/gastosmobil.xml'
,
'views/comprobante.xml'
,
'views/comprobante.xml'
,
'views/referencia_compra.xml'
,
'views/referencia_compra.xml'
,
'views/menu_compras.xml'
,
'views/menu_compras.xml'
,
...
...
models/__init__.py
View file @
cb021cf
...
@@ -2,4 +2,5 @@
...
@@ -2,4 +2,5 @@
from
.
import
comprobante
from
.
import
comprobante
from
.
import
referencias
from
.
import
referencias
from
.
import
referencia_compra
\ No newline at end of file
\ No newline at end of file
from
.
import
referencia_compra
from
.
import
gastosmobil
\ No newline at end of file
\ No newline at end of file
models/gastosmobil.py
0 → 100644
View file @
cb021cf
# -*- coding: utf-8 -*-
from
odoo
import
models
,
fields
,
api
,
exceptions
from
.qr
import
qrfiscal
from
odoo.exceptions
import
UserError
,
ValidationError
,
Warning
,
RedirectWarning
import
base64
class
gastos_mobiles
(
models
.
Model
):
_name
=
'hgt.mobil_gastos_config'
_description
=
u'Configuracion carga rapida de Gastos Mobil'
_inherit
=
[
'asw.action.manager'
,
'asw.generador_comprobante'
]
name
=
fields
.
Char
(
string
=
'Descripcion'
)
habilitado
=
fields
.
Boolean
(
string
=
'Habilitado'
,
default
=
True
)
talonario
=
fields
.
Many2one
(
string
=
'Talonario de gasto'
,
comodel_name
=
'asw.talonario'
,
help
=
"Es el talonario que oficia de pseudo factura"
,
ondelete
=
'set null'
,
domain
=
lambda
self
:
self
.
get_domain_talonario
(),
)
talonario_recibo
=
fields
.
Many2one
(
string
=
'Resivos de gasto'
,
comodel_name
=
'asw.talonario'
,
help
=
"Es el talonario de Resivos en el que saldra plata de la caja"
,
ondelete
=
'set null'
,
domain
=
lambda
self
:
self
.
get_domain_talonario_recibo
(),
)
producto
=
fields
.
Many2one
(
string
=
'Producto'
,
comodel_name
=
'asw.producto'
,
ondelete
=
'set null'
,
domain
=
lambda
self
:
self
.
get_domain_producto
(),
)
forma_pago
=
fields
.
Many2one
(
string
=
'Forma de Pago'
,
comodel_name
=
'asw.tipos_valores'
,
ondelete
=
'set null'
,
)
def
BotonPrueba
(
self
):
self
.
registrar
(
"Prueba del sistema"
,
importe
=
1.0
)
def
registrar
(
self
,
descripcion
=
""
,
importe
=
1.0
):
comprobante
=
self
.
generar_comprobante
(
self
.
talonario
,
False
,
0
,
'Gastos'
,
comp_observaciones
=
"Generado desde la app"
)
linea
=
comprobante
.
agregar_producto
(
self
.
producto
,
importe
)
caja
=
self
.
env
.
user
.
caja_default
.
id
comprobante
.
write
({
'comprobante_caja_ids'
:
caja
})
if
descripcion
==
''
or
descripcion
==
False
:
descripcion
=
self
.
producto
.
prod_descripcion
linea
.
lcp_descripcion_producto
=
descripcion
comprobante
.
validar
()
comprobante
.
pago_rapido
(
self
.
forma_pago
,
self
.
talonario_recibo
)
return
(
True
)
def
get_domain_producto
(
self
):
return
[(
'prod_es_gasto'
,
'='
,
True
)]
def
get_domain_talonario
(
self
):
return
[(
'tal_menu'
,
'='
,
'gas'
)]
def
get_domain_talonario_recibo
(
self
):
return
[(
'tal_menu'
,
'='
,
'rec'
),(
'tal_tipo'
,
'='
,
'r'
)]
\ No newline at end of file
\ No newline at end of file
security/ir.model.access.csv
View file @
cb021cf
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_asw_referencias,access_asw_referencias,model_asw_referencias,asw_tpv.module_category_asw_falange_usuario,1,1,1,0
access_asw_referencias,access_asw_referencias,model_asw_referencias,asw_tpv.module_category_asw_falange_usuario,1,1,1,0
access_hgt_refcompra,access_hgt_refcompra,model_hgt_refcompra,asw_tpv.module_category_asw_falange_usuario,1,1,1,0
\ No newline at end of file
\ No newline at end of file
access_hgt_refcompra,access_hgt_refcompra,model_hgt_refcompra,asw_tpv.module_category_asw_falange_usuario,1,1,1,0
access_hgt_mobil_gastos_config,access_hgt_mobil_gastos_config,model_hgt_mobil_gastos_config,,1,1,1,0
\ No newline at end of file
\ No newline at end of file
views/gastosmobil.xml
0 → 100644
View file @
cb021cf
<odoo>
<data>
<record
model=
"ir.actions.act_window"
id=
"hgt_gastos_mobil_list_action"
>
<field
name=
"name"
>
Gastos mobil
</field>
<field
name=
"res_model"
>
hgt.mobil_gastos_config
</field>
<field
name=
"view_type"
>
form
</field>
<field
name=
"view_mode"
>
tree,form
</field>
<field
name=
"help"
type=
"html"
>
<p
class=
"oe_view_nocontent_create"
>
Cree la configuracion de carga de gasto moobil
</p>
</field>
</record>
<record
id=
"view_tree_hgt_gastos_mobil_ui"
model=
"ir.ui.view"
>
<field
name=
"name"
>
Gasto mobil
</field>
<field
name=
"model"
>
hgt.mobil_gastos_config
</field>
<field
name=
"arch"
type=
"xml"
>
<tree>
<field
name=
"name"
/>
<field
name=
"habilitado"
/>
</tree>
</field>
</record>
<record
id=
"view_form_hgt_gastos_mobil_ui"
model=
"ir.ui.view"
>
<field
name=
"name"
>
Configuracion de Gastos moviles
</field>
<field
name=
"model"
>
hgt.mobil_gastos_config
</field>
<field
name=
"arch"
type=
"xml"
>
<form>
<header>
<button
type=
"object"
name=
"BotonPrueba"
string=
"Prueba de gasto"
class=
"btn btn-success"
/>
</header>
<sheet>
<!--
<div class="oe_title">
<label for="ban_descripcion" class="oe_edit_only" />
<h1 class="o_row">
<field name="ban_descripcion" class="oe_inline" placeholder="Nombre" />
</h1>
</div>
-->
<group
col=
"5"
string=
"Identificacion"
>
<field
name=
"name"
placeholder=
"Código"
/>
<field
name=
"habilitado"
/>
</group>
<group
col=
"2"
string=
"Configuracion"
>
<field
name=
"producto"
/>
<field
name=
"talonario"
/>
<field
name=
"forma_pago"
/>
<field
name=
"talonario_recibo"
/>
</group>
</sheet>
</form>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
\ No newline at end of file
views/menu_compras.xml
View file @
cb021cf
<odoo>
<odoo>
<data>
<data>
<menuitem
name=
"Referencias"
sequence=
"90"
id=
"asw_tpv_compras_referencias"
parent=
"asw_tpv.asw_tpv_compras"
/>
<menuitem
name=
"Referencias"
sequence=
"90"
id=
"asw_tpv_compras_referencias"
parent=
"asw_tpv.asw_tpv_compras"
/>
<menuitem
name=
"Referencias de Compras"
<menuitem
name=
"Referencias de Compras"
id=
"asw_tpv_compras_referencias_refcompras"
parent=
"asw_tpv_compras_referencias"
action=
"hgt_refcompra_list_action"
/>
id=
"asw_tpv_compras_referencias_refcompras"
<menuitem
name=
"Configuracion Mobil"
sequence=
"99"
id=
"asw_tpv_gasto_mobil_config"
parent=
"asw_tpv.asw_tpv_compras_gastos"
action=
"hgt_gastos_mobil_list_action"
groups=
"hgt_dispositivos.group_administrador_dispositivos"
/>
parent=
"asw_tpv_compras_referencias"
action=
"hgt_refcompra_list_action"
/>
</data>
</data>
</odoo>
</odoo>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment