Files
tryton/trytond/tests/export_data.py
T

58 lines
1.8 KiB
Python
Raw Normal View History

2014-12-02 12:54:01 +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.
"Test for export_data"
from trytond.model import ModelSQL, fields
2012-09-28 18:03:53 +02:00
from trytond.pool import PoolMeta
2012-09-24 22:16:53 +02:00
__all__ = [
2012-09-28 18:03:53 +02:00
'ExportDataTarget', 'ExportData', 'ExportDataTarget2',
'ExportDataRelation']
2012-09-24 22:16:53 +02:00
class ExportDataTarget(ModelSQL):
"Export Data Target"
2012-09-24 22:16:53 +02:00
__name__ = 'test.export_data.target'
name = fields.Char('Name')
class ExportData(ModelSQL):
"Export Data"
2012-09-24 22:16:53 +02:00
__name__ = 'test.export_data'
boolean = fields.Boolean('Boolean')
integer = fields.Integer('Integer')
float = fields.Float('Float')
numeric = fields.Numeric('Numeric')
char = fields.Char('Char')
text = fields.Text('Text')
date = fields.Date('Date')
datetime = fields.DateTime('DateTime')
selection = fields.Selection([
2012-12-13 19:18:37 +01:00
(None, ''),
('select1', 'Select 1'),
('select2', 'Select 2'),
], 'Selection')
many2one = fields.Many2One('test.export_data.target',
'Many2One')
many2many = fields.Many2Many('test.export_data.relation',
'many2many', 'target', 'Many2Many')
one2many = fields.One2Many('test.export_data.target', 'one2many',
'One2Many')
reference = fields.Reference('Reference', [
2012-12-13 19:18:37 +01:00
(None, ''),
('test.export_data.target', 'Target'),
])
2012-09-28 18:03:53 +02:00
class ExportDataTarget2:
2012-09-24 22:16:53 +02:00
'Export Date Target'
2016-02-07 16:46:16 +01:00
__metaclass__ = PoolMeta
2012-09-24 22:16:53 +02:00
__name__ = 'test.export_data.target'
one2many = fields.Many2One('test.export_data', 'Export Data')
2012-04-01 23:08:15 +02:00
class ExportDataRelation(ModelSQL):
"Export Data Many2Many"
2012-09-24 22:16:53 +02:00
__name__ = 'test.export_data.relation'
many2many = fields.Many2One('test.export_data', 'Export Data')
target = fields.Many2One('test.export_data.target', 'Target')