add field code

This commit is contained in:
wilson gomez 2021-06-08 16:29:31 -05:00
parent b5fd1cbb56
commit 7235c150c4
6 changed files with 49 additions and 0 deletions

View File

@ -13,6 +13,7 @@ from . import product
from . import sale
from . import invoice_authorization
from . import asset
from . import payment_term
def register():
@ -70,6 +71,7 @@ def register():
invoice.InvoiceUpdateStart,
sale.SaleUpdateStart,
purchase.PurchaseUpdateStart,
payment_term.PaymentTerm,
module='account_col', type_='model')
Pool.register(
move.AccountMoveSheet,

10
payment_term.py Normal file
View File

@ -0,0 +1,10 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import PoolMeta
from trytond.model import fields
class PaymentTerm(metaclass=PoolMeta):
'Payment Term'
__name__ = 'account.invoice.payment_term'
code = fields.Char('Code')

17
payment_term.xml Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="payment_term_view_form">
<field name="model">account.invoice.payment_term</field>
<field name="inherit" ref='account_invoice.payment_term_view_form'/>
<field name="name">payment_term_form</field>
</record>
<record model="ir.ui.view" id="payment_term_view_tree">
<field name="model">account.invoice.payment_term</field>
<field name="inherit" ref='account_invoice.payment_term_view_tree'/>
<field name="name">payment_term_tree</field>
</record>
</data>
</tryton>

View File

@ -26,3 +26,4 @@ xml:
product.xml
invoice_authorization.xml
sale.xml
payment_term.xml

View File

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="/form/field[@name='name']" position="after">
<label name="code"/>
<field name="code"/>
</xpath>
</data>

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath
expr="/tree/field[@name='name']"
position="after">
<field name="code"/>
</xpath>
</data>