Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ addon | version | maintainers | summary
[purchase_invoice_method](purchase_invoice_method/) | 17.0.1.0.0 | | Allow to force the invoice method of a purchase
[purchase_invoice_plan](purchase_invoice_plan/) | 17.0.1.0.1 | <a href='https://github.com/kittiu'><img src='https://github.com/kittiu.png' width='32' height='32' style='border-radius:50%;' alt='kittiu'/></a> | Add to purchases order, ability to manage future invoice plan
[purchase_invoice_status_line](purchase_invoice_status_line/) | 17.0.1.0.1 | <a href='https://github.com/JoanSForgeFlow'><img src='https://github.com/JoanSForgeFlow.png' width='32' height='32' style='border-radius:50%;' alt='JoanSForgeFlow'/></a> | Add invoice status on purchase order lines
[purchase_last_price_info](purchase_last_price_info/) | 17.0.1.0.2 | <a href='https://github.com/LoisRForgeFlow'><img src='https://github.com/LoisRForgeFlow.png' width='32' height='32' style='border-radius:50%;' alt='LoisRForgeFlow'/></a> | Purchase Product Last Price Info
[purchase_last_price_info](purchase_last_price_info/) | 17.0.1.0.3 | <a href='https://github.com/LoisRForgeFlow'><img src='https://github.com/LoisRForgeFlow.png' width='32' height='32' style='border-radius:50%;' alt='LoisRForgeFlow'/></a> | Purchase Product Last Price Info
[purchase_location_by_line](purchase_location_by_line/) | 17.0.1.0.1 | | Allows to define a specific destination location on each PO line
[purchase_lot](purchase_lot/) | 17.0.1.0.1 | <a href='https://github.com/florian-dacosta'><img src='https://github.com/florian-dacosta.png' width='32' height='32' style='border-radius:50%;' alt='florian-dacosta'/></a> | Purchase Lot
[purchase_manual_currency](purchase_manual_currency/) | 17.0.1.0.0 | | Allows to manual currency of Purchase
Expand Down
36 changes: 20 additions & 16 deletions purchase_last_price_info/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

================================
Purchase Product Last Price Info
================================
Expand All @@ -7,13 +11,13 @@ Purchase Product Last Price Info
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:20d574468508ab8940d1615f9b0f629d733e2a8fc178ca6964a6b53049996781
!! source digest: sha256:9d45d7ea56e008a57e0dc15269fc48e4cab9c315e06556a04d1a2ed3da38a165
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/license-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%2Fpurchase--workflow-lightgray.png?logo=github
Expand All @@ -40,7 +44,7 @@ Usage

In order to use this module, go to:

- Products -> Tab Purchase (see screenshot)
- Products -> Tab Purchase (see screenshot)

|Purchase Last Price Info|

Expand Down Expand Up @@ -68,22 +72,22 @@ Authors
Contributors
------------

- Alfredo de la Fuente <alfredodelafuente@avanzosc.es>
- Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
- Ana Juaristi <anajuaristi@avanzosc.es>
- Carlos Lopez Mite <celm1990@hotmail.com>
- Adria Gil Sorribes <adria.gil@forgeflow.com>
- Lois Rilo <lois.rilo@forgeflow.com>
- Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
- Vishnu Vanneri <vanneri.odoodev@gmail.com>
- `Tecnativa <https://www.tecnativa.com>`__:
- Alfredo de la Fuente <alfredodelafuente@avanzosc.es>
- Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
- Ana Juaristi <anajuaristi@avanzosc.es>
- Carlos Lopez Mite <celm1990@hotmail.com>
- Adria Gil Sorribes <adria.gil@forgeflow.com>
- Lois Rilo <lois.rilo@forgeflow.com>
- Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
- Vishnu Vanneri <vanneri.odoodev@gmail.com>
- `Tecnativa <https://www.tecnativa.com>`__:

- Víctor Martínez
- Pedro M. Baeza
- Víctor Martínez
- Pedro M. Baeza

- `Bloopark systems <https://www.bloopark.de/>`__:
- `Bloopark systems <https://www.bloopark.de/>`__:

- Achraf Mhadhbi <machraf@bloopark.de>
- Achraf Mhadhbi <machraf@bloopark.de>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion purchase_last_price_info/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "Purchase Product Last Price Info",
"version": "17.0.1.0.2",
"version": "17.0.1.0.3",
"category": "Purchase Management",
"license": "AGPL-3",
"author": "AvanzOSC, Tecnativa, Odoo Community Association (OCA)",
Expand Down
16 changes: 9 additions & 7 deletions purchase_last_price_info/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ class ProductProduct(models.Model):
@api.depends("last_purchase_line_ids.state")
def _compute_last_purchase_line_id(self):
for item in self:
item.last_purchase_line_id = fields.first(
item.last_purchase_line_ids.sudo().filtered_domain(
[
("state", "in", ["purchase", "done"]),
("company_id", "in", self.env.companies.ids),
]
)
candidate_lines = item.last_purchase_line_ids.sudo().filtered_domain(
[
("state", "in", ["purchase", "done"]),
("company_id", "in", self.env.companies.ids),
]
)
sorted_lines = candidate_lines.sorted(
key=lambda r: (r.date_order, r.id), reverse=True
)
item.last_purchase_line_id = fields.first(sorted_lines)

@api.depends("last_purchase_line_id")
def _compute_last_purchase_line_id_info(self):
Expand Down
16 changes: 9 additions & 7 deletions purchase_last_price_info/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ class ProductTemplate(models.Model):
@api.depends("last_purchase_line_ids.state")
def _compute_last_purchase_line_id(self):
for item in self:
item.last_purchase_line_id = fields.first(
item.last_purchase_line_ids.sudo().filtered_domain(
[
("state", "in", ["purchase", "done"]),
("company_id", "in", self.env.companies.ids),
]
)
candidate_lines = item.last_purchase_line_ids.sudo().filtered_domain(
[
("state", "in", ["purchase", "done"]),
("company_id", "in", self.env.companies.ids),
]
)
sorted_lines = candidate_lines.sorted(
key=lambda r: (r.date_order, r.id), reverse=True
)
item.last_purchase_line_id = fields.first(sorted_lines)

@api.depends("last_purchase_line_id")
def _compute_last_purchase_line_id_info(self):
Expand Down
39 changes: 24 additions & 15 deletions purchase_last_price_info/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Purchase Product Last Price Info</title>
<title>README.rst</title>
<style type="text/css">

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -359,16 +360,21 @@
</style>
</head>
<body>
<div class="document" id="purchase-product-last-price-info">
<h1 class="title">Purchase Product Last Price Info</h1>
<div class="document">


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="purchase-product-last-price-info">
<h1>Purchase Product Last Price Info</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:20d574468508ab8940d1615f9b0f629d733e2a8fc178ca6964a6b53049996781
!! source digest: sha256:9d45d7ea56e008a57e0dc15269fc48e4cab9c315e06556a04d1a2ed3da38a165
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/17.0/purchase_last_price_info"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_last_price_info"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/17.0/purchase_last_price_info"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_last_price_info"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds the last purchase info of the product.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand All @@ -384,32 +390,32 @@ <h1 class="title">Purchase Product Last Price Info</h1>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<p>In order to use this module, go to:</p>
<ul class="simple">
<li>Products -&gt; Tab Purchase (see screenshot)</li>
</ul>
<p><img alt="Purchase Last Price Info" src="https://raw.githubusercontent.com/OCA/purchase-workflow/17.0/purchase_last_price_info/static/description/purchase_last_price.png" /></p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_last_price_info%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
<ul class="simple">
<li>AvanzOSC</li>
<li>Tecnativa</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
<ul class="simple">
<li>Alfredo de la Fuente &lt;<a class="reference external" href="mailto:alfredodelafuente&#64;avanzosc.es">alfredodelafuente&#64;avanzosc.es</a>&gt;</li>
<li>Oihane Crucelaegui &lt;<a class="reference external" href="mailto:oihanecrucelaegi&#64;avanzosc.es">oihanecrucelaegi&#64;avanzosc.es</a>&gt;</li>
Expand All @@ -431,9 +437,11 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
Expand All @@ -444,5 +452,6 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
</div>
</div>
</div>
</div>
</body>
</html>
Loading