mirror of
https://github.com/OCA/stock-logistics-reporting.git
synced 2025-02-16 17:13:21 +02:00
[MIG] stock_picking_report_valued: Migration to 17.0
This commit is contained in:
@@ -41,7 +41,8 @@ valued with reserved quantity.
|
||||
Configuration
|
||||
=============
|
||||
|
||||
1. Go to *Customers > (select one of your choice) > Sales & Purchases*.
|
||||
1. Go to *Sales > Orders > Customers > (select one of your choice) >
|
||||
Sales & Purchases*.
|
||||
2. Set *Valued picking* field on.
|
||||
|
||||
Usage
|
||||
@@ -60,6 +61,13 @@ Known issues / Roadmap
|
||||
|
||||
- If the picking is not reserved, values aren't computed.
|
||||
|
||||
Changelog
|
||||
=========
|
||||
|
||||
This module includes the features from the module
|
||||
*stock_picking_report_valued_delivery*:
|
||||
https://github.com/OCA/stock-logistics-reporting/pull/285
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
@@ -107,6 +115,10 @@ Contributors
|
||||
|
||||
- Miguel Gandia <miguel@studio73.es>
|
||||
|
||||
- `Trobz <https://trobz.com>`__:
|
||||
|
||||
- Nguyen Minh Chien <chien@trobz.com>
|
||||
|
||||
Maintainers
|
||||
-----------
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{
|
||||
"name": "Valued Picking Report",
|
||||
"summary": "Adding Valued Picking on Delivery Slip report",
|
||||
"version": "16.0.1.0.0",
|
||||
"version": "17.0.1.0.0",
|
||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/stock-logistics-reporting",
|
||||
"category": "Warehouse Management",
|
||||
|
||||
@@ -45,7 +45,7 @@ class StockMoveLine(models.Model):
|
||||
)
|
||||
|
||||
def _get_report_valued_quantity(self):
|
||||
return self.qty_done or self.reserved_qty
|
||||
return self.quantity or self.reserved_qty
|
||||
|
||||
def _compute_sale_order_line_fields(self):
|
||||
"""This is computed with sudo for avoiding problems if you don't have
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
1. Go to *Customers \> (select one of your choice) \> Sales &
|
||||
1. Go to *Sales \> Orders \> Customers \> (select one of your choice) \> Sales &
|
||||
Purchases*.
|
||||
2. Set *Valued picking* field on.
|
||||
|
||||
@@ -14,3 +14,5 @@
|
||||
- Aritz Olea \<<ao@landoo.es>\>
|
||||
- [Studio73](https://www.studio73.es):
|
||||
- Miguel Gandia \<<miguel@studio73.es>\>
|
||||
- [Trobz](https://trobz.com):
|
||||
- Nguyen Minh Chien \<<chien@trobz.com>\>
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
- If the picking is not reserved, values aren't computed.
|
||||
|
||||
Changelog
|
||||
=========
|
||||
|
||||
This module includes the features from the module *stock_picking_report_valued_delivery*: https://github.com/OCA/stock-logistics-reporting/pull/285
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
<template id="valued_report_picking" inherit_id="stock.report_delivery_document">
|
||||
<template
|
||||
id="valued_report_picking"
|
||||
inherit_id="stock.report_delivery_document"
|
||||
priority="17"
|
||||
>
|
||||
<xpath expr="//div[hasclass('page')]" position="before">
|
||||
<t t-set="is_outgoing" t-value="o.picking_type_code == 'outgoing'" />
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//table[@t-if="o.move_line_ids and o.state=='done'"]/thead/tr"
|
||||
position="inside"
|
||||
>
|
||||
<xpath expr="//table[@name='stock_move_line_table']/thead/tr" position="inside">
|
||||
<t t-if="o.valued and o.sale_id and o.move_line_ids and is_outgoing">
|
||||
<t t-if="o.state != 'done'">
|
||||
<th class="text-end"><strong>Qty Reserved</strong></th>
|
||||
</t>
|
||||
<th class="text-end"><strong>Unit Price</strong></th>
|
||||
<th class="text-end" groups="product.group_discount_per_so_line">
|
||||
<strong>Discount</strong>
|
||||
@@ -28,6 +26,9 @@
|
||||
separator=" "
|
||||
/>
|
||||
</xpath>
|
||||
<xpath expr="//th[@name='th_sml_qty_ordered']" position="after">
|
||||
<t t-elif="not has_serial_number" />
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//t[@t-foreach='packages']//t[@t-if='has_serial_number']"
|
||||
position="attributes"
|
||||
@@ -58,10 +59,7 @@
|
||||
separator=" "
|
||||
/>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//table[@t-if="o.move_line_ids and o.state=='done'"]"
|
||||
position="after"
|
||||
>
|
||||
<xpath expr="//table[@name='stock_move_line_table']" position="after">
|
||||
<t t-if="o.valued and o.sale_id and o.move_line_ids and is_outgoing">
|
||||
<table class="table table-sm mt32">
|
||||
<thead>
|
||||
@@ -92,18 +90,9 @@
|
||||
<template
|
||||
id="valued_report_picking_has_serial_move_line"
|
||||
inherit_id="stock.stock_report_delivery_has_serial_move_line"
|
||||
priority="17"
|
||||
>
|
||||
<xpath expr="//td[@name='move_line_lot_qty_done']" position="after">
|
||||
<t t-if="move_line.picking_id.state != 'done'">
|
||||
<td class="text-end">
|
||||
<span t-field="move_line.product_uom_qty" />
|
||||
<span t-field="move_line.product_uom_id" /></td>
|
||||
</t>
|
||||
<t t-elif="move_line.picking_id.state == 'done'">
|
||||
<td class="text-center">
|
||||
<span t-field="move_line.qty_done" />
|
||||
<span t-field="move_line.product_uom_id" /></td>
|
||||
</t>
|
||||
<xpath expr="." position="inside">
|
||||
<t t-if="o.valued and o.sale_id and o.move_line_ids and is_outgoing">
|
||||
<td class="text-end"><span t-field="move_line.sale_price_unit" /></td>
|
||||
<td class="text-end" groups="product.group_discount_per_so_line">
|
||||
@@ -117,13 +106,6 @@
|
||||
/></td>
|
||||
</t>
|
||||
</xpath>
|
||||
<xpath expr="//td[@name='move_line_lot_qty_done']" position="attributes">
|
||||
<attribute
|
||||
name="t-if"
|
||||
add="not (o.valued or o.sale_id or o.move_line_ids or is_outgoing)"
|
||||
separator=" "
|
||||
/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
@@ -380,11 +379,12 @@ valued with reserved quantity.</p>
|
||||
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
|
||||
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-3">Known issues / Roadmap</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li>
|
||||
<li><a class="reference internal" href="#changelog" id="toc-entry-4">Changelog</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-5">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-6">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-7">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-8">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-9">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -392,7 +392,8 @@ valued with reserved quantity.</p>
|
||||
<div class="section" id="configuration">
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
|
||||
<ol class="arabic simple">
|
||||
<li>Go to <em>Customers > (select one of your choice) > Sales & Purchases</em>.</li>
|
||||
<li>Go to <em>Sales > Orders > Customers > (select one of your choice) >
|
||||
Sales & Purchases</em>.</li>
|
||||
<li>Set <em>Valued picking</em> field on.</li>
|
||||
</ol>
|
||||
</div>
|
||||
@@ -413,8 +414,14 @@ customer.</li>
|
||||
<li>If the picking is not reserved, values aren’t computed.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="changelog">
|
||||
<h1><a class="toc-backref" href="#toc-entry-4">Changelog</a></h1>
|
||||
<p>This module includes the features from the module
|
||||
<em>stock_picking_report_valued_delivery</em>:
|
||||
<a class="reference external" href="https://github.com/OCA/stock-logistics-reporting/pull/285">https://github.com/OCA/stock-logistics-reporting/pull/285</a></p>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
|
||||
<h1><a class="toc-backref" href="#toc-entry-5">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-reporting/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
|
||||
@@ -422,15 +429,15 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<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-5">Credits</a></h1>
|
||||
<h1><a class="toc-backref" href="#toc-entry-6">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-7">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Tecnativa</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-8">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li><a class="reference external" href="http://www.avanzosc.es">Avanzosc</a>:<ul>
|
||||
<li>Oihane Crucelaegui</li>
|
||||
@@ -458,10 +465,14 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<li>Miguel Gandia <<a class="reference external" href="mailto:miguel@studio73.es">miguel@studio73.es</a>></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference external" href="https://trobz.com">Trobz</a>:<ul>
|
||||
<li>Nguyen Minh Chien <<a class="reference external" href="mailto:chien@trobz.com">chien@trobz.com</a>></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h2>
|
||||
<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>
|
||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
|
||||
@@ -9,7 +9,7 @@ from odoo.tests import common
|
||||
class TestStockPickingValued(common.TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(TestStockPickingValued, cls).setUpClass()
|
||||
super().setUpClass()
|
||||
company = cls.env.user.company_id
|
||||
cls.tax = cls.env["account.tax"].create(
|
||||
{
|
||||
@@ -136,7 +136,7 @@ class TestStockPickingValued(common.TransactionCase):
|
||||
self.assertTrue(len(self.sale_order.picking_ids))
|
||||
for picking in self.sale_order.picking_ids:
|
||||
picking.action_assign()
|
||||
picking.move_line_ids.qty_done = 2.0
|
||||
picking.move_line_ids.quantity = 2.0
|
||||
self.assertEqual(picking.amount_untaxed, 200.0)
|
||||
self.assertEqual(picking.amount_tax, 30.0)
|
||||
self.assertEqual(picking.amount_total, 230.0)
|
||||
|
||||
Reference in New Issue
Block a user