Skip to content

Instantly share code, notes, and snippets.

@YnievesDotNet
Created February 9, 2017 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YnievesDotNet/331c561f8e1611ebd69d3d8213e63b1f to your computer and use it in GitHub Desktop.
Save YnievesDotNet/331c561f8e1611ebd69d3d8213e63b1f to your computer and use it in GitHub Desktop.
Campos en Odoo
from odoo import models, fields
class ProductTemplate(models.Model):
_inherit = "product.template"
cum = fields.Char(
'CUM Code', size=40
)
class AccountInvoiceLine(models.Model):
_inherit = "account.invoice.line"
cum = fields.Char(string='CUM Code',
store=True,
related='product_id.cum')
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Imprimir en la factura, funciona bien -->
<template id="report_invoice_document_cum" inherit_id="account.report_invoice_document">
<xpath expr="//div[contains(@class, 'page')]/table[1]/thead/tr/th[2]" position="before">
<th>CUM</th>
</xpath>
<xpath expr="//div[contains(@class, 'page')]/table[1]/tbody/tr/td[2]" position="before">
<td>
<field name="l.cum"/>
</td>
</xpath>
</template>
</data>
</odoo>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment