forked from OCA/sale-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] sale_order_line_price_history: Set history price from wizard tree
- Set history price from wizard tree lines with a new widget: Apply changes in place the value of price_unit and discount - Parameter to limit order lines displayed: Limit the number of sale order lines displayed on the wizard by system parameter - Improved UX: Rearrange buttons, small icons, added tooltips, removed statusbar button from line form Co-authored-by: Carlos Roca <[email protected]>
- Loading branch information
1 parent
579fa3f
commit b73b110
Showing
15 changed files
with
219 additions
and
117 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 |
---|---|---|
|
@@ -42,7 +42,10 @@ Usage | |
|
||
To use this module, you need to: | ||
|
||
#. Go to *Sales -> Quotations* and select a Quotation. | ||
#. Go to System Parameters and configure the | ||
``sale_order_line_price_history.order_line_limit`` parameter to limit the | ||
number of Sale Order Lines to show on the Wizard. | ||
#. Go to *Sales -> Quotations* and select a Quotation. Default is 20 lines. | ||
#. Click on the new clock button in one of the sale order lines. | ||
#. A pop-up will open and you will see the *price history* for the product of | ||
the sale order line and for the customer of the sale order. | ||
|
@@ -55,15 +58,7 @@ To use this module, you need to: | |
Known issues / Roadmap | ||
====================== | ||
|
||
* The number of entries of prices history in the wizard should be configurable, | ||
currently it is limited to 20. | ||
* A backend tour would be nice to have. | ||
* It is not possible to set a price from the tree view of the wizard lines, | ||
currently it can only be done from the form view of those lines | ||
(by clicking on one of them). This is not solved by simply putting a | ||
'Set price' button in the wizard lines because that button will be | ||
disabled since when the wizard is launched there is still no wizard | ||
record in the database (this is an Odoo limitation). | ||
|
||
Bug Tracker | ||
=========== | ||
|
@@ -91,10 +86,12 @@ Contributors | |
* Pedro M. Baeza | ||
* Ernesto Tejeda | ||
* David Vidal | ||
* Carlos Roca | ||
|
||
* Serpent Consulting Services Pvt. Ltd. <[email protected]> | ||
* Dhara Solanki <[email protected]> | ||
* Ruchir Shukla <[email protected]> | ||
* Eduardo de Miguel (`Moduon <https://www.moduon.team/>`__) | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
@@ -109,6 +106,20 @@ 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. | ||
|
||
.. |maintainer-ernestotejeda| image:: https://github.com/ernestotejeda.png?size=40px | ||
:target: https://github.com/ernestotejeda | ||
:alt: ernestotejeda | ||
.. |maintainer-CarlosRoca13| image:: https://github.com/CarlosRoca13.png?size=40px | ||
:target: https://github.com/CarlosRoca13 | ||
:alt: CarlosRoca13 | ||
.. |maintainer-Shide| image:: https://github.com/Shide.png?size=40px | ||
:target: https://github.com/Shide | ||
:alt: Shide | ||
|
||
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-ernestotejeda| |maintainer-CarlosRoca13| |maintainer-Shide| | ||
|
||
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/16.0/sale_order_line_price_history>`_ 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
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 |
---|---|---|
|
@@ -4,18 +4,18 @@ | |
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 11.0\n" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2019-03-25 16:55+0000\n" | ||
"PO-Revision-Date: 2023-07-25 12:10+0000\n" | ||
"Last-Translator: Ivorra78 <[email protected]>\n" | ||
"POT-Creation-Date: 2024-01-18 12:02+0000\n" | ||
"PO-Revision-Date: 2024-01-18 13:02+0100\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \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" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
"X-Generator: Poedit 3.4\n" | ||
|
||
#. module: sale_order_line_price_history | ||
#: model_terms:ir.ui.view,arch_db:sale_order_line_price_history.sale_order_line_price_history_view_form | ||
|
@@ -75,7 +75,7 @@ msgstr "Líneas de historial de precios" | |
#: model:ir.model.fields,field_description:sale_order_line_price_history.field_sale_order_line_price_history__id | ||
#: model:ir.model.fields,field_description:sale_order_line_price_history.field_sale_order_line_price_history_line__id | ||
msgid "ID" | ||
msgstr "ID" | ||
msgstr "" | ||
|
||
#. module: sale_order_line_price_history | ||
#: model:ir.model.fields,field_description:sale_order_line_price_history.field_sale_order_line_price_history__include_quotations | ||
|
@@ -136,7 +136,11 @@ msgid "Order Reference" | |
msgstr "Referencia del pedido" | ||
|
||
#. module: sale_order_line_price_history | ||
#. odoo-javascript | ||
#: code:addons/sale_order_line_price_history/static/src/xml/sale_line_price_history_widget.xml:0 | ||
#: model_terms:ir.ui.view,arch_db:sale_order_line_price_history.sale_order_line_price_history_view_form | ||
#: model_terms:ir.ui.view,arch_db:sale_order_line_price_history.view_order_form | ||
#, python-format | ||
msgid "Price History" | ||
msgstr "Historial de precios" | ||
|
||
|
@@ -163,6 +167,7 @@ msgstr "Historial de ventas" | |
#. module: sale_order_line_price_history | ||
#: model:ir.model.fields,field_description:sale_order_line_price_history.field_sale_order_line_price_history__sale_order_line_id | ||
#: model:ir.model.fields,field_description:sale_order_line_price_history.field_sale_order_line_price_history_line__sale_order_line_id | ||
#: model:ir.model.fields,field_description:sale_order_line_price_history.field_sale_order_line_price_history_line__target_sale_order_line_id | ||
msgid "Sale order line" | ||
msgstr "Línea de pedido de venta" | ||
|
||
|
@@ -182,30 +187,23 @@ msgid "Sales Order Line" | |
msgstr "Línea de pedido de ventas" | ||
|
||
#. module: sale_order_line_price_history | ||
#: model_terms:ir.ui.view,arch_db:sale_order_line_price_history.sale_order_line_price_history_view_form | ||
msgid "Set price" | ||
msgstr "Establecer precio" | ||
#. odoo-javascript | ||
#: code:addons/sale_order_line_price_history/static/src/xml/set_price_to_line_widget.xml:0 | ||
#, python-format | ||
msgid "Set Historic Price" | ||
msgstr "Establecer Precio Histórico" | ||
|
||
#. module: sale_order_line_price_history | ||
#: model:ir.model.fields,field_description:sale_order_line_price_history.field_sale_order_line_price_history_line__order_state | ||
msgid "Status" | ||
msgstr "Estado" | ||
|
||
#. module: sale_order_line_price_history | ||
#: model:ir.model.fields,field_description:sale_order_line_price_history.field_sale_order_line_price_history_line__price_unit | ||
msgid "Unit Price" | ||
msgstr "Precio de Unidad" | ||
msgstr "Precio Unitario" | ||
|
||
#. module: sale_order_line_price_history | ||
#: model:ir.model.fields,field_description:sale_order_line_price_history.field_sale_order_line_price_history_line__history_sale_order_line_id | ||
msgid "history sale order line" | ||
msgstr "Línea de orden de venta del historial" | ||
|
||
#~ msgid "Include quotations" | ||
#~ msgstr "Incluir presupuestos" | ||
|
||
#~ msgid "Ordered Quantity" | ||
#~ msgstr "Cantidad pedida" | ||
|
||
#~ msgid "Price history" | ||
#~ msgstr "Historial de precios" | ||
|
||
#~ msgid "" | ||
#~ "You can find a customer by its Name, TIN, Email or Internal Reference." | ||
#~ msgstr "" | ||
#~ "Puede encontrar un campo por su Nombre, TIN, Email o Referencia Interna." |
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 |
---|---|---|
|
@@ -3,7 +3,9 @@ | |
* Pedro M. Baeza | ||
* Ernesto Tejeda | ||
* David Vidal | ||
* Carlos Roca | ||
|
||
* Serpent Consulting Services Pvt. Ltd. <[email protected]> | ||
* Dhara Solanki <[email protected]> | ||
* Ruchir Shukla <[email protected]> | ||
* Eduardo de Miguel (`Moduon <https://www.moduon.team/>`__) |
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 |
---|---|---|
@@ -1,9 +1 @@ | ||
* The number of entries of prices history in the wizard should be configurable, | ||
currently it is limited to 20. | ||
* A backend tour would be nice to have. | ||
* It is not possible to set a price from the tree view of the wizard lines, | ||
currently it can only be done from the form view of those lines | ||
(by clicking on one of them). This is not solved by simply putting a | ||
'Set price' button in the wizard lines because that button will be | ||
disabled since when the wizard is launched there is still no wizard | ||
record in the database (this is an Odoo limitation). |
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
29 changes: 29 additions & 0 deletions
29
sale_order_line_price_history/static/src/js/set_price_to_line_widget.js
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 @@ | ||
/** @odoo-module **/ | ||
const {Component} = owl; | ||
import {registry} from "@web/core/registry"; | ||
import {standardFieldProps} from "@web/views/fields/standard_field_props"; | ||
import {useService} from "@web/core/utils/hooks"; | ||
|
||
export class SetPriceToLineWidget extends Component { | ||
setup() { | ||
super.setup(); | ||
this.actionService = useService("action"); | ||
} | ||
|
||
setPriceHistory() { | ||
this.actionService.doAction({ | ||
type: "ir.actions.act_window_close", | ||
infos: { | ||
price_unit: this.props.record.data.price_unit, | ||
discount: this.props.record.data.discount, | ||
}, | ||
}); | ||
} | ||
} | ||
|
||
SetPriceToLineWidget.template = | ||
"sale_order_line_price_history.price_to_line_history_widget"; | ||
SetPriceToLineWidget.props = standardFieldProps; | ||
|
||
// Add the field to the correct category | ||
registry.category("fields").add("set_price_to_line_widget", SetPriceToLineWidget); |
10 changes: 8 additions & 2 deletions
10
sale_order_line_price_history/static/src/xml/sale_line_price_history_widget.xml
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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Copyright 2021 Tecnativa - David Vidal | ||
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). --> | ||
Copyright 2024 Moduon Team S.L. <[email protected]> | ||
License AGLP-3.0 or later (https://www.gnu.org/licenses/agpl.html). --> | ||
<templates> | ||
<t t-name="sale_order_line_price_history.price_history_widget" owl="1"> | ||
<div> | ||
<a tabindex="0" t-on-click="viewPriceHistory" class="fa fa-history" /> | ||
<a | ||
tabindex="0" | ||
t-on-click="viewPriceHistory" | ||
class="fa fa-history" | ||
title="Price History" | ||
/> | ||
</div> | ||
</t> | ||
</templates> |
16 changes: 16 additions & 0 deletions
16
sale_order_line_price_history/static/src/xml/set_price_to_line_widget.xml
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,16 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Copyright 2023 Tecnativa - Carlos Roca | ||
Copyright 2024 Moduon Team S.L. <[email protected]> | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). --> | ||
<templates> | ||
<div t-name="sale_order_line_price_history.price_to_line_history_widget" owl="1"> | ||
<div> | ||
<a | ||
tabindex="0" | ||
t-on-click="setPriceHistory" | ||
class="fa fa-check p-1" | ||
title="Set Historic Price" | ||
/> | ||
</div> | ||
</div> | ||
</templates> |
Oops, something went wrong.