Files
tryton/configuration.py
T

24 lines
1.0 KiB
Python
Raw Normal View History

2014-12-02 12:55:47 +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:50 +02:00
from trytond.pyson import Eval, Bool
2012-09-24 22:18:09 +02:00
__all__ = ['Configuration']
class Configuration(ModelSingleton, ModelSQL, ModelView):
2010-04-08 19:05:49 +02:00
'Purchase Configuration'
2012-09-24 22:18:09 +02:00
__name__ = 'purchase.configuration'
2010-03-11 16:53:13 +01:00
purchase_sequence = fields.Property(fields.Many2One('ir.sequence',
'Purchase Sequence', domain=[
2011-08-04 16:57:38 +02:00
('company', 'in',
2013-10-09 18:25:44 +02:00
[Eval('context', {}).get('company', -1), None]),
2011-08-04 16:57:38 +02:00
('code', '=', 'purchase.purchase'),
], required=True))
purchase_invoice_method = fields.Property(fields.Selection([
2011-08-04 16:57:38 +02:00
('manual', 'Manual'),
('order', 'Based On Order'),
('shipment', 'Based On Shipment'),
], 'Invoice Method', states={
2013-10-09 18:25:44 +02:00
'required': Bool(Eval('context', {}).get('company')),
2011-08-04 16:57:38 +02:00
}))