Files
tryton/configuration.py
T

32 lines
1.3 KiB
Python
Raw Normal View History

2014-12-02 12:55:52 +01:00
# 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.model import ModelView, ModelSQL, ModelSingleton, fields
2011-08-21 11:20:51 +02:00
from trytond.pyson import Eval, Bool
2012-09-24 22:18:13 +02:00
__all__ = ['Configuration']
class Configuration(ModelSingleton, ModelSQL, ModelView):
2010-04-08 19:13:58 +02:00
'Sale Configuration'
2012-09-24 22:18:13 +02:00
__name__ = 'sale.configuration'
2010-03-11 16:53:27 +01:00
sale_sequence = fields.Property(fields.Many2One('ir.sequence',
2011-08-21 11:20:51 +02:00
'Sale Reference Sequence', domain=[
2013-10-09 18:25:47 +02:00
('company', 'in',
[Eval('context', {}).get('company', -1), None]),
2011-08-04 16:57:40 +02:00
('code', '=', 'sale.sale'),
], required=True))
2011-03-29 15:18:40 +02:00
sale_invoice_method = fields.Property(fields.Selection([
2011-08-04 16:57:40 +02:00
('manual', 'Manual'),
('order', 'On Order Processed'),
2011-08-04 16:57:40 +02:00
('shipment', 'On Shipment Sent')
], 'Sale Invoice Method', states={
2013-10-09 18:25:47 +02:00
'required': Bool(Eval('context', {}).get('company')),
2011-08-04 16:57:40 +02:00
}))
2011-03-29 15:18:40 +02:00
sale_shipment_method = fields.Property(fields.Selection([
2011-08-04 16:57:40 +02:00
('manual', 'Manual'),
('order', 'On Order Processed'),
2011-08-04 16:57:40 +02:00
('invoice', 'On Invoice Paid'),
], 'Sale Shipment Method', states={
2013-10-09 18:25:47 +02:00
'required': Bool(Eval('context', {}).get('company')),
2011-08-04 16:57:40 +02:00
}))