Skip to content

Commit

Permalink
Merge branch '14.0' into odoo-addons14-purchase_line_qty_update_in_pi…
Browse files Browse the repository at this point in the history
…cking
  • Loading branch information
anajuaristi authored Feb 3, 2025
2 parents c7fee10 + fb98933 commit 821b6f9
Show file tree
Hide file tree
Showing 381 changed files with 9,047 additions and 572 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ def _action_process(self):
and not self.import_id.update_data
):
same_asset_lines = self.import_id.import_line_ids.filtered(
lambda c: c.account_asset_name == (self.account_asset_name)
and c.account_asset_ref == self.account_asset_ref
lambda c: c.account_asset_id == self.account_asset_id
)
if same_asset_lines:
if any([line.state == "error" for line in same_asset_lines]):
Expand Down
1 change: 1 addition & 0 deletions account_asset_line_menu/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Account asset line menu
=======================

* New menu "Assets lines".
* Take related fields from assets to assets lines.

Bug Tracker
===========
Expand Down
1 change: 1 addition & 0 deletions account_asset_line_menu/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
47 changes: 43 additions & 4 deletions account_asset_line_menu/i18n/account_asset_line_menu.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,27 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-05 08:31+0000\n"
"PO-Revision-Date: 2024-03-05 08:31+0000\n"
"POT-Creation-Date: 2024-10-31 10:23+0000\n"
"PO-Revision-Date: 2024-10-31 10:23+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_filter
msgid "Account Analytic"
msgstr ""

#. module: account_asset_line_menu
#: model:ir.model.fields,field_description:account_asset_line_menu.field_account_asset_line__account_analytic_id
msgid "Analytic account"
msgstr ""

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_tree
msgid "Are you sure ?"
Expand All @@ -25,10 +35,19 @@ msgstr ""
msgid "Asset"
msgstr ""

#. module: account_asset_line_menu
#: model:ir.model.fields,field_description:account_asset_line_menu.field_account_asset_line__profile_id
msgid "Asset Profile"
msgstr ""

#. module: account_asset_line_menu
#: model:ir.model,name:account_asset_line_menu.model_account_asset_line
msgid "Asset depreciation table line"
msgstr ""

#. module: account_asset_line_menu
#: model:ir.actions.act_window,name:account_asset_line_menu.account_asset_line_action
#: model:ir.ui.menu,name:account_asset_line_menu.menu_account_asset_line
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_tree
msgid "Assets Lines"
msgstr ""

Expand All @@ -47,16 +66,36 @@ msgstr ""
msgid "Delete/Reverse Move"
msgstr ""

#. module: account_asset_line_menu
#: model:ir.model.fields,field_description:account_asset_line_menu.field_account_asset_line__display_name
msgid "Display Name"
msgstr ""

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_filter
msgid "Group By"
msgstr ""

#. module: account_asset_line_menu
#: model:ir.model.fields,field_description:account_asset_line_menu.field_account_asset_line__id
msgid "ID"
msgstr ""

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_tree
msgid "Init"
msgstr ""

#. module: account_asset_line_menu
#: model:ir.model.fields,field_description:account_asset_line_menu.field_account_asset_line____last_update
msgid "Last Modified on"
msgstr ""

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_filter
msgid "Profile"
msgstr ""

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_filter
msgid "Search Assets Lines"
Expand Down
46 changes: 42 additions & 4 deletions account_asset_line_menu/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-05 08:31+0000\n"
"PO-Revision-Date: 2024-03-05 08:31+0000\n"
"POT-Creation-Date: 2024-10-31 10:24+0000\n"
"PO-Revision-Date: 2024-10-31 10:24+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_filter
msgid "Account Analytic"
msgstr "Cuenta analítica"

#. module: account_asset_line_menu
#: model:ir.model.fields,field_description:account_asset_line_menu.field_account_asset_line__account_analytic_id
msgid "Analytic account"

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_tree
msgid "Are you sure ?"
Expand All @@ -25,10 +34,19 @@ msgstr "¿Está usted seguro"
msgid "Asset"
msgstr "Activo"

#. module: account_asset_line_menu
#: model:ir.model.fields,field_description:account_asset_line_menu.field_account_asset_line__profile_id
msgid "Asset Profile"
msgstr "Categoría del activo"

#. module: account_asset_line_menu
#: model:ir.model,name:account_asset_line_menu.model_account_asset_line
msgid "Asset depreciation table line"
msgstr "Línea de amortización del activo"

#. module: account_asset_line_menu
#: model:ir.actions.act_window,name:account_asset_line_menu.account_asset_line_action
#: model:ir.ui.menu,name:account_asset_line_menu.menu_account_asset_line
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_tree
msgid "Assets Lines"
msgstr "Líneas de activos"

Expand All @@ -47,16 +65,36 @@ msgstr "Fecha"
msgid "Delete/Reverse Move"
msgstr "Borrar/Deshacer movimiento"

#. module: account_asset_line_menu
#: model:ir.model.fields,field_description:account_asset_line_menu.field_account_asset_line__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_filter
msgid "Group By"
msgstr "Agrupar por"

#. module: account_asset_line_menu
#: model:ir.model.fields,field_description:account_asset_line_menu.field_account_asset_line__id
msgid "ID"
msgstr ""

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_tree
msgid "Init"
msgstr "Inicio"

#. module: account_asset_line_menu
#: model:ir.model.fields,field_description:account_asset_line_menu.field_account_asset_line____last_update
msgid "Last Modified on"
msgstr "Última modificación el"

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_filter
msgid "Profile"
msgstr "Categoría"

#. module: account_asset_line_menu
#: model_terms:ir.ui.view,arch_db:account_asset_line_menu.account_asset_line_view_filter
msgid "Search Assets Lines"
Expand Down
1 change: 1 addition & 0 deletions account_asset_line_menu/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_asset_line
21 changes: 21 additions & 0 deletions account_asset_line_menu/models/account_asset_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Berezi Amubieta - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class AccountAssetLine(models.Model):
_inherit = "account.asset.line"

profile_id = fields.Many2one(
comodel_name="account.asset.profile", related="asset_id.profile_id", store=True
)
account_analytic_id = fields.Many2one(
comodel_name="account.analytic.account",
related="asset_id.account_analytic_id",
store=True,
)
code = fields.Char(
related="asset_id.code",
store=True,
)
16 changes: 16 additions & 0 deletions account_asset_line_menu/views/account_asset_line_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
create="false"
>
<field name="asset_id" readonly="1" optional="show" />
<field name="code" />
<field name="type" optional="show" />
<field name="profile_id" optional="show" />
<field name="account_analytic_id" optional="show" />
<field
name="line_date"
optional="show"
Expand Down Expand Up @@ -65,6 +68,7 @@
<field name="arch" type="xml">
<search string="Search Assets Lines">
<field name="asset_id" />
<field name="code" />
<field name="type" />
<field name="line_date" />
<group expand="0" string="Group By">
Expand All @@ -79,6 +83,18 @@
name="group-type"
domain="[]"
context="{'group_by': 'type'}"
/>
<filter
string="Profile"
name="profile"
domain="[]"
context="{'group_by': 'profile_id'}"
/>
<filter
string="Account Analytic"
name="account_analytic"
domain="[]"
context="{'group_by': 'account_analytic_id'}"
/>
<filter
string="Date"
Expand Down
2 changes: 2 additions & 0 deletions account_invoice_last_payment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import pre_init_hook, post_init_hook
21 changes: 21 additions & 0 deletions account_invoice_last_payment/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Oihane Crucelaegui - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
"name": "Account Invoice Last Payment",
"version": "14.0.1.0.0",
"category": "Accounting",
"license": "AGPL-3",
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/odoo-addons",
"depends": [
"account",
],
"excludes": [],
"data": [
"views/account_move_views.xml",
],
"installable": True,
"pre_init_hook": "pre_init_hook",
"post_init_hook": "post_init_hook",
}
51 changes: 51 additions & 0 deletions account_invoice_last_payment/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2025 Oihane Crucelaegui - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

import logging

try:
from openupgradelib import openupgrade
except Exception:
from odoo.tools import sql as openupgrade

from odoo import SUPERUSER_ID, api

_logger = logging.getLogger(__name__)


def pre_init_hook(cr):
"""
Prepare new computed fields.
"""
_logger.info("Pre-creating column last_payment_date for table account_move")
if not openupgrade.column_exists(cr, "account_move", "last_payment_date"):
cr.execute(
"""
ALTER TABLE account_move
ADD COLUMN last_payment_date DATE;
COMMENT ON COLUMN account_move.last_payment_date
IS 'Last Payment Date';
"""
)


def post_init_hook(cr, registry):
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
force_compute_last_payment_date(env)


def force_compute_last_payment_date(env):
"""Force compute last payment date
Since field `last_payment_date` is not automatically computed upon
module installation, we need to compute it manually on existing records.
:param env: an Odoo Environment instance
"""
domain = [
("payment_state", "not in", ("not_paid", False)),
]
invs = env["account.move"].search(domain)
_logger.info("Force-compute last payment date on %s invoices" % len(invs))
invs._compute_last_payment_date()
44 changes: 44 additions & 0 deletions account_invoice_last_payment/i18n/account_invoice_last_payment.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_last_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-14 12:55+0000\n"
"PO-Revision-Date: 2025-01-14 12:55+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: account_invoice_last_payment
#: model:ir.model.fields,field_description:account_invoice_last_payment.field_account_move__display_name
msgid "Display Name"
msgstr ""

#. module: account_invoice_last_payment
#: model:ir.model.fields,field_description:account_invoice_last_payment.field_account_move__id
msgid "ID"
msgstr ""

#. module: account_invoice_last_payment
#: model:ir.model,name:account_invoice_last_payment.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: account_invoice_last_payment
#: model:ir.model.fields,field_description:account_invoice_last_payment.field_account_move____last_update
msgid "Last Modified on"
msgstr ""

#. module: account_invoice_last_payment
#: model:ir.model.fields,field_description:account_invoice_last_payment.field_account_bank_statement_line__last_payment_date
#: model:ir.model.fields,field_description:account_invoice_last_payment.field_account_move__last_payment_date
#: model:ir.model.fields,field_description:account_invoice_last_payment.field_account_payment__last_payment_date
#: model_terms:ir.ui.view,arch_db:account_invoice_last_payment.account_move_view_search
msgid "Last Payment Date"
msgstr ""
Loading

0 comments on commit 821b6f9

Please sign in to comment.