-
-
Notifications
You must be signed in to change notification settings - Fork 700
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
19 changed files
with
837 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
=================================== | ||
Product From Account Move Line Link | ||
=================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:c66f8eed82c46d7964f692f3d3aa1bf60529d4ec3539dc7a53ea4e53d3ebaa40 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| 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 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github | ||
:target: https://github.com/OCA/account-invoicing/tree/17.0/product_form_account_move_line_link | ||
:alt: OCA/account-invoicing | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/account-invoicing-17-0/account-invoicing-17-0-product_form_account_move_line_link | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Adds a button on product forms to access Journal Items | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
Go to Products > Products or Products > Product Variants tab on any of | ||
the Sales, Purchase or Inventory apps. | ||
|
||
Click on the button 'Journal Items' with the list icon | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20product_form_account_move_line_link%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* ForgeFlow | ||
|
||
Contributors | ||
------------ | ||
|
||
- Jaume Bernaus <[email protected]> | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/17.0/product_form_account_move_line_link>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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,20 @@ | ||
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "Product From Account Move Line Link", | ||
"summary": """ | ||
Adds a button on product forms to access Journal Items""", | ||
"version": "17.0.1.0.0", | ||
"author": "ForgeFlow, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/account-invoicing", | ||
"category": "Account", | ||
"license": "AGPL-3", | ||
"depends": ["account"], | ||
"data": [ | ||
"views/account_move_line_views.xml", | ||
"views/product_product_views.xml", | ||
"views/product_template_views.xml", | ||
], | ||
"installable": 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,41 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_form_account_move_line_link | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2024-01-27 14:33+0000\n" | ||
"Last-Translator: Ivorra78 <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: es\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.17\n" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model.fields,field_description:product_form_account_move_line_link.field_product_product__account_move_lines_count | ||
#: model:ir.model.fields,field_description:product_form_account_move_line_link.field_product_template__account_move_lines_count | ||
msgid "Invoiced" | ||
msgstr "Facturada" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.actions.act_window,name:product_form_account_move_line_link.action_account_move_line_product_product_tree | ||
#: model:ir.actions.act_window,name:product_form_account_move_line_link.action_account_move_line_product_tree | ||
#: model_terms:ir.ui.view,arch_db:product_form_account_move_line_link.product_normal_form_view_inherit | ||
#: model_terms:ir.ui.view,arch_db:product_form_account_move_line_link.product_template_only_form_view_inherit | ||
msgid "Journal Items" | ||
msgstr "Artículos Diarios" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model,name:product_form_account_move_line_link.model_product_template | ||
msgid "Product" | ||
msgstr "Producto" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model,name:product_form_account_move_line_link.model_product_product | ||
msgid "Product Variant" | ||
msgstr "Variante de Producto" |
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,41 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_form_account_move_line_link | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2024-02-23 14:36+0000\n" | ||
"Last-Translator: mymage <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: it\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.17\n" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model.fields,field_description:product_form_account_move_line_link.field_product_product__account_move_lines_count | ||
#: model:ir.model.fields,field_description:product_form_account_move_line_link.field_product_template__account_move_lines_count | ||
msgid "Invoiced" | ||
msgstr "Fatturato" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.actions.act_window,name:product_form_account_move_line_link.action_account_move_line_product_product_tree | ||
#: model:ir.actions.act_window,name:product_form_account_move_line_link.action_account_move_line_product_tree | ||
#: model_terms:ir.ui.view,arch_db:product_form_account_move_line_link.product_normal_form_view_inherit | ||
#: model_terms:ir.ui.view,arch_db:product_form_account_move_line_link.product_template_only_form_view_inherit | ||
msgid "Journal Items" | ||
msgstr "Movimenti contabili" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model,name:product_form_account_move_line_link.model_product_template | ||
msgid "Product" | ||
msgstr "Prodotto" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model,name:product_form_account_move_line_link.model_product_product | ||
msgid "Product Variant" | ||
msgstr "Variante prodotto" |
38 changes: 38 additions & 0 deletions
38
product_form_account_move_line_link/i18n/product_form_account_move_line_link.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,38 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_form_account_move_line_link | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \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: product_form_account_move_line_link | ||
#: model:ir.model.fields,field_description:product_form_account_move_line_link.field_product_product__account_move_lines_count | ||
#: model:ir.model.fields,field_description:product_form_account_move_line_link.field_product_template__account_move_lines_count | ||
msgid "Invoiced" | ||
msgstr "" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.actions.act_window,name:product_form_account_move_line_link.action_account_move_line_product_product_tree | ||
#: model:ir.actions.act_window,name:product_form_account_move_line_link.action_account_move_line_product_tree | ||
#: model_terms:ir.ui.view,arch_db:product_form_account_move_line_link.product_normal_form_view_inherit | ||
#: model_terms:ir.ui.view,arch_db:product_form_account_move_line_link.product_template_only_form_view_inherit | ||
msgid "Journal Items" | ||
msgstr "" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model,name:product_form_account_move_line_link.model_product_template | ||
msgid "Product" | ||
msgstr "" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model,name:product_form_account_move_line_link.model_product_product | ||
msgid "Product Variant" | ||
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,41 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_form_account_move_line_link | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-12-21 16:35+0000\n" | ||
"Last-Translator: Adriano Prado <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: pt_BR\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n > 1;\n" | ||
"X-Generator: Weblate 4.17\n" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model.fields,field_description:product_form_account_move_line_link.field_product_product__account_move_lines_count | ||
#: model:ir.model.fields,field_description:product_form_account_move_line_link.field_product_template__account_move_lines_count | ||
msgid "Invoiced" | ||
msgstr "Faturado" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.actions.act_window,name:product_form_account_move_line_link.action_account_move_line_product_product_tree | ||
#: model:ir.actions.act_window,name:product_form_account_move_line_link.action_account_move_line_product_tree | ||
#: model_terms:ir.ui.view,arch_db:product_form_account_move_line_link.product_normal_form_view_inherit | ||
#: model_terms:ir.ui.view,arch_db:product_form_account_move_line_link.product_template_only_form_view_inherit | ||
msgid "Journal Items" | ||
msgstr "Itens Diário" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model,name:product_form_account_move_line_link.model_product_template | ||
msgid "Product" | ||
msgstr "Produto" | ||
|
||
#. module: product_form_account_move_line_link | ||
#: model:ir.model,name:product_form_account_move_line_link.model_product_product | ||
msgid "Product Variant" | ||
msgstr "Variante do Produto" |
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 product_product | ||
from . import product_template |
29 changes: 29 additions & 0 deletions
29
product_form_account_move_line_link/models/product_product.py
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,29 @@ | ||
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ProductProduct(models.Model): | ||
_inherit = "product.product" | ||
|
||
account_move_lines_count = fields.Integer( | ||
compute="_compute_account_move_lines_count", string="Invoiced" | ||
) | ||
|
||
def _compute_account_move_lines_count(self): | ||
if not self.user_has_groups("account.group_account_invoice") or not self.ids: | ||
self.purchase_lines_count = 0 | ||
return | ||
domain = [ | ||
("product_id", "in", self.ids), | ||
("company_id", "in", self.env.companies.ids), | ||
] | ||
account_move_line_data = self.env["account.move.line"].read_group( | ||
domain, ["product_id"], ["product_id"] | ||
) | ||
mapped_data = { | ||
m["product_id"][0]: m["product_id_count"] for m in account_move_line_data | ||
} | ||
for product in self: | ||
product.account_move_lines_count = mapped_data.get(product.id, 0) |
21 changes: 21 additions & 0 deletions
21
product_form_account_move_line_link/models/product_template.py
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 2023 ForgeFlow S.L. (https://www.forgeflow.com) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class ProductTemplate(models.Model): | ||
_inherit = "product.template" | ||
|
||
account_move_lines_count = fields.Integer( | ||
compute="_compute_account_move_lines_count", string="Invoiced" | ||
) | ||
|
||
@api.depends("product_variant_ids.account_move_lines_count") | ||
def _compute_account_move_lines_count(self): | ||
for product in self: | ||
product.account_move_lines_count = sum( | ||
p.account_move_lines_count | ||
for p in product.with_context(active_test=False).product_variant_ids | ||
) |
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,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
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 @@ | ||
- Jaume Bernaus \<<[email protected]>\> |
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 @@ | ||
Adds a button on product forms to access Journal Items |
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,4 @@ | ||
Go to Products \> Products or Products \> Product Variants tab on any of | ||
the Sales, Purchase or Inventory apps. | ||
|
||
Click on the button 'Journal Items' with the list icon |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.