Skip to content

Commit

Permalink
Merge PR #836 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by NL66278
  • Loading branch information
OCA-git-bot committed Jan 7, 2020
2 parents 7afeeee + 48b84c2 commit 44a4c87
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions partner_company_type/models/res_partner_company_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ class ResPartnerCompanyType(models.Model):
string='Abbreviation',
translate=True,
)
country_id = fields.Many2one(
comodel_name="res.country",
string="Country",
help="Allows this company type to be selected on partners from this "
"country only. "
"Leave it blank if you want it to appear on any partner.",
)

_sql_constraints = [('name_uniq', 'unique (name)',
"Partner Company Type already exists!")]
1 change: 1 addition & 0 deletions partner_company_type/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* Denis Roussel <denis.roussel@acsone.eu> (https://acsone.eu)
* Gilles Meyomesse <gilles.meyomesse@acsone.eu> (https://acsone.eu)
* Quentin Groulard <quentin.groulard@acsone.eu> (https://acsone.eu)
1 change: 1 addition & 0 deletions partner_company_type/views/res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<field name="arch" type="xml">
<field name="title" position="after">
<field name="partner_company_type_id" options='{"no_open": True}'
domain="['|', ('country_id', '=', False), ('country_id', '=', country_id)]"
attrs="{'invisible': [('is_company', '=', False)]}"/>
</field>
</field>
Expand Down
2 changes: 2 additions & 0 deletions partner_company_type/views/res_partner_company_type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<group col="4">
<field name="name"/>
<field name="shortcut"/>
<field name="country_id"/>
</group>
</form>
</field>
Expand All @@ -33,6 +34,7 @@
<tree>
<field name="name"/>
<field name="shortcut"/>
<field name="country_id"/>
</tree>
</field>
</record>
Expand Down

0 comments on commit 44a4c87

Please sign in to comment.