Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] add an alert message when return products on an stock picking a…
…nd set true boolean "to refound"
- Loading branch information
Showing
5 changed files
with
62 additions
and
1 deletion.
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,5 @@ | ||
############################################################################## | ||
# For copyright and license notices, see __manifest__.py file in module root | ||
# directory | ||
############################################################################## | ||
from . import stock_return_picking |
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,23 @@ | ||
############################################################################## | ||
# For copyright and license notices, see __manifest__.py file in module root | ||
# directory | ||
############################################################################## | ||
from odoo import models, api | ||
|
||
|
||
class StockReturnPicking(models.TransientModel): | ||
_inherit = "stock.return.picking" | ||
|
||
@api.model | ||
def default_get(self, fields): | ||
"""Get sale order for lines.""" | ||
result = super(StockReturnPicking, self).default_get(fields) | ||
try: | ||
for line in result["product_return_moves"]: | ||
assert line[0] == 0 | ||
# en realidad no nos importa si hay linea de venta o no ya que | ||
# también lo usamos en compras y queremos que en todo caso este | ||
line[2]["to_refund"] = True | ||
except KeyError: | ||
pass | ||
return result |
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,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="view_stock_return_picking_form" model="ir.ui.view"> | ||
<field name="name">Imrpove refunds wizard</field> | ||
<field name="inherit_id" ref="stock.view_stock_return_picking_form"/> | ||
<field name="model">stock.return.picking</field> | ||
<field name="arch" type="xml"> | ||
<group position="before"> | ||
<div class="alert alert-info" role="alert" style="margin-bottom:0px;"> | ||
<b>Importante</b>: si está haciendo un movimiento inverso relacionado a un Pedido de Venta o de Compra, entonces debe prestar atención al campo <b>"Para Abonar (actualizar OC/OV)"</b>, donde, si: | ||
<ul> | ||
<li> | ||
<b>Está marcado</b>: entonces <b>se va</b> a actualizar la OC/OV considerando que los productos devueltos no se van a volver a entregar, y por ende, permitiendo hacer una nota de crédito si los items ya fueron facturados, o tener en cuenta esta devolución al hacer la factura. | ||
</li> | ||
<li> | ||
<b>No está marcado</b>: entonces <b>no se va</b> a actualizar la OC/OV. Esto es común, por ejemplo, si se devuelve mercadería defectuosa y se pretende hacer una nueva entrega de la misma. | ||
</li> | ||
</ul> | ||
Si la devolución no está ligada a una OC/OV entonces este campo no repercute en nada. | ||
</div> | ||
</group> | ||
<field name="to_refund" position="attributes"> | ||
<!-- porque lo queremos usar tmb en oc y esto lo hace no marcable --> | ||
<attribute name="attrs"></attribute> | ||
<!-- porque la traducción no se actualiza --> | ||
<attribute name="string">Para Abonar (actualizar OC/OV)</attribute> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
</odoo> |