Remove required on sequence
review348001
This commit is contained in:
+18
-2
@@ -1361,7 +1361,9 @@ class InvoiceLine(ModelSQL, ModelView):
|
||||
],
|
||||
depends=['invoice'], select=True)
|
||||
|
||||
sequence = fields.Integer('Sequence', required=True,
|
||||
sequence = fields.Integer('Sequence',
|
||||
order_field='(%(table)s.sequence IS NULL) %(order)s, '
|
||||
'%(table)s.sequence %(order)s',
|
||||
states={
|
||||
'invisible': Bool(Eval('context', {}).get('standalone')),
|
||||
})
|
||||
@@ -1483,6 +1485,9 @@ class InvoiceLine(ModelSQL, ModelView):
|
||||
# Migration from 1.0 invoice is no more required
|
||||
table.not_null_action('invoice', action='remove')
|
||||
|
||||
# Migration from 2.4: drop required on sequence
|
||||
table.not_null_action('sequence', action='remove')
|
||||
|
||||
def default_invoice_type(self):
|
||||
return Transaction().context.get('invoice_type', 'out_invoice')
|
||||
|
||||
@@ -1952,7 +1957,9 @@ class InvoiceTax(ModelSQL, ModelView):
|
||||
invoice = fields.Many2One('account.invoice', 'Invoice', ondelete='CASCADE',
|
||||
select=True)
|
||||
description = fields.Char('Description', size=None, required=True)
|
||||
sequence = fields.Integer('Sequence', required=True)
|
||||
sequence = fields.Integer('Sequence',
|
||||
order_field='(%(table)s.sequence IS NULL) %(order)s, '
|
||||
'%(table)s.sequence %(order)s')
|
||||
sequence_number = fields.Function(fields.Integer('Sequence Number'),
|
||||
'get_sequence_number')
|
||||
account = fields.Many2One('account.account', 'Account', required=True,
|
||||
@@ -1992,6 +1999,15 @@ class InvoiceTax(ModelSQL, ModelView):
|
||||
'that is open, paid or canceled!',
|
||||
})
|
||||
|
||||
def init(self, module_name):
|
||||
cursor = Transaction().cursor
|
||||
table = TableHandler(cursor, self, module_name)
|
||||
|
||||
super(InvoiceTax, self).init(module_name)
|
||||
|
||||
# Migration from 2.4: drop required on sequence
|
||||
table.not_null_action('sequence', action='remove')
|
||||
|
||||
def default_base(self):
|
||||
return Decimal('0.0')
|
||||
|
||||
|
||||
+7
-2
@@ -77,8 +77,10 @@ class PaymentTermLine(ModelSQL, ModelView):
|
||||
'Payment Term Line'
|
||||
_name = 'account.invoice.payment_term.line'
|
||||
_description = __doc__
|
||||
sequence = fields.Integer('Sequence', required=True,
|
||||
help='Use to order lines in ascending order')
|
||||
sequence = fields.Integer('Sequence',
|
||||
order_field='(%(table)s.sequence IS NULL) %(order)s, '
|
||||
'%(table)s.sequence %(order)s',
|
||||
help='Use to order lines in ascending order')
|
||||
payment = fields.Many2One('account.invoice.payment_term', 'Payment Term',
|
||||
required=True, ondelete="CASCADE")
|
||||
type = fields.Selection([
|
||||
@@ -179,6 +181,9 @@ class PaymentTermLine(ModelSQL, ModelView):
|
||||
line.percentage, self.divisor.digits[1]),
|
||||
})
|
||||
|
||||
# Migration from 2.4: drop required on sequence
|
||||
table.not_null_action('sequence', action='remove')
|
||||
|
||||
def default_currency_digits(self):
|
||||
return 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user