Commit a347a402 by Maria Agustina

831 terminada

1 parent fe2c0e9a
......@@ -29,6 +29,8 @@
'wizard/vista_prod_pfinal.xml',
'views/referencias.xml',
'views/comprobante.xml',
'views/referencia_compra.xml',
'views/menu_compras.xml',
],
# only loaded in demonstration mode
'demo': [
......
......@@ -2,3 +2,4 @@
from . import comprobante
from . import referencias
from . import referencia_compra
\ No newline at end of file
......@@ -14,6 +14,13 @@ class asw_comprobante(models.Model):
inverse_name='factura',
)
referencia_compras_corr = fields.One2many(
string=u'Referencia de Compra',
comodel_name='hgt.refcompra',
inverse_name='comprobante',
store=True,
)
qr = fields.Binary(
string=u'QR',
)
......
# -*- coding: utf-8 -*-
from odoo import models, fields, api, exceptions
class hgt_refcompra(models.Model):
_name='hgt.refcompra'
name = fields.Char(
string="Nombre",
)
habilitado = fields.Boolean(
string="Habilitado",
)
descripcion = fields.Text(
string=u"Descripción",
)
comprobante = fields.Many2one(
string=u'Comprobante',
comodel_name='asw.comprobante',
ondelete='set null',
store=True,
)
\ No newline at end of file
......@@ -11,7 +11,8 @@
</xpath>
<xpath expr="//group[1]" position="after">
<group string="Referencias" col="4">
<field name="referencia_corr" nolabel="1" widget="many2many_tags" />
<field name="referencia_corr" widget="many2many_tags" />
<field name="referencia_compras_corr" widget="many2many_tags" />
</group>
</xpath>
</data>
......@@ -28,8 +29,8 @@
<button name="abrir_wizard_ppf" class='btn btn-primary' string="+ Producto por precio final" type="object" attrs="{'invisible':[('comp_estado','!=','b')]}"/>
</xpath>
<xpath expr="//group[1]" position="after">
<group string="Referencias" col="4">
<field name="referencia_corr" nolabel="1" widget="many2many_tags" />
<group string="Referencia" col="2">
<field name="referencia_corr" colspan="1" nolabel="1" widget="many2many_tags" />
</group>
</xpath>
</data>
......@@ -49,5 +50,22 @@
</field>
</record>
<record id="view_inherit_search_comprobante" model="ir.ui.view">
<field name="name">Comprobante</field>
<field name="model">asw.comprobante</field>
<field name="inherit_id" ref="asw_tpv.view_search_comprobante"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='comp_fecha']" position="after">
<field name="referencia_corr"/>
</xpath>
<xpath expr="//group/filter[11]" position="after">
<filter string="Referencia Compra" domain="[]" context="{'group_by': 'referencia_corr'}"/>
</xpath>
</data>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
<odoo>
<data>
<menuitem name="Referencias" sequence="90" id="asw_tpv_compras_referencias" parent="asw_tpv.asw_tpv_compras"/>
<menuitem name="Referencias de Compras"
id="asw_tpv_compras_referencias_refcompras"
parent="asw_tpv_compras_referencias"
action="hgt_refcompra_list_action"/>
</data>
</odoo>
\ No newline at end of file
<odoo>
<data>
<record model="ir.actions.act_window" id="hgt_refcompra_list_action">
<field name="name">Referencia</field>
<field name="res_model">hgt.refcompra</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 primer Referencia de Compra</p>
</field>
</record>
<record id="view_tree_referencia_ui" model="ir.ui.view">
<field name="name">Referencia</field>
<field name="model">hgt.refcompra</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="descripcion" />
<field name="habilitado" />
</tree>
</field>
</record>
<record id="view_form_referencia_ui" model="ir.ui.view">
<field name="name">Referencia</field>
<field name="model">hgt.refcompra</field>
<field name="arch" type="xml">
<form>
<header>
</header>
<sheet>
<group col='4'>
<field name="name" colspan="2" />
<field name="habilitado" colspan="2"/>
</group>
<group col='2'>
<field name="descripcion"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_search_referencia" model="ir.ui.view">
<field name="name">Referencia</field>
<field name="model">hgt.refcompra</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
</search>
</field>
</record>
</data>
</odoo>
\ 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!