diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/test_xlsx_export/models.py | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/test_xlsx_export/models.py')
| -rw-r--r-- | addons/test_xlsx_export/models.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/addons/test_xlsx_export/models.py b/addons/test_xlsx_export/models.py new file mode 100644 index 00000000..830917c0 --- /dev/null +++ b/addons/test_xlsx_export/models.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import api, fields, models + +class NewModel(models.Model): + _name = 'export.integer' + _description = 'Export: Integer' + + value = fields.Integer(default=4) + + def name_get(self): + return [(record.id, "%s:%s" % (self._name, record.value)) for record in self] + +class GroupOperator(models.Model): + _name = 'export.group_operator' + _description = 'Export Group Operator' + + int_sum = fields.Integer(group_operator='sum') + int_max = fields.Integer(group_operator='max') + float_min = fields.Float(group_operator='min') + float_avg = fields.Float(group_operator='avg') + float_monetary = fields.Monetary(currency_field='currency_id',group_operator='sum') + currency_id = fields.Many2one('res.currency') + date_max = fields.Date(group_operator='max') + bool_and = fields.Boolean(group_operator='bool_and') + bool_or = fields.Boolean(group_operator='bool_or') + many2one = fields.Many2one('export.integer') + one2many = fields.One2many('export.group_operator.one2many', 'parent_id') + +class GroupOperatorO2M(models.Model): + _name = 'export.group_operator.one2many' + _description = 'Export Group Operator One2Many' + + parent_id = fields.Many2one('export.group_operator') + value = fields.Integer() |
