Browse Source

[1.0.1] partner_company_type: Fix possible translation problem

pull/660/head
Denis Roussel 7 years ago
committed by George Daramouskas
parent
commit
59e75a26fd
No known key found for this signature in database GPG Key ID: 5B4EF742F8CD859C
  1. 5
      partner_company_type/README.rst
  2. 12
      partner_company_type/__manifest__.py
  3. 10
      partner_company_type/migrations/10.0.1.0.1/post-migration.py
  4. 6
      partner_company_type/models/res_partner.py
  5. 2
      partner_company_type/models/res_partner_company_type.py
  6. 25
      partner_company_type/views/res_partner.xml

5
partner_company_type/README.rst

@ -10,7 +10,7 @@ Adds a title to partner that are companies.
(Before: Partner Title in Odoo - limited to contacts now)
See :
:target: https://en.wikipedia.org/wiki/Types_of_business_entity
:target: https://en.wikipedia.org/wiki/Types_of_business_entity
Usage
=====
@ -20,9 +20,6 @@ Usage
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/134/10.0
.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
.. branch is "8.0" for example
Bug Tracker
===========

12
partner_company_type/__manifest__.py

@ -4,15 +4,15 @@
{
'name': 'Partner Company Type',
'summary': """
Adds a company type to partner that are companies""",
'version': '10.0.1.0.0',
'summary': 'Adds a company type to partner that are companies',
'version': '10.0.1.0.1',
'license': 'AGPL-3',
'author': 'ACSONE SA/NV,Odoo Community Association (OCA)',
'website': 'https://acsone.eu',
'depends': ['base',
'sales_team'
],
'depends': [
'base',
'sales_team',
],
'data': [
'security/res_partner_company_type.xml',
'views/res_partner_company_type.xml',

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

@ -0,0 +1,10 @@
# -*- 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'
)

6
partner_company_type/models/res_partner.py

@ -8,5 +8,7 @@ from odoo import fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
company_type_id = fields.Many2one('res.partner.company.type',
string='Company Type')
partner_company_type_id = fields.Many2one(
'res.partner.company.type',
string='Company Type'
)

2
partner_company_type/models/res_partner_company_type.py

@ -14,4 +14,4 @@ class ResPartnerCompanyType(models.Model):
shortcut = fields.Char(string='Abbreviation', translate=True)
_sql_constraints = [('name_uniq', 'unique (name)',
"Partner Company Type already exists !")]
"Partner Company Type already exists!")]

25
partner_company_type/views/res_partner.xml

@ -3,16 +3,15 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="view_partner_company_type_form" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="title" position="after">
<field name="company_type_id" options='{"no_open": True}'
attrs="{'invisible': [('is_company', '=', False)]}"/>
</field>
</field>
</record>
</odoo>
<record id="view_partner_company_type_form" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="title" position="after">
<field name="partner_company_type_id" options='{"no_open": True}'
attrs="{'invisible': [('is_company', '=', False)]}"/>
</field>
</field>
</record>
</odoo>
Loading…
Cancel
Save