Rename long model name for payment term delta
issue5445 review16161002
This commit is contained in:
1 parent
1e54ef271c
commit
7797179881
3 files changed
+17
-7
No files matched your search
@@ -1,3 +1,5 @@
|
||||
* Rename account.invoice.payment_term.line.relativedelta
|
||||
into account.invoice.payment_term.line.delta
|
||||
* Make payment term not required
|
||||
|
||||
Version 4.0.0 - 2016-05-02
|
||||
|
||||
+10
-2
@@ -12,6 +12,7 @@ from trytond.pyson import Eval
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.wizard import Wizard, StateView, Button
|
||||
from trytond.config import config
|
||||
|
||||
__all__ = ['PaymentTerm', 'PaymentTermLine', 'PaymentTermLineRelativeDelta',
|
||||
'TestPaymentTerm', 'TestPaymentTermView', 'TestPaymentTermViewResult']
|
||||
@@ -133,7 +134,7 @@ class PaymentTermLine(ModelSQL, ModelView):
|
||||
currency_digits = fields.Function(fields.Integer('Currency Digits'),
|
||||
'on_change_with_currency_digits')
|
||||
relativedeltas = fields.One2Many(
|
||||
'account.invoice.payment_term.line.relativedelta', 'line', 'Deltas')
|
||||
'account.invoice.payment_term.line.delta', 'line', 'Deltas')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
@@ -291,7 +292,7 @@ class PaymentTermLine(ModelSQL, ModelView):
|
||||
|
||||
class PaymentTermLineRelativeDelta(ModelSQL, ModelView):
|
||||
'Payment Term Line Relative Delta'
|
||||
__name__ = 'account.invoice.payment_term.line.relativedelta'
|
||||
__name__ = 'account.invoice.payment_term.line.delta'
|
||||
sequence = fields.Integer('Sequence')
|
||||
line = fields.Many2One('account.invoice.payment_term.line',
|
||||
'Payment Term Line', required=True, ondelete='CASCADE')
|
||||
@@ -343,6 +344,13 @@ class PaymentTermLineRelativeDelta(ModelSQL, ModelView):
|
||||
sql_table = cls.__table__()
|
||||
line = Line.__table__()
|
||||
|
||||
# Migration from 4.0: rename long table
|
||||
old_model_name = 'account.invoice.payment_term.line.relativedelta'
|
||||
old_table = config.get(
|
||||
'table', old_model_name, default=old_model_name.replace('.', '_'))
|
||||
if TableHandler.table_exist(old_table):
|
||||
TableHandler.table_rename(old_table, cls._table)
|
||||
|
||||
super(PaymentTermLineRelativeDelta, cls).__register__(module_name)
|
||||
|
||||
line_table = TableHandler(Line, module_name)
|
||||
|
||||
+5
-5
@@ -87,28 +87,28 @@ this repository contains the full copyright notices and license terms. -->
|
||||
|
||||
<record model="ir.ui.view"
|
||||
id="payment_term_line_relativedelta_view_list">
|
||||
<field name="model">account.invoice.payment_term.line.relativedelta</field>
|
||||
<field name="model">account.invoice.payment_term.line.delta</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority" eval="10"/>
|
||||
<field name="name">payment_term_line_relativedelta_list</field>
|
||||
</record>
|
||||
<record model="ir.ui.view"
|
||||
id="payment_term_line_relativedelta_view_list_sequence">
|
||||
<field name="model">account.invoice.payment_term.line.relativedelta</field>
|
||||
<field name="model">account.invoice.payment_term.line.delta</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority" eval="20"/>
|
||||
<field name="name">payment_term_line_relativedelta_list_sequence</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="payment_term_line_relativedelta_view_form">
|
||||
<field name="model">account.invoice.payment_term.line.relativedelta</field>
|
||||
<field name="model">account.invoice.payment_term.line.delta</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">payment_term_line_relativedelta_form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.model.access" id="access_payment_term_line_relativedelta">
|
||||
<field name="model"
|
||||
search="[('model', '=', 'account.invoice.payment_term.line.relativedelta')]"/>
|
||||
search="[('model', '=', 'account.invoice.payment_term.line.delta')]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
@@ -117,7 +117,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<record model="ir.model.access"
|
||||
id="access_payment_term_line_relativedelta_account_admin">
|
||||
<field name="model"
|
||||
search="[('model', '=', 'account.invoice.payment_term.line.relativedelta')]"/>
|
||||
search="[('model', '=', 'account.invoice.payment_term.line.delta')]"/>
|
||||
<field name="group" ref="account.group_account_admin"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="True"/>
|
||||
|
||||
Reference in new issue
Block a user