In shipment out, calculate the amounts using the outgoing moves instead of inventory moves.

Locales.
Pyflakes.

Task #046796
This commit is contained in:
Juanjo Garcia 2021-11-22 17:03:42 +01:00
parent a6bccdc18d
commit 515e9650ea
6 changed files with 28 additions and 3 deletions

View file

@ -99,3 +99,7 @@ msgid ""
"If marked valued shipment take amount from origin, not from the move"
msgstr ""
"Si està marcat l'albarà valorat usarà els imports del origen, no del moviment"
msgctxt "view:stock.shipment.out:"
msgid "These totals are calculated using the outgoing moves."
msgstr "Aquests totals estan calculats utilitzant els moviments de sortida."

View file

@ -100,3 +100,7 @@ msgid ""
msgstr ""
"Si está marcado el albarán valorado usará los importes del origen, "
"no del movimiento"
msgctxt "view:stock.shipment.out:"
msgid "These totals are calculated using the outgoing moves."
msgstr "Estos totales están calculados utilizando los movimientos de salida."

View file

@ -78,7 +78,7 @@ tests_require = [
get_require_version('proteus'),
get_require_version('trytond_sale'),
get_require_version('trytond_purchase'),
]
tests_require += get_requires('extras_depend')
requires += [get_require_version('trytond_account_invoice'),get_require_version('trytond_stock')]

View file

@ -80,7 +80,7 @@ class ShipmentValuedMixin(TaxableMixin):
keep_origin = True if 'stock.move' in origins else False
move_field = MOVES.get(self.__name__)
if (keep_origin and self.__name__ == 'stock.shipment.out'):
moves = getattr(self, 'inventory_moves', [])
moves = getattr(self, 'outgoing_moves', [])
if moves:
return moves
return getattr(self, move_field, [])

View file

@ -19,7 +19,7 @@
<record model="ir.ui.view" id="shipment_out_view_form">
<field name="model">stock.shipment.out</field>
<field name="inherit" ref="stock.shipment_out_view_form"/>
<field name="name">shipment_amounts</field>
<field name="name">shipment_amounts_out</field>
</record>
<!-- stock.shipment.out.return -->

View file

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<data>
<xpath expr="/form/field[@name='state']" position="after">
<newline/>
<group col="2" colspan="2" id="shipment_totals" yfill="1">
<label colspan="2" yalign="0.0" xalign="0.0" id="totals_calculated" string="These totals are calculated using the outgoing moves."/>
<label name="untaxed_amount"/>
<field name="untaxed_amount" symbol="currency"/>
<label name="tax_amount"/>
<field name="tax_amount" symbol="currency"/>
<label name="total_amount"/>
<field name="total_amount" symbol="currency"/>
</group>
</xpath>
</data>