Commit e59c1f70 by Maria Agustina

687 terminada

1 parent 4179f802
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
# always loaded # always loaded
'data': [ 'data': [
# 'security/ir.model.access.csv', # 'security/ir.model.access.csv',
'views/views.xml', 'views/referencias.xml',
'views/templates.xml', 'views/comprobante.xml',
], ],
# only loaded in demonstration mode # only loaded in demonstration mode
'demo': [ 'demo': [
......
...@@ -4,11 +4,11 @@ from odoo import models, fields, api, exceptions ...@@ -4,11 +4,11 @@ from odoo import models, fields, api, exceptions
class asw_comprobante(models.Model): class asw_comprobante(models.Model):
_inherit = 'asw.comprobante' _inherit = 'asw.comprobante'
agrupaciones = fields.Char( name_ref = fields.Char(
string="Grupo", string="Nombre",
) )
referencia = fields.One2many( referencia_corr = fields.One2many(
string=u'Referencia', string=u'Referencia',
comodel_name='asw.referencias', comodel_name='asw.referencias',
inverse_name='factura', inverse_name='factura',
...@@ -17,3 +17,13 @@ class asw_comprobante(models.Model): ...@@ -17,3 +17,13 @@ class asw_comprobante(models.Model):
qr = fields.Binary( qr = fields.Binary(
string=u'QR', string=u'QR',
) )
#metodo p q campo de referencia escriba name
#como el campo es one2many puse que tome el nombre de la primer referencia elegida
@api.onchange('referencia_corr')
def _onchange_name(self):
first_line = self.env['asw.referencias'].search([('id', 'in', self.referencia_corr.ids)], limit=1)
if first_line and first_line.name:
self.name_ref = first_line.name
<odoo>
<data>
<record id="view_form_inherit_comprobante_recibido_ui" model="ir.ui.view">
<field name="name">Comprobante</field>
<field name="model">asw.comprobante</field>
<field name="inherit_id" ref="asw_tpv.view_form_comprobante_recibido_ui"/>
<field name="arch" type="xml">
<data>
<xpath expr="//group[1]" position="after">
<group string="Referencias" col="4">
<field name="referencia_corr" nolabel="1" widget="many2many_tags" />
</group>
</xpath>
</data>
</field>
</record>
<record id="view_form_inherit_comprobante_ui" model="ir.ui.view">
<field name="name">Comprobante</field>
<field name="model">asw.comprobante</field>
<field name="inherit_id" ref="asw_tpv.view_form_comprobante_ui"/>
<field name="arch" type="xml">
<data>
<xpath expr="//group[1]" position="after">
<group string="Referencias" col="4">
<field name="referencia_corr" nolabel="1" widget="many2many_tags" />
</group>
</xpath>
</data>
</field>
</record>
<record id="view_form_inherit_comprobante_afip_ui" model="ir.ui.view">
<field name="name">Comprobante</field>
<field name="model">asw.comprobante</field>
<field name="inherit_id" ref="asw_afipws_fe.view_invoice_afipws_fe_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='afip_xml_response']" position="after">
<field name="qr" />
</xpath>
</data>
</field>
</record>
</data>
</odoo>
\ No newline at end of file \ No newline at end of file
<odoo>
<data>
<record model="ir.actions.act_window" id="asw_referencias_list_action">
<field name="name">Referencia</field>
<field name="res_model">asw.referencias</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</p>
</field>
</record>
<record id="view_tree_referencia_ui" model="ir.ui.view">
<field name="name">Referencia</field>
<field name="model">asw.referencias</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="descripcion" />
<field name="habilitada" />
</tree>
</field>
</record>
<record id="view_form_referencia_ui" model="ir.ui.view">
<field name="name">Referencia</field>
<field name="model">asw.referencias</field>
<field name="arch" type="xml">
<form>
<header>
</header>
<sheet>
<group col='4'>
<field name="name" colspan="2" />
<field name="habilitada" 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">asw.referencias</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
</search>
</field>
</record>
</data>
</odoo>
\ No newline at end of file \ No newline at end of file
<odoo>
<data>
<!-- <template id="listing"> -->
<!-- <ul> -->
<!-- <li t-foreach="objects" t-as="object"> -->
<!-- <a t-attf-href="#{ root }/objects/#{ object.id }"> -->
<!-- <t t-esc="object.display_name"/> -->
<!-- </a> -->
<!-- </li> -->
<!-- </ul> -->
<!-- </template> -->
<!-- <template id="object"> -->
<!-- <h1><t t-esc="object.display_name"/></h1> -->
<!-- <dl> -->
<!-- <t t-foreach="object._fields" t-as="field"> -->
<!-- <dt><t t-esc="field"/></dt> -->
<!-- <dd><t t-esc="object[field]"/></dd> -->
<!-- </t> -->
<!-- </dl> -->
<!-- </template> -->
</data>
</odoo>
\ No newline at end of file \ No newline at end of file
<odoo>
<data>
<!-- explicit list view definition -->
<!--
<record model="ir.ui.view" id="my_module.list">
<field name="name">my_module list</field>
<field name="model">my_module.my_module</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="value"/>
<field name="value2"/>
</tree>
</field>
</record>
-->
<!-- actions opening views on models -->
<!--
<record model="ir.actions.act_window" id="my_module.action_window">
<field name="name">my_module window</field>
<field name="res_model">my_module.my_module</field>
<field name="view_mode">tree,form</field>
</record>
-->
<!-- server action to the one above -->
<!--
<record model="ir.actions.server" id="my_module.action_server">
<field name="name">my_module server</field>
<field name="model_id" ref="model_my_module_my_module"/>
<field name="state">code</field>
<field name="code">
action = {
"type": "ir.actions.act_window",
"view_mode": "tree,form",
"res_model": self._name,
}
</field>
</record>
-->
<!-- Top menu item -->
<!--
<menuitem name="my_module" id="my_module.menu_root"/>
-->
<!-- menu categories -->
<!--
<menuitem name="Menu 1" id="my_module.menu_1" parent="my_module.menu_root"/>
<menuitem name="Menu 2" id="my_module.menu_2" parent="my_module.menu_root"/>
-->
<!-- actions -->
<!--
<menuitem name="List" id="my_module.menu_1_list" parent="my_module.menu_1"
action="my_module.action_window"/>
<menuitem name="Server to list" id="my_module" parent="my_module.menu_2"
action="my_module.action_server"/>
-->
</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!