Skip to content

Commit 0cbc6d5

Browse files
committed
fix pre-commit
1 parent fd8b3a2 commit 0cbc6d5

File tree

4 files changed

+61
-29
lines changed

4 files changed

+61
-29
lines changed

stock_picking_declared_value/README.rst

+3-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Stock Picking Declared Value
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:78ed1d6b0f51d9714d976408ac8cc483c52fc13d0bb2503eed247fe2f5175ee4
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1012
1113
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1214
:target: https://odoo-community.org/page/development-status
@@ -26,16 +28,11 @@ Stock Picking Declared Value
2628

2729
|badge1| |badge2| |badge3| |badge4| |badge5|
2830

29-
This module extends the stock picking functionality to display product declared values from sales orders.
31+
This module extends the stock picking functionality to copy product prices from sales orders.
3032
When a picking is created from a sales order, it copies the prices and discounts of each product line to the picking as declared values.
3133
The purpose of this module is to serve other modules such as delivery carriers which require these
3234
declared values when shipping a picking.
3335

34-
The module copies the following information from the sales order lines:
35-
- Unit price
36-
- Discount percentage
37-
- Calculates the subtotal with discount applied
38-
3936
Additionally, the module allows configuring a "Declared Amount" on shipping methods (delivery carriers).
4037
This percentage is used to calculate the final declared value for the picking. For example, if the total value
4138
of products in a picking is $1000 and the declared amount is set to 80%, the declared value will be $800.

stock_picking_declared_value/static/description/index.html

+9-8
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,16 @@ <h1 class="title">Stock Picking Declared Value</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:b28cce79b805578f7f7dedf097667ef94976ac43967ce49f20b2d595814d1747
370+
!! source digest: sha256:78ed1d6b0f51d9714d976408ac8cc483c52fc13d0bb2503eed247fe2f5175ee4
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372372
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/delivery-carrier/tree/15.0/stock_picking_declared_value"><img alt="OCA/delivery-carrier" src="https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/delivery-carrier-15-0/delivery-carrier-15-0-stock_picking_declared_value"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/delivery-carrier&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373-
<p>This module extends the stock picking functionality to display product declared values from sales orders.
373+
<p>This module extends the stock picking functionality to copy product prices from sales orders.
374374
When a picking is created from a sales order, it copies the prices and discounts of each product line to the picking as declared values.
375375
The purpose of this module is to serve other modules such as delivery carriers which require these
376376
declared values when shipping a picking.</p>
377-
<p>The module copies the following information from the sales order lines:
378-
- Unit price
379-
- Discount percentage
380-
- Calculates the subtotal with discount applied</p>
377+
<p>Additionally, the module allows configuring a “Declared Amount” on shipping methods (delivery carriers).
378+
This percentage is used to calculate the final declared value for the picking. For example, if the total value
379+
of products in a picking is $1000 and the declared amount is set to 80%, the declared value will be $800.</p>
381380
<p>All declared value columns are hidden by default in the user interface but can be shown when needed.</p>
382381
<p><strong>Table of contents</strong></p>
383382
<div class="contents local topic" id="contents">
@@ -396,11 +395,13 @@ <h1 class="title">Stock Picking Declared Value</h1>
396395
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
397396
<p>To use this module, you need to:</p>
398397
<ol class="arabic simple">
399-
<li>Create a sales order with products</li>
398+
<li>Configure the “Declared Amount” on your shipping methods (Inventory &gt; Configuration &gt; Delivery &gt; Shipping Methods)</li>
399+
<li>Create a sales order with products and select a shipping method</li>
400400
<li>Confirm the sales order</li>
401401
<li>Go to the delivery order created from the sales order</li>
402402
<li>The declared value columns are hidden by default</li>
403-
<li>You can show the declared value columns by clicking on the column header and selecting "Show"</li>
403+
<li>You can show the declared value columns by clicking on the column header and selecting “Show”</li>
404+
<li>You can view and modify the “Declared Amount” in the “Additional Info” tab of the picking</li>
404405
</ol>
405406
</div>
406407
<div class="section" id="bug-tracker">

stock_picking_declared_value/views/stock_move_views.xml

+13-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,19 @@
1111
<field name="product_uom" position="after">
1212
<field name="currency_id" invisible="1" />
1313
<field name="sale_line_id" invisible="1" />
14-
<field name="sale_unit_price" attrs="{'invisible': [('sale_line_id', '=', False)]}" />
15-
<field name="discount" attrs="{'invisible': [('sale_line_id', '=', False)]}" />
16-
<field name="price_subtotal" widget="monetary"
17-
attrs="{'invisible': [('sale_line_id', '=', False)]}" />
14+
<field
15+
name="sale_unit_price"
16+
attrs="{'invisible': [('sale_line_id', '=', False)]}"
17+
/>
18+
<field
19+
name="discount"
20+
attrs="{'invisible': [('sale_line_id', '=', False)]}"
21+
/>
22+
<field
23+
name="price_subtotal"
24+
widget="monetary"
25+
attrs="{'invisible': [('sale_line_id', '=', False)]}"
26+
/>
1827
</field>
1928
</field>
2029
</record>

stock_picking_declared_value/views/stock_picking_views.xml

+36-11
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,50 @@
1111
<!-- Add currency field (invisible) for monetary fields -->
1212
<field name="origin" position="after">
1313
<field name="currency_id" invisible="1" />
14-
<field name="sale_id" readonly="1" attrs="{'invisible': [('sale_id', '=', False)]}" />
14+
<field
15+
name="sale_id"
16+
readonly="1"
17+
attrs="{'invisible': [('sale_id', '=', False)]}"
18+
/>
1519
</field>
16-
20+
1721
<!-- Add declared value fields to the move lines -->
18-
<xpath expr="//field[@name='move_ids_without_package']/tree" position="inside">
22+
<xpath
23+
expr="//field[@name='move_ids_without_package']/tree"
24+
position="inside"
25+
>
1926
<field name="currency_id" invisible="1" />
2027
<field name="sale_line_id" invisible="1" />
21-
<field name="sale_unit_price" attrs="{'column_invisible': [('parent.sale_id', '=', False)]}" optional="hide" />
22-
<field name="discount" attrs="{'column_invisible': [('parent.sale_id', '=', False)]}" optional="hide" />
23-
<field name="price_subtotal" widget="monetary"
24-
attrs="{'column_invisible': [('parent.sale_id', '=', False)]}" optional="hide" />
28+
<field
29+
name="sale_unit_price"
30+
attrs="{'column_invisible': [('parent.sale_id', '=', False)]}"
31+
optional="hide"
32+
/>
33+
<field
34+
name="discount"
35+
attrs="{'column_invisible': [('parent.sale_id', '=', False)]}"
36+
optional="hide"
37+
/>
38+
<field
39+
name="price_subtotal"
40+
widget="monetary"
41+
attrs="{'column_invisible': [('parent.sale_id', '=', False)]}"
42+
optional="hide"
43+
/>
2544
</xpath>
26-
45+
2746
<!-- Add declared amount and total declared value to the Additional Info page -->
2847
<xpath expr="//page[@name='extra']" position="inside">
2948
<group name="declared_value" string="Declared Value">
30-
<field name="declared_amount" attrs="{'invisible': [('sale_id', '=', False)]}" />
31-
<field name="amount_total" widget="monetary"
32-
attrs="{'invisible': [('sale_id', '=', False)]}" />
49+
<field
50+
name="declared_amount"
51+
attrs="{'invisible': [('sale_id', '=', False)]}"
52+
/>
53+
<field
54+
name="amount_total"
55+
widget="monetary"
56+
attrs="{'invisible': [('sale_id', '=', False)]}"
57+
/>
3358
</group>
3459
</xpath>
3560
</field>

0 commit comments

Comments
 (0)