Skip to content

Commit

Permalink
Merge pull request #3 from dkrimmer84/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dkrimmer84 authored Jul 1, 2016
2 parents b61084c + 88a5754 commit 8d3239c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ This is how you can reach the contributors:

Dominic Krimmer: dominic@plastinorte.com
Hector Ivan Valencia Muñoz: quipus.total@gmail.com
test
12 changes: 11 additions & 1 deletion i18n/es_CO.po
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ msgstr "<b>¡Datos incompletos!</b><br/> Por favor, actualice pronto."
msgid "Birthday"
msgstr "Fecha de Nacimiento"

#. module: l10n_co_res_partner
#: model:ir.model.fields,field_description:l10n_co_res_partner.field_res_partner_companyBrandName
msgid "Brand"
msgstr "Marca"

#. module: l10n_co_res_partner
#: model:ir.ui.view,arch_db:l10n_co_res_partner.view_partner_form
msgid "Brand Name of the Company?"
msgstr "Nombre de la Marca"

#. module: l10n_co_res_partner
#: model:ir.actions.act_window,help:l10n_co_res_partner.action_ciiu_transaction
#: model:ir.actions.act_window,name:l10n_co_res_partner.action_ciiu_transaction
Expand Down Expand Up @@ -375,7 +385,7 @@ msgstr "NIT Formateado"
#: model:ir.model.fields,field_description:l10n_co_res_partner.field_res_partner_companyName
#: model:ir.ui.view,arch_db:l10n_co_res_partner.view_partner_form
msgid "Name of the Company"
msgstr "Nombre de la compañia"
msgstr "Nombre de la Compañia"

#. module: l10n_co_res_partner
#: selection:res.partner,personType:0
Expand Down
10 changes: 10 additions & 0 deletions i18n/l10n_co_res_partner.pot
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ msgstr ""
msgid "Birthday"
msgstr ""

#. module: l10n_co_res_partner
#: model:ir.model.fields,field_description:l10n_co_res_partner.field_res_partner_companyBrandName
msgid "Brand"
msgstr ""

#. module: l10n_co_res_partner
#: model:ir.ui.view,arch_db:l10n_co_res_partner.view_partner_form
msgid "Brand Name of the Company?"
msgstr ""

#. module: l10n_co_res_partner
#: model:ir.actions.act_window,help:l10n_co_res_partner.action_ciiu_transaction
#: model:ir.actions.act_window,name:l10n_co_res_partner.action_ciiu_transaction
Expand Down
17 changes: 14 additions & 3 deletions models/l10n_co_res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ class PartnerInfoExtended(models.Model):
_name = 'res.partner'
_inherit = 'res.partner'

# Company Name
# Company Name (legal name)
companyName = fields.Char("Name of the Company")

# Brand Name (e.j. Claro Móvil = Brand, COMCEL SA = legal name)
companyBrandName = fields.Char("Brand")

# companyType
companyType = fields.Selection(related='company_type')

Expand Down Expand Up @@ -184,7 +187,7 @@ def _compute_concat_nit(self):
self.dv = nitList[1]

@api.onchange('x_name1', 'x_name2', 'x_lastname1', 'x_lastname2', 'companyName',
'pos_name')
'pos_name', 'companyBrandName')
def _concat_name(self):
"""
This function concatenates the four name fields in order to be able to
Expand Down Expand Up @@ -229,7 +232,14 @@ def _concat_name(self):
formatedList.append(item)
self.name = ' ' .join(formatedList)
else:
self.name = self.companyName
# Some Companies are know for their Brand, which could conflict from the users point of view while
# searching the company (e.j. o2 = brand, Telefonica = Company)
if self.companyBrandName is not False:
delimiter = ', '
company_list = (self.companyBrandName, self.companyName)
self.name = delimiter.join(company_list)
else:
self.name = self.companyName

@api.onchange('name')
def onChangeName(self):
Expand Down Expand Up @@ -265,6 +275,7 @@ def onChangePersonType(self):
self.x_pn_retri = 7
elif self.personType is 1:
self.companyName = False
self.companyBrandName = False
self.x_pn_retri = False

@api.onchange('doctype')
Expand Down
3 changes: 3 additions & 0 deletions views/l10n_co_res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
<field name="companyName"
placeholder="Name of the Company"
attrs="{'invisible':['|',('personType', '=', 1),('company_type', '=', 'person')], 'required': [('personType', '=', 2)]}" />
<field name="companyBrandName"
placeholder="Brand Name of the Company?"
attrs="{'invisible':['|',('personType', '=', 1),('company_type', '=', 'person')]}" />
<field name="pos_name" placeholder="Point of Sales Name or Direction" attrs="{'invisible':['|',('type', '!=', 'delivery')], 'required': [('type', '=', 'delivery')]}" />
<field name="x_name1"
placeholder="First Name"
Expand Down

0 comments on commit 8d3239c

Please sign in to comment.