[MIG] stock_move_value_report: Migration to 17.0

This commit is contained in:
Vincent Van Rossem
2024-06-06 17:02:35 +02:00
parent cc770b0393
commit 7d19138c52
3 changed files with 57 additions and 47 deletions

View File

@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Stock Move Cost Value Report",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Warehouse",
"website": "https://github.com/OCA/stock-logistics-reporting",
"author": "Tecnativa, Odoo Community Association (OCA)",

View File

@@ -44,8 +44,10 @@
</t>
</td>
<td name="lot_qty">
<t t-if="move_line.reserved_qty">
<span t-field="move_line.reserved_qty" />
<t t-if="move_line.quantity_product_uom">
<span
t-field="move_line.quantity_product_uom"
/>
</t>
</td>
</tr>
@@ -53,7 +55,7 @@
</td>
</t>
<td class="text-center">
<span t-field="move_line.qty_done" />
<span t-field="move_line.quantity" />
<span t-field="move_line.product_uom_id" />
</td>
<td class="text-end">
@@ -72,7 +74,7 @@
</td>
<td class="text-end">
<span
t-esc="cost * move_line.qty_done"
t-esc="cost * move_line.quantity"
t-options="{'widget': 'monetary', 'display_currency': currency_id}"
/>
</td>
@@ -104,7 +106,7 @@
/>
<t
t-set="total"
t-value="total + cost * move_line.qty_done"
t-value="total + cost * move_line.quantity"
/>
</t>
<span
@@ -171,33 +173,39 @@
<t t-if="ml_from_scraps">
<t
t-set="scraps"
t-value="move_lines_ids.mapped('move_id.scrap_ids').filtered(lambda x: x.move_id in ml_from_scraps.mapped('move_id'))"
t-value="move_lines_ids.mapped('move_id.scrap_id').filtered(lambda x: x in ml_from_scraps.mapped('move_id.scrap_id'))"
/>
<t t-foreach="scraps" t-as="scrap">
<t
t-set="scrap_move_lines"
t-value="scrap.move_id.move_line_ids"
/>
<h4><span>[<t t-esc="scrap.move_id.date" />]</span> Scrap <t
t-esc="scrap.name"
/>: <t t-esc="scrap.location_id.name" /> &#8594; <t
t-esc="scrap.scrap_location_id.name"
/></h4>
<t t-call="stock_move_value_report.stock_move_lines_value">
<t t-set="move_lines" t-value="scrap_move_lines" />
<t t-foreach="scrap.move_ids" t-as="scrap_move">
<t
t-set="currency_id"
t-value="res_company.currency_id"
t-set="scrap_move_lines"
t-value="scrap_move.move_line_ids"
/>
</t>
<t
t-call="stock_move_value_report.stock_move_lines_value_total"
>
<t t-set="move_lines" t-value="scrap_move_lines" />
<h4><span>[<t
t-esc="scrap_move.date"
/>]</span> Scrap <t t-esc="scrap.name" />: <t
t-esc="scrap.location_id.name"
/> &#8594; <t
t-esc="scrap.scrap_location_id.name"
/></h4>
<t
t-set="currency_id"
t-value="res_company.currency_id"
/>
t-call="stock_move_value_report.stock_move_lines_value"
>
<t t-set="move_lines" t-value="scrap_move_lines" />
<t
t-set="currency_id"
t-value="res_company.currency_id"
/>
</t>
<t
t-call="stock_move_value_report.stock_move_lines_value_total"
>
<t t-set="move_lines" t-value="scrap_move_lines" />
<t
t-set="currency_id"
t-value="res_company.currency_id"
/>
</t>
</t>
</t>
</t>
@@ -215,7 +223,7 @@
>Total operations value balance</strong></td>
<td class="text-end">
<strong
t-esc="sum([x.move_id.price_unit * x.qty_done for x in move_lines_ids])"
t-esc="sum([x.move_id.price_unit * x.quantity for x in move_lines_ids])"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
/>
</td>

View File

@@ -18,22 +18,24 @@
</tr>
</thead>
<tbody>
<tr>
<td class="text-start">
<span t-field="scrap.location_id.name" />
</td>
<td t-if="scrap.origin" class="text-center">
<span t-field="scrap.origin" />
</td>
<td class="text-center">
<span t-field="scrap.state" />
</td>
<td name="td_sched_date" class="text-center">
<span
t-esc="scrap.move_id and scrap.move_id.date"
/>
</td>
</tr>
<t t-foreach="scrap.move_ids" t-as="move">
<tr>
<td class="text-start">
<span
t-field="move.scrap_id.location_id.name"
/>
</td>
<td t-if="move.scrap_id.origin" class="text-center">
<span t-field="scrap.origin" />
</td>
<td class="text-center">
<span t-field="move.scrap_id.state" />
</td>
<td name="td_sched_date" class="text-center">
<span t-esc="move.date" />
</td>
</tr>
</t>
</tbody>
</table>
<br />
@@ -41,7 +43,7 @@
<t t-call="stock_move_value_report.stock_move_lines_value">
<t
t-set="move_lines"
t-value="scrap.mapped('move_id.move_line_ids')"
t-value="scrap.mapped('move_ids').mapped('move_line_ids')"
/>
<t t-set="currency_id" t-value="res_company.currency_id" />
</t>
@@ -49,7 +51,7 @@
<t t-call="stock_move_value_report.stock_move_lines_value_total">
<t
t-set="move_lines"
t-value="scrap.mapped('move_id.move_line_ids')"
t-value="scrap.mapped('move_ids').mapped('move_line_ids')"
/>
<t t-set="currency_id" t-value="res_company.currency_id" />
</t>