Browse Source

Merge PR #1662 into 12.0

Signed-off-by sebastienbeau
12.0
OCA-git-bot 5 years ago
parent
commit
7f62d636b3
  1. 1
      base_jsonify/models/ir_exports_line.py
  2. 27
      base_jsonify/tests/test_get_parser.py

1
base_jsonify/models/ir_exports_line.py

@ -7,7 +7,6 @@ from odoo import api, fields, models, _
class IrExportsLine(models.Model):
_inherit = 'ir.exports.line'
_order = 'name'
alias = fields.Char(
'Alias',

27
base_jsonify/tests/test_get_parser.py

@ -8,30 +8,33 @@ class TestParser(TransactionCase):
def test_getting_parser(self):
expected_parser = [
'name',
'active',
'credit_limit',
'color',
('category_id', ['name']),
('child_ids', [(
'child_ids', ['name']),
('country_id', ['code', 'name']),
'email', 'id',
'name'
('country_id', ['name', 'code']),
('child_ids', [
'name',
'id',
'email',
('country_id', ['name', 'code']),
('child_ids', ['name']),
]),
'color',
'comment',
('country_id', ['code', 'name']),
'credit_limit',
'lang',
'name']
'comment'
]
exporter = self.env.ref('base_jsonify.ir_exp_partner')
parser = exporter.get_json_parser()
self.assertEqual(parser, expected_parser)
self.assertListEqual(parser, expected_parser)
# modify an ir.exports_line to put an alias for a field
self.env.ref('base_jsonify.category_id_name').write({
'alias': 'category_id:category/name'
})
expected_parser[1] = ('category_id:category', ['name'])
expected_parser[4] = ('category_id:category', ['name'])
parser = exporter.get_json_parser()
self.assertEqual(parser, expected_parser)

Loading…
Cancel
Save