Created
February 9, 2017 16:34
-
-
Save YnievesDotNet/331c561f8e1611ebd69d3d8213e63b1f to your computer and use it in GitHub Desktop.
Campos en Odoo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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