Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
6 changes: 3 additions & 3 deletions purchase_discount/views/report_purchaseorder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
id="report_purchaseorder_document"
inherit_id="purchase.report_purchaseorder_document"
>
<xpath expr="//table[1]/thead/tr//th[last()]" position="before">
<th name="th_discount" class="text-right">
<xpath expr="//table[1]/thead/tr//th[@name='th_price_unit']" position="after">
<th class="text-right">
<strong>Disc. (%)</strong>
</th>
</xpath>
<xpath expr="//td[span[@t-field='line.price_subtotal']]" position="before">
<xpath expr="//td[span[@t-field='line.price_unit']]" position="after">
<td class="text-right">
<span t-field="line.discount" />
</td>
Expand Down
2 changes: 1 addition & 1 deletion purchase_request/i18n/es_EC.po
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ msgstr ""
#: code:addons/purchase_request/models/purchase_request.py:0
#, fuzzy, python-format
msgid "You cannot delete a purchase request which is not draft."
msgstr "No puedes solicitar aprobación de una requisición vacía. (%s)"
msgstr "No puede eliminar una requisición de compra que no sea un borrador."

#. module: purchase_request
#. odoo-python
Expand Down
5 changes: 5 additions & 0 deletions purchase_request/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ def _prepare_request_message_data(self, alloc, request_line, allocated_qty):
}

def write(self, vals):
# TRESCLOUD: Si se actualiza la cantidad del producto, se actualiza la fecha planificada a la fecha actual
# Esto desde una requisición de compra
# TRESCLOUD: FIN
if 'product_qty' in vals and self.env.context.get('ctx_update_date_planned', False):
vals['date_planned'] = fields.Datetime.now()
# As services do not generate stock move this tweak is required
# to allocate them.
prev_qty_received = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ def _get_order_line_search_domain(self, order, item):
return order_line_data

def make_purchase_order(self):
# TRESCLOUD: Se envía el contexto para determinar la fecha planificada al actualizar la cantidad
# Esto evita que se duplique la línea de movimiento en la transferencia
self = self.with_context(ctx_update_date_planned=True)
# TRESCLOUD: FIN
res = []
purchase_obj = self.env["purchase.order"]
po_line_obj = self.env["purchase.order.line"]
Expand Down
Loading