Browse Source

[MIG] [10.0] base custom info

pull/1115/head
Fanha Giang 8 years ago
parent
commit
b51d3481f8
  1. 2
      base_custom_info/README.rst
  2. 4
      base_custom_info/__init__.py
  3. 14
      base_custom_info/__manifest__.py
  4. 6
      base_custom_info/models/__init__.py
  5. 2
      base_custom_info/models/custom_info.py
  6. 4
      base_custom_info/models/custom_info_category.py
  7. 2
      base_custom_info/models/custom_info_option.py
  8. 5
      base_custom_info/models/custom_info_property.py
  9. 4
      base_custom_info/models/custom_info_template.py
  10. 6
      base_custom_info/models/custom_info_value.py
  11. 2
      base_custom_info/models/res_partner.py
  12. 4
      base_custom_info/tests/test_partner.py
  13. 2
      base_custom_info/tests/test_value_conversion.py
  14. 2
      base_custom_info/views/custom_info_property_view.xml
  15. 2
      base_custom_info/views/custom_info_template_view.xml
  16. 4
      base_custom_info/wizard/__init__.py
  17. 2
      base_custom_info/wizard/base_config_settings.py

2
base_custom_info/README.rst

@ -203,7 +203,7 @@ To manage their values, you need to:
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/135/9.0
:target: https://runbot.odoo-community.org/runbot/135/10.0
Development
===========

4
base_custom_info/__init__.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. - Sergio Teruel
# © 2015 Antiun Ingeniería S.L. - Carlos Dauden
# Copyright 2015 Antiun Ingeniería S.L. - Sergio Teruel
# Copyright 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from . import models, wizard

14
base_custom_info/__manifest__.py

@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. - Sergio Teruel
# © 2015 Antiun Ingeniería S.L. - Carlos Dauden
# © 2015-2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
# Copyright 2015 Antiun Ingeniería S.L. - Sergio Teruel
# Copyright 2015 Antiun Ingeniería S.L. - Carlos Dauden
# Copyright 2015-2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
{
'name': "Base Custom Info",
'summary': "Add custom field in models",
'category': 'Tools',
'version': '9.0.2.0.0',
'version': '10.0.1.0.0',
'depends': [
'base_setup',
],
@ -40,8 +40,8 @@
],
'author': 'Tecnativa, '
'Odoo Community Association (OCA)',
'website': 'https://www.tecnativa.com',
'license': 'AGPL-3',
'website': 'https://github.com/OCA/server-tools',
'license': 'LGPL-3',
'application': True,
'installable': True,
}

6
base_custom_info/models/__init__.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. - Sergio Teruel
# © 2015 Antiun Ingeniería S.L. - Carlos Dauden
# © 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# Copyright 2015 Antiun Ingeniería S.L. - Sergio Teruel
# Copyright 2015 Antiun Ingeniería S.L. - Carlos Dauden
# Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from . import (

2
base_custom_info/models/custom_info.py

@ -5,7 +5,7 @@
# Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from openerp import api, fields, models
from odoo import api, fields, models
class CustomInfo(models.AbstractModel):

4
base_custom_info/models/custom_info_category.py

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# © 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from openerp import api, fields, models
from odoo import api, fields, models
class CustomInfoCategory(models.Model):

2
base_custom_info/models/custom_info_option.py

@ -3,7 +3,7 @@
# Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from openerp import api, fields, models
from odoo import api, fields, models
class CustomInfoOption(models.Model):

5
base_custom_info/models/custom_info_property.py

@ -3,8 +3,8 @@
# Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from openerp import _, api, fields, models
from openerp.exceptions import UserError, ValidationError
from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
class CustomInfoProperty(models.Model):
@ -83,7 +83,6 @@ class CustomInfoProperty(models.Model):
self.mapped("template_id").check_access_rule(operation)
return super(CustomInfoProperty, self).check_access_rule(operation)
@api.one
@api.constrains("default_value", "field_type")
def _check_default_value(self):
"""Ensure the default value is valid."""

4
base_custom_info/models/custom_info_template.py

@ -3,8 +3,8 @@
# Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from openerp import _, api, fields, models
from openerp.exceptions import ValidationError
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class CustomInfoTemplate(models.Model):

6
base_custom_info/models/custom_info_value.py

@ -2,9 +2,9 @@
# Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from openerp import _, api, fields, models, SUPERUSER_ID
from openerp.exceptions import ValidationError
from openerp.tools.safe_eval import safe_eval
from odoo import _, api, fields, models, SUPERUSER_ID
from odoo.exceptions import ValidationError
from odoo.tools.safe_eval import safe_eval
class CustomInfoValue(models.Model):

2
base_custom_info/models/res_partner.py

@ -3,7 +3,7 @@
# Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from openerp import fields, models
from odoo import fields, models
class ResPartner(models.Model):

4
base_custom_info/tests/test_partner.py

@ -3,8 +3,8 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from psycopg2 import IntegrityError
from openerp.exceptions import AccessError, ValidationError
from openerp.tests.common import TransactionCase
from odoo.exceptions import AccessError, ValidationError
from odoo.tests.common import TransactionCase
class PartnerCase(TransactionCase):

2
base_custom_info/tests/test_value_conversion.py

@ -3,7 +3,7 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import logging
from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
_logger = logging.getLogger(__name__)

2
base_custom_info/views/custom_info_property_view.xml

@ -49,7 +49,7 @@
attrs="{'invisible': [('field_type', 'not in', ['str', 'int', 'float'])]}"
/>
</group>
<group string="Options" col="1" attrs="{'invisible': [('field_type', '!=', 'id')]}">
<group name="Options" col="1" attrs="{'invisible': [('field_type', '!=', 'id')]}">
<label string="Select one of the existing options or create a new one clicking on 'Add an item'"/>
<field name="option_ids"
nolabel="1"

2
base_custom_info/views/custom_info_template_view.xml

@ -26,7 +26,7 @@
<field name="model"/>
<field name="model_id"/>
</group>
<group string="Properties">
<group name="Properties">
<field name="property_ids"
nolabel="1"
context="{'form_view_ref': 'base_custom_info.custom_info_property_form', 'tree_view_ref': 'base_custom_info.custom_info_property_tree'}"

4
base_custom_info/wizard/__init__.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. - Sergio Teruel
# © 2015 Antiun Ingeniería S.L. - Carlos Dauden
# Copyright 2015 Antiun Ingeniería S.L. - Sergio Teruel
# Copyright 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from . import base_config_settings

2
base_custom_info/wizard/base_config_settings.py

@ -2,7 +2,7 @@
# Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html
from openerp import fields, models
from odoo import fields, models
class BaseConfigSettings(models.TransientModel):

Loading…
Cancel
Save