Browse Source

[MIG] partner_company_type: Migration to 11.0

pull/660/head
George Daramouskas 6 years ago
parent
commit
f16a8263af
No known key found for this signature in database GPG Key ID: 5B4EF742F8CD859C
  1. 3
      partner_company_type/README.rst
  2. 1
      partner_company_type/__init__.py
  3. 11
      partner_company_type/__manifest__.py
  4. 10
      partner_company_type/migrations/10.0.1.0.1/post-migration.py
  5. 1
      partner_company_type/models/__init__.py
  6. 5
      partner_company_type/models/res_partner.py
  7. 2
      partner_company_type/models/res_partner_company_type.py
  8. 3
      partner_company_type/tests/__init__.py
  9. 4
      partner_company_type/tests/test_company_type.py
  10. 3
      partner_company_type/views/res_partner_company_type.xml

3
partner_company_type/README.rst

@ -18,7 +18,7 @@ Usage
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/134/10.0
:target: https://runbot.odoo-community.org/runbot/134/11.0
Bug Tracker
@ -41,6 +41,7 @@ Contributors
------------
* Denis Roussel <denis.roussel@acsone.eu>
* George Daramouskas <gdaramouskas@therp.nl>
Maintainer
----------

1
partner_company_type/__init__.py

@ -1 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models

11
partner_company_type/__manifest__.py

@ -1,17 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
'name': 'Partner Company Type',
'summary': 'Adds a company type to partner that are companies',
'version': '10.0.1.0.1',
'version': '11.0.1.0.0',
'license': 'AGPL-3',
'author': 'ACSONE SA/NV,Odoo Community Association (OCA)',
'website': 'https://acsone.eu',
'website': 'https://github.com/OCA/partner-contact',
'depends': [
'base',
'sales_team',
'contacts',
],
'data': [
'security/res_partner_company_type.xml',

10
partner_company_type/migrations/10.0.1.0.1/post-migration.py

@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
def migrate(cr, version):
cr.execute(
'UPDATE res_partner SET partner_company_type_id = company_type_id'
)

1
partner_company_type/models/__init__.py

@ -1,2 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import res_partner_company_type
from . import res_partner

5
partner_company_type/models/res_partner.py

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
@ -10,5 +8,6 @@ class ResPartner(models.Model):
partner_company_type_id = fields.Many2one(
'res.partner.company.type',
string='Company Type'
string='Company Type',
oldname='company_type_id',
)

2
partner_company_type/models/res_partner_company_type.py

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models

3
partner_company_type/tests/__init__.py

@ -1,4 +1 @@
# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_company_type

4
partner_company_type/tests/test_company_type.py

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import TransactionCase
from odoo.tools.misc import mute_logger
from psycopg2 import IntegrityError
@mute_logger('odoo.sql_db')
class CompanyTypeTest(TransactionCase):
def setUp(self):

3
partner_company_type/views/res_partner_company_type.xml

@ -45,7 +45,6 @@
<field name="context">{}</field>
</record>
<!-- Odoo put partner title menu in sales_team... -->
<menuitem action="res_partner_company_type_act_window" id="menu_partner_company_type" name="Company Types" parent="sales_team.menu_config_address_book" sequence="4" groups="base.group_no_one"/>
<menuitem action="res_partner_company_type_act_window" id="menu_partner_company_type" name="Company Types" parent="contacts.menu_contacts" sequence="4" groups="base.group_no_one"/>
</odoo>
Loading…
Cancel
Save