-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '14.0' into odoo-addons14-purchase_line_qty_update_in_pi…
…cking
- Loading branch information
Showing
381 changed files
with
9,047 additions
and
572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import account_asset_line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
44
account_invoice_last_payment/i18n/account_invoice_last_payment.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" |
Oops, something went wrong.