Skip to content

Commit

Permalink
[16.0][IMP] account_analytic_organization: Added company_id field, fi…
Browse files Browse the repository at this point in the history
…xed spanish translation and made organization name appear in partner name
  • Loading branch information
mpascuall committed Oct 28, 2024
1 parent 0a9ef48 commit da75895
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 20 deletions.
2 changes: 1 addition & 1 deletion account_analytic_organization/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 APSL - Nagarro
# Copyright 2024 APSL - Nagarro
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Analytic Organization",
Expand Down
18 changes: 12 additions & 6 deletions account_analytic_organization/i18n/ca_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-18 11:09+0000\n"
"PO-Revision-Date: 2024-09-18 11:09+0000\n"
"POT-Creation-Date: 2024-10-07 10:40+0000\n"
"PO-Revision-Date: 2024-10-07 10:40+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
Expand All @@ -20,7 +19,7 @@ msgstr ""
#: model:ir.actions.act_window,name:account_analytic_organization.account_analytic_organization_action
#: model:ir.model,name:account_analytic_organization.model_account_analytic_organization
msgid "Account Analytic Organization"
msgstr ""
msgstr "Organització Analítica"

#. module: account_analytic_organization
#: model:ir.model,name:account_analytic_organization.model_account_analytic_line
Expand All @@ -38,6 +37,11 @@ msgstr "Línia analítica"
msgid "Analytic Organization"
msgstr "Organització Analítica"

#. module: account_analytic_organization
#: model:ir.model.fields,field_description:account_analytic_organization.field_account_analytic_organization__company_id
msgid "Company"
msgstr "Empresa"

#. module: account_analytic_organization
#: model:ir.model,name:account_analytic_organization.model_res_partner
msgid "Contact"
Expand Down Expand Up @@ -88,5 +92,7 @@ msgstr "Darrera Actualització el"
msgid "Name"
msgstr "Nom"

#~ msgid "Old"
#~ msgstr "Antic"
#. module: account_analytic_organization
#: model:ir.model.fields,field_description:account_analytic_organization.field_account_analytic_organization__old_id
msgid "Old"
msgstr "Antiga"
20 changes: 13 additions & 7 deletions account_analytic_organization/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-18 11:11+0000\n"
"PO-Revision-Date: 2024-09-18 11:11+0000\n"
"POT-Creation-Date: 2024-10-07 10:41+0000\n"
"PO-Revision-Date: 2024-10-07 10:41+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
Expand All @@ -20,7 +19,7 @@ msgstr ""
#: model:ir.actions.act_window,name:account_analytic_organization.account_analytic_organization_action
#: model:ir.model,name:account_analytic_organization.model_account_analytic_organization
msgid "Account Analytic Organization"
msgstr ""
msgstr "Organización Analítica"

#. module: account_analytic_organization
#: model:ir.model,name:account_analytic_organization.model_account_analytic_line
Expand All @@ -36,7 +35,12 @@ msgstr "Línea analítica"
#: model_terms:ir.ui.view,arch_db:account_analytic_organization.view_account_analytic_line_search_inherit
#: model_terms:ir.ui.view,arch_db:account_analytic_organization.view_account_move_line_search_inherit
msgid "Analytic Organization"
msgstr "Organitzación Analítica"
msgstr "Organización Analítica"

#. module: account_analytic_organization
#: model:ir.model.fields,field_description:account_analytic_organization.field_account_analytic_organization__company_id
msgid "Company"
msgstr "Empresa"

#. module: account_analytic_organization
#: model:ir.model,name:account_analytic_organization.model_res_partner
Expand Down Expand Up @@ -88,5 +92,7 @@ msgstr "Última Actualización el"
msgid "Name"
msgstr "Nombre"

#~ msgid "Old"
#~ msgstr "Antiguo"
#. module: account_analytic_organization
#: model:ir.model.fields,field_description:account_analytic_organization.field_account_analytic_organization__old_id
msgid "Old"
msgstr "Antigua"
2 changes: 1 addition & 1 deletion account_analytic_organization/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 APSL - Nagarro
# Copyright 2024 APSL - Nagarro
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import res_partner
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 APSL - Nagarro
# Copyright 2024 APSL - Nagarro
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 APSL - Nagarro
# Copyright 2024 APSL - Nagarro
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models
Expand All @@ -9,3 +9,4 @@ class AccountAnalyticOrganization(models.Model):
_description = "Account Analytic Organization"

name = fields.Char(required=True)
company_id = fields.Many2one("res.company", string="Company")
2 changes: 1 addition & 1 deletion account_analytic_organization/models/account_move_line.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 APSL - Nagarro
# Copyright 2024 APSL - Nagarro
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models
Expand Down
8 changes: 7 additions & 1 deletion account_analytic_organization/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 APSL - Nagarro
# Copyright 2024 APSL - Nagarro
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models
Expand All @@ -10,3 +10,9 @@ class ResPartner(models.Model):
analytic_org_id = fields.Many2one(
"account.analytic.organization", string="Analytic Organization"
)

def _get_name(self):
name = super(ResPartner, self)._get_name()
if self.analytic_org_id:
name = f"{name} ({self.analytic_org_id.name})"
return name
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<field name="name">account.analytic.organization.tree</field>
<field name="model">account.analytic.organization</field>
<field name="arch" type="xml">
<tree editable="top"> <!-- O editable="top" -->
<tree editable="top">
<field name="name" />
<field name="company_id" />
</tree>
</field>
</record>
Expand Down

0 comments on commit da75895

Please sign in to comment.