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.
|
2010-02-03 11:41:05 +01:00
|
|
|
from trytond.model import ModelView, ModelSQL, ModelSingleton, fields
|
2011-08-21 11:20:50 +02:00
|
|
|
from trytond.pyson import Eval, Bool
|
2010-02-03 11:41:05 +01:00
|
|
|
|
2012-09-24 22:18:09 +02:00
|
|
|
__all__ = ['Configuration']
|
|
|
|
|
|
2010-02-03 11:41:05 +01:00
|
|
|
|
|
|
|
|
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',
|
2016-03-28 10:33:48 +02:00
|
|
|
'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))
|
2011-03-29 15:18:15 +02:00
|
|
|
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
|
|
|
}))
|