Rename comment into note because there is now a comment type
This commit is contained in:
+13
-4
@@ -8,6 +8,7 @@ import datetime
|
||||
from trytond.netsvc import LocalService
|
||||
from trytond.report import CompanyReport
|
||||
from trytond.wizard import Wizard
|
||||
from trytond.sql_db import table_handler
|
||||
|
||||
_STATES = {
|
||||
'readonly': "state != 'draft'",
|
||||
@@ -801,10 +802,7 @@ class PurchaseLine(OSV):
|
||||
}, on_change_with=['type', 'quantity', 'unit_price',
|
||||
'_parent_purchase.currency'])
|
||||
description = fields.Text('Description', size=None, required=True)
|
||||
comment = fields.Text('Comment',
|
||||
states={
|
||||
'invisible': "type != 'line'",
|
||||
})
|
||||
note = fields.Text('Note')
|
||||
taxes = fields.Many2Many('account.tax', 'purchase_line_account_tax',
|
||||
'line', 'tax', 'Taxes', domain=[('parent', '=', False)],
|
||||
states={
|
||||
@@ -831,6 +829,17 @@ class PurchaseLine(OSV):
|
||||
'an "account_expense" default property!',
|
||||
})
|
||||
|
||||
def _auto_init(self, cursor, module_name):
|
||||
super(PurchaseLine, self)._auto_init(cursor, module_name)
|
||||
table = table_handler(cursor, self._table, self._name, module_name)
|
||||
|
||||
# Migration from 1.0 comment change into note
|
||||
if 'comment' in table.table:
|
||||
cursor.execute('UPDATE "' + self._table + '" ' \
|
||||
'SET note = comment')
|
||||
cursor.execute('ALTER TABLE "' + self._table + '" ' \
|
||||
'DROP COLUMN comment')
|
||||
|
||||
def default_type(self, cursor, user, context=None):
|
||||
return 'line'
|
||||
|
||||
|
||||
+3
-3
@@ -612,9 +612,9 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<separator name="taxes" colspan="4"/>
|
||||
<field name="taxes" colspan="4"/>
|
||||
</page>
|
||||
<page string="Comment" id="comment">
|
||||
<separator name="comment" colspan="4"/>
|
||||
<field name="comment" colspan="4"
|
||||
<page string="Notes" id="notes">
|
||||
<separator name="note" colspan="4"/>
|
||||
<field name="note" colspan="4"
|
||||
spell="_parent_purchase.party_lang"/>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
Reference in New Issue
Block a user