-
Notifications
You must be signed in to change notification settings - Fork 73
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-account_invoice_margin' of github.com:unaiberis/od…
…oo-addons into 14.0-account_invoice_margin
- Loading branch information
Showing
14 changed files
with
304 additions
and
15 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
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,33 @@ | ||
========================= | ||
Account invoice paid data | ||
========================= | ||
|
||
.. |badge1| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
|badge1| | ||
|
||
This module extends accounting for Gausark: | ||
|
||
* paid date field in invoices tree that is filled when payment state changes to paid | ||
* payment period field, days between invoice date and paid date | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Avanzosc | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es> | ||
* Ana Juaristi <anajuaristi@avanzosc.es> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2023 Oihane Crucelaegui - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "Account invoice paid data", | ||
"version": "14.0.1.1.0", | ||
"category": "Hidden", | ||
"license": "AGPL-3", | ||
"author": "AvanzOSC", | ||
"website": "https://github.com/avanzosc/odoo-addons", | ||
"depends": ["account", "account_move_template"], | ||
"excludes": [], | ||
"data": [ | ||
"views/account_move_views.xml", | ||
], | ||
"installable": True, | ||
} |
63 changes: 63 additions & 0 deletions
63
account_invoice_paid_data/i18n/account_invoice_paid_data.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,63 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * account_invoice_paid_data | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-11-07 14:40+0000\n" | ||
"PO-Revision-Date: 2024-11-07 14:40+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_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move__display_name | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move_template__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move__id | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move_template__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model,name:account_invoice_paid_data.model_account_move | ||
msgid "Journal Entry" | ||
msgstr "" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model,name:account_invoice_paid_data.model_account_move_template | ||
msgid "Journal Entry Template" | ||
msgstr "" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move____last_update | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move_template____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move_template__line_ids | ||
msgid "Lines" | ||
msgstr "" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_bank_statement_line__paid_date | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move__paid_date | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_payment__paid_date | ||
msgid "Paid Date" | ||
msgstr "" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_bank_statement_line__payment_period | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move__payment_period | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_payment__payment_period | ||
msgid "Payment Period" | ||
msgstr "" |
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,63 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * account_invoice_paid_data | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-11-07 14:40+0000\n" | ||
"PO-Revision-Date: 2024-11-07 14:40+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_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move__display_name | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move_template__display_name | ||
msgid "Display Name" | ||
msgstr "Mostrar nombre" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move__id | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move_template__id | ||
msgid "ID" | ||
msgstr "Identificador" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model,name:account_invoice_paid_data.model_account_move | ||
msgid "Journal Entry" | ||
msgstr "Asiento contable" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model,name:account_invoice_paid_data.model_account_move_template | ||
msgid "Journal Entry Template" | ||
msgstr "Plantilla de asiento" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move____last_update | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move_template____last_update | ||
msgid "Last Modified on" | ||
msgstr "Última modificación el" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move_template__line_ids | ||
msgid "Lines" | ||
msgstr "Líneas" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_bank_statement_line__paid_date | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move__paid_date | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_payment__paid_date | ||
msgid "Paid Date" | ||
msgstr "Fecha de pago" | ||
|
||
#. module: account_invoice_paid_data | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_bank_statement_line__payment_period | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_move__payment_period | ||
#: model:ir.model.fields,field_description:account_invoice_paid_data.field_account_payment__payment_period | ||
msgid "Payment Period" | ||
msgstr "Periodo de pago" |
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 account_move_template | ||
from . import account_move |
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,38 @@ | ||
# Copyright 2023 Oihane Crucelaegui - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class AccountMove(models.Model): | ||
_inherit = "account.move" | ||
|
||
paid_date = fields.Date( | ||
compute="_compute_paid_date", | ||
store=True, | ||
copy=False, | ||
readonly=True, | ||
) | ||
payment_period = fields.Integer( | ||
compute="_compute_payment_period", | ||
store=True, | ||
copy=False, | ||
readonly=True, | ||
) | ||
|
||
@api.depends("payment_state") | ||
def _compute_paid_date(self): | ||
for move in self: | ||
move.paid_date = ( | ||
fields.Date.context_today(move) | ||
if move.payment_state == "paid" | ||
else False | ||
) | ||
|
||
@api.depends("paid_date", "invoice_date") | ||
def _compute_payment_period(self): | ||
for move in self: | ||
period = 0 | ||
if move.paid_date and move.invoice_date: | ||
period = (move.paid_date - move.invoice_date).days | ||
move.payment_period = period |
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,9 @@ | ||
# Copyright 2023 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo import fields, models | ||
|
||
|
||
class AccountMoveTemplate(models.Model): | ||
_inherit = "account.move.template" | ||
|
||
line_ids = fields.One2many(copy=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record id="account_move_view_tree" model="ir.ui.view"> | ||
<field name="model">account.move</field> | ||
<field name="inherit_id" ref="account.view_invoice_tree" /> | ||
<field name="arch" type="xml"> | ||
<field name="payment_state" position="after"> | ||
<field name="paid_date" optional="show" /> | ||
<field | ||
name="payment_period" | ||
optional="show" | ||
attrs="{'invisible': ['|', ('paid_date', '=', False), ('invoice_date', '=', False)]}" | ||
/> | ||
</field> | ||
</field> | ||
</record> | ||
</odoo> |
1 change: 1 addition & 0 deletions
1
setup/account_invoice_paid_data/odoo/addons/account_invoice_paid_data
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 @@ | ||
../../../../account_invoice_paid_data |
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,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |