mirror of
https://github.com/OCA/stock-logistics-reporting.git
synced 2025-02-16 17:13:21 +02:00
[11.0][MIG] stock_valued_picking_report
This commit is contained in:
committed by
Pedro M. Baeza
parent
2933f0f020
commit
b8e9175f73
@@ -1,13 +1,15 @@
|
||||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
||||
:target: https://www.gnu.org/licenses/agpl
|
||||
:alt: License: AGPL-3
|
||||
|
||||
===========================
|
||||
Stock Valued Picking Report
|
||||
Stock Picking Report Valued
|
||||
===========================
|
||||
|
||||
Add amount information to Delivery Slip report.
|
||||
You can select at partner level if picking list report must be valued or not.
|
||||
If the picking is done it's valued with quantity done, otherwise the picking
|
||||
is valued with reserved quantity.
|
||||
|
||||
Configuration
|
||||
=============
|
||||
@@ -29,7 +31,7 @@ To get the stock picking valued report:
|
||||
|
||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||
:alt: Try me on Runbot
|
||||
:target: https://runbot.odoo-community.org/runbot/151/10.0
|
||||
:target: https://runbot.odoo-community.org/runbot/151/11.0
|
||||
|
||||
Known issues / Roadmap
|
||||
======================
|
||||
@@ -1,28 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2014 Pedro M. Baeza - Tecnativa <pedro.baeza@tecnativa.com>
|
||||
# Copyright 2015 Antonio Espinosa - Tecnativa <antonio.espinosa@tecnativa.com>
|
||||
# Copyright 2016 Carlos Dauden - Tecnativa <carlos.dauden@tecnativa.com>
|
||||
# Copyright 2017 David Vidal - Tecnativa <david.vidal@tecnativa.com>
|
||||
# Copyright 2017 Luis M. Ontalba - Tecnativa <luis.martinez@tecnativa.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Stock Valued Picking Report",
|
||||
"name": "Valued Picking Report",
|
||||
"summary": "Adding Valued Picking on Delivery Slip report",
|
||||
"version": "10.0.1.0.1",
|
||||
"version": "11.0.1.0.0",
|
||||
"author": "Tecnativa, "
|
||||
"Odoo Community Association (OCA)",
|
||||
"website": "https://www.tecnativa.com",
|
||||
"category": "Warehouse Management",
|
||||
"license": "AGPL-3",
|
||||
"depends": [
|
||||
"account",
|
||||
"sale_management",
|
||||
"stock",
|
||||
"sale",
|
||||
"delivery",
|
||||
],
|
||||
"data": [
|
||||
'views/res_partner_view.xml',
|
||||
'report/stock_picking_valued_report.xml',
|
||||
'report/stock_picking_report_valued.xml',
|
||||
],
|
||||
"installable": True,
|
||||
}
|
||||
134
stock_picking_report_valued/i18n/es.po
Normal file
134
stock_picking_report_valued/i18n/es.po
Normal file
@@ -0,0 +1,134 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_picking_report_valued
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-08-21 08:13+0000\n"
|
||||
"PO-Revision-Date: 2017-08-21 10:13+0200\n"
|
||||
"Last-Translator: Carlos Dauden <carlos.dauden@tecnativa.com>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: \n"
|
||||
"Language: es\n"
|
||||
"X-Generator: Poedit 1.8.7.1\n"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Discount</strong>"
|
||||
msgstr "<strong>Dto</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Subtotal</strong>"
|
||||
msgstr "<strong>Subtotal</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Taxes</strong>"
|
||||
msgstr "<strong>Impuestos</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Total</strong>"
|
||||
msgstr "<strong>Total</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Unit Price</strong>"
|
||||
msgstr "<strong>Precio Unidad</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Untaxed Amount</strong>"
|
||||
msgstr "<strong>Base imponible</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_currency_id
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_currency_id
|
||||
msgid "Currency"
|
||||
msgstr "Moneda"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model,name:stock_picking_report_valued.model_stock_pack_operation
|
||||
msgid "Packing Operation"
|
||||
msgstr "Operación de empaquetado"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model,name:stock_picking_report_valued.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr "Empresa"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_price_subtotal
|
||||
msgid "Price subtotal"
|
||||
msgstr "Subtotal"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_line
|
||||
msgid "Related order line"
|
||||
msgstr "Línea de pedido relacionada"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_discount
|
||||
msgid "Sale discount (%)"
|
||||
msgstr "Descuento venta (%)"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_price_unit
|
||||
msgid "Sale price unit"
|
||||
msgstr "Precio venta"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_tax_description
|
||||
msgid "Tax Description"
|
||||
msgstr "Descripción de impuesto"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_price_tax
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_tax_id
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_amount_tax
|
||||
msgid "Taxes"
|
||||
msgstr "Impuestos"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_price_total
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_amount_total
|
||||
msgid "Total"
|
||||
msgstr "Total"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model,name:stock_picking_report_valued.model_stock_picking
|
||||
msgid "Transfer"
|
||||
msgstr "Transferir"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_amount_untaxed
|
||||
msgid "Untaxed Amount"
|
||||
msgstr "Base imponible"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_res_partner_valued_picking
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_valued
|
||||
msgid "Valued picking"
|
||||
msgstr "Albarán valorado"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_website_message_ids
|
||||
msgid "Website Messages"
|
||||
msgstr "Mensajes del sitio web"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,help:stock_picking_report_valued.field_stock_picking_website_message_ids
|
||||
msgid "Website communication history"
|
||||
msgstr "Historial de comunicaciones del sitio web"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,help:stock_picking_report_valued.field_res_partner_valued_picking
|
||||
#: model:ir.model.fields,help:stock_picking_report_valued.field_stock_picking_valued
|
||||
msgid "You can select which partners have valued pickings"
|
||||
msgstr "Puede seleccionar qué empresas tienen albarán valorado"
|
||||
127
stock_picking_report_valued/i18n/hr.po
Normal file
127
stock_picking_report_valued/i18n/hr.po
Normal file
@@ -0,0 +1,127 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_picking_report_valued
|
||||
#
|
||||
# Translators:
|
||||
# Bole <bole@dajmi5.com>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-12-01 02:22+0000\n"
|
||||
"PO-Revision-Date: 2017-12-01 02:22+0000\n"
|
||||
"Last-Translator: Bole <bole@dajmi5.com>, 2018\n"
|
||||
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: hr\n"
|
||||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Discount</strong>"
|
||||
msgstr "<strong>Popust</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Subtotal</strong>"
|
||||
msgstr "<strong>Subtotal</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Taxes</strong>"
|
||||
msgstr "<strong>Porezi</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Total</strong>"
|
||||
msgstr "<strong>Total</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Unit Price</strong>"
|
||||
msgstr "<strong>Jed.cijena</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking
|
||||
msgid "<strong>Untaxed Amount</strong>"
|
||||
msgstr "<strong>Bez poreza</strong>"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_currency_id
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_currency_id
|
||||
msgid "Currency"
|
||||
msgstr "Valuta"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model,name:stock_picking_report_valued.model_stock_pack_operation
|
||||
msgid "Packing Operation"
|
||||
msgstr "Operacija pakiranja"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model,name:stock_picking_report_valued.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr "Partner"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_price_subtotal
|
||||
msgid "Price subtotal"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_line
|
||||
msgid "Related order line"
|
||||
msgstr "Povezana stavka ponude"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_discount
|
||||
msgid "Sale discount (%)"
|
||||
msgstr "Popust prodaje (%)"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_price_unit
|
||||
msgid "Sale price unit"
|
||||
msgstr "Prodajna cijena"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_tax_description
|
||||
msgid "Tax Description"
|
||||
msgstr "Opis poreza"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_price_tax
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_tax_id
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_amount_tax
|
||||
msgid "Taxes"
|
||||
msgstr "Porezi"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_pack_operation_sale_price_total
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_amount_total
|
||||
msgid "Total"
|
||||
msgstr "Ukupno"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model,name:stock_picking_report_valued.model_stock_picking
|
||||
msgid "Transfer"
|
||||
msgstr "Transfer"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_amount_untaxed
|
||||
msgid "Untaxed Amount"
|
||||
msgstr "Iznos bez poreza"
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_res_partner_valued_picking
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_res_users_valued_picking
|
||||
#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking_valued
|
||||
msgid "Valued picking"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_picking_report_valued
|
||||
#: model:ir.model.fields,help:stock_picking_report_valued.field_res_partner_valued_picking
|
||||
#: model:ir.model.fields,help:stock_picking_report_valued.field_res_users_valued_picking
|
||||
#: model:ir.model.fields,help:stock_picking_report_valued.field_stock_picking_valued
|
||||
msgid "You can select which partners have valued pickings"
|
||||
msgstr ""
|
||||
4
stock_picking_report_valued/models/__init__.py
Normal file
4
stock_picking_report_valued/models/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
from . import res_partner
|
||||
from . import stock_move_line
|
||||
from . import stock_picking
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2014 Pedro M. Baeza - Tecnativa <pedro.baeza@tecnativa.com>
|
||||
# Copyright 2015 Antonio Espinosa - Tecnativa <antonio.espinosa@tecnativa.com>
|
||||
# Copyright 2016 Carlos Dauden - Tecnativa <carlos.dauden@tecnativa.com>
|
||||
61
stock_picking_report_valued/models/stock_move_line.py
Normal file
61
stock_picking_report_valued/models/stock_move_line.py
Normal file
@@ -0,0 +1,61 @@
|
||||
# Copyright 2014 Pedro M. Baeza - Tecnativa <pedro.baeza@tecnativa.com>
|
||||
# Copyright 2015 Antonio Espinosa - Tecnativa <antonio.espinosa@tecnativa.com>
|
||||
# Copyright 2016 Carlos Dauden - Tecnativa <carlos.dauden@tecnativa.com>
|
||||
# Copyright 2018 Luis M. Ontalba - Tecnativa <luis.martinez@tecnativa.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class StockMoveLine(models.Model):
|
||||
_inherit = "stock.move.line"
|
||||
|
||||
currency_id = fields.Many2one(
|
||||
related='sale_line.currency_id', readonly=True,
|
||||
string='Currency')
|
||||
sale_line = fields.Many2one(
|
||||
related='move_id.sale_line_id', readonly=True,
|
||||
string="Related order line")
|
||||
sale_tax_description = fields.Char(
|
||||
compute='_compute_sale_tax_description',
|
||||
string='Tax Description')
|
||||
sale_price_unit = fields.Float(
|
||||
related='sale_line.price_unit', readonly=True,
|
||||
string="Sale price unit")
|
||||
sale_discount = fields.Float(
|
||||
related='sale_line.discount', readonly=True,
|
||||
string="Sale discount (%)")
|
||||
sale_price_subtotal = fields.Monetary(
|
||||
compute='_compute_amount',
|
||||
string="Price subtotal")
|
||||
sale_price_tax = fields.Float(
|
||||
compute='_compute_amount',
|
||||
string='Taxes')
|
||||
|
||||
@api.multi
|
||||
@api.depends('sale_line.tax_id')
|
||||
def _compute_sale_tax_description(self):
|
||||
for line in self:
|
||||
line.sale_tax_description = ', '.join([(
|
||||
x.description or x.name) for x in line.sale_line.tax_id])
|
||||
|
||||
@api.depends('product_uom_qty', 'sale_discount', 'sale_price_unit',
|
||||
'sale_line.tax_id')
|
||||
def _compute_amount(self):
|
||||
for line in self:
|
||||
price = line.sale_price_unit * (1 - (
|
||||
line.sale_discount or 0.0) / 100.0)
|
||||
if line.picking_id.state == 'done':
|
||||
qty = line.qty_done
|
||||
else:
|
||||
qty = line.product_uom_qty
|
||||
taxes = line.sale_line.tax_id.compute_all(
|
||||
price,
|
||||
line.currency_id, qty,
|
||||
product=line.sale_line.product_id,
|
||||
partner=line.sale_line.order_id.partner_shipping_id)
|
||||
line.update({
|
||||
'sale_price_tax': sum(
|
||||
t.get('amount', 0.0) for t in taxes.get('taxes', [])),
|
||||
'sale_price_subtotal': taxes['total_excluded'],
|
||||
})
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2014 Pedro M. Baeza - Tecnativa <pedro.baeza@tecnativa.com>
|
||||
# Copyright 2015 Antonio Espinosa - Tecnativa <antonio.espinosa@tecnativa.com>
|
||||
# Copyright 2016 Carlos Dauden - Tecnativa <carlos.dauden@tecnativa.com>
|
||||
# Copyright 2016 Luis M. Ontalba - Tecnativa <luis.martinez@tecnativa.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
@@ -29,9 +29,9 @@ class StockPicking(models.Model):
|
||||
@api.multi
|
||||
def _compute_amount_all(self):
|
||||
for pick in self:
|
||||
amount_untaxed = sum(pick.pack_operation_ids.mapped(
|
||||
amount_untaxed = sum(pick.move_line_ids.mapped(
|
||||
'sale_price_subtotal'))
|
||||
amount_tax = sum(pick.pack_operation_ids.mapped(
|
||||
amount_tax = sum(pick.move_line_ids.mapped(
|
||||
'sale_price_tax'))
|
||||
pick.update({
|
||||
'amount_untaxed': amount_untaxed,
|
||||
@@ -2,9 +2,12 @@
|
||||
<odoo>
|
||||
|
||||
<template id="valued_report_picking" inherit_id="stock.report_delivery_document">
|
||||
<xpath expr="//table[@t-if='o.pack_operation_ids']/thead/tr"
|
||||
<xpath expr="//table[@t-if='o.move_line_ids']/thead/tr"
|
||||
position="inside">
|
||||
<t t-if="o.valued and o.sale_id and o.pack_operation_ids">
|
||||
<t t-if="o.valued and o.sale_id and o.move_line_ids">
|
||||
<t t-if="o.state != 'done'">
|
||||
<th class="text-right"><strong>Qty Reserved</strong></th>
|
||||
</t>
|
||||
<th class="text-right"><strong>Unit Price</strong></th>
|
||||
<th class="text-right" groups="sale.group_discount_per_so_line">
|
||||
<strong>Discount</strong>
|
||||
@@ -13,18 +16,26 @@
|
||||
<th class="text-right"><strong>Taxes</strong></th>
|
||||
</t>
|
||||
</xpath>
|
||||
<xpath expr="//span[@t-field='pack_operation.qty_done_uom_ordered']/.." position="after">
|
||||
<t t-if="o.valued">
|
||||
<td class="text-right"><span t-field="pack_operation.sale_price_unit" /></td>
|
||||
<xpath expr="//span[@t-field='move_line.qty_done']/.." position="after">
|
||||
<t t-if="o.valued and o.sale_id and o.move_line_ids">
|
||||
<t t-if="move_line.picking_id.state != 'done'">
|
||||
<td class="text-right">
|
||||
<span t-field="move_line.product_uom_qty"/>
|
||||
<span t-field="move_line.product_uom_id"/></td>
|
||||
</t>
|
||||
<td class="text-right"><span
|
||||
t-field="move_line.sale_price_unit" /></td>
|
||||
<td class="text-right" groups="sale.group_discount_per_so_line">
|
||||
<span t-field="pack_operation.sale_discount" />
|
||||
<span t-field="move_line.sale_discount" />
|
||||
</td>
|
||||
<td class="text-right"><span t-field="pack_operation.sale_price_subtotal" /></td>
|
||||
<td class="text-right"><span t-field="pack_operation.sale_tax_description"/></td>
|
||||
<td class="text-right"><span
|
||||
t-field="move_line.sale_price_subtotal" /></td>
|
||||
<td class="text-right"><span
|
||||
t-field="move_line.sale_tax_description"/></td>
|
||||
</t>
|
||||
</xpath>
|
||||
<xpath expr="//table[@t-if='o.pack_operation_ids']" position="after">
|
||||
<t t-if="o.valued and o.sale_id and o.pack_operation_ids">
|
||||
<xpath expr="//table[@t-if='o.move_line_ids']" position="after">
|
||||
<t t-if="o.valued and o.sale_id and o.move_line_ids">
|
||||
<table class="table table-condensed mt32">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -1,3 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import test_stock_picking_valued
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Tecnativa - David Vidal
|
||||
# Copyright 2017 Tecnativa - Luis M. Ontalba
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
@@ -38,6 +37,7 @@ class TestStockPickingValued(common.SavepointCase):
|
||||
self.sale_order.action_confirm()
|
||||
self.assertTrue(len(self.sale_order.picking_ids))
|
||||
for picking in self.sale_order.picking_ids:
|
||||
picking.action_assign()
|
||||
self.assertEqual(picking.amount_untaxed, 100.0)
|
||||
self.assertEqual(picking.amount_tax, 15.0)
|
||||
self.assertEqual(picking.amount_total, 115.0)
|
||||
@@ -46,6 +46,7 @@ class TestStockPickingValued(common.SavepointCase):
|
||||
""" Valued picking isn't computed if not reserved """
|
||||
self.sale_order.action_confirm()
|
||||
for picking in self.sale_order.picking_ids:
|
||||
picking.action_assign()
|
||||
picking.do_unreserve()
|
||||
self.assertEqual(picking.amount_untaxed, 0.0)
|
||||
self.assertEqual(picking.amount_tax, 0.0)
|
||||
@@ -57,6 +58,7 @@ class TestStockPickingValued(common.SavepointCase):
|
||||
self.sale_order.action_confirm()
|
||||
self.assertTrue(len(self.sale_order.picking_ids))
|
||||
for picking in self.sale_order.picking_ids:
|
||||
picking.action_assign()
|
||||
self.assertEqual(picking.amount_untaxed, 100.0)
|
||||
self.assertEqual(picking.amount_tax, 15.0)
|
||||
self.assertEqual(picking.amount_total, 115.0)
|
||||
@@ -1,134 +0,0 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_valued_picking_report
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-08-21 08:13+0000\n"
|
||||
"PO-Revision-Date: 2017-08-21 10:13+0200\n"
|
||||
"Last-Translator: Carlos Dauden <carlos.dauden@tecnativa.com>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: \n"
|
||||
"Language: es\n"
|
||||
"X-Generator: Poedit 1.8.7.1\n"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Discount</strong>"
|
||||
msgstr "<strong>Dto</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Subtotal</strong>"
|
||||
msgstr "<strong>Subtotal</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Taxes</strong>"
|
||||
msgstr "<strong>Impuestos</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Total</strong>"
|
||||
msgstr "<strong>Total</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Unit Price</strong>"
|
||||
msgstr "<strong>Precio Unidad</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Untaxed Amount</strong>"
|
||||
msgstr "<strong>Base imponible</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_currency_id
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_currency_id
|
||||
msgid "Currency"
|
||||
msgstr "Moneda"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model,name:stock_valued_picking_report.model_stock_pack_operation
|
||||
msgid "Packing Operation"
|
||||
msgstr "Operación de empaquetado"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model,name:stock_valued_picking_report.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr "Empresa"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_price_subtotal
|
||||
msgid "Price subtotal"
|
||||
msgstr "Subtotal"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_line
|
||||
msgid "Related order line"
|
||||
msgstr "Línea de pedido relacionada"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_discount
|
||||
msgid "Sale discount (%)"
|
||||
msgstr "Descuento venta (%)"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_price_unit
|
||||
msgid "Sale price unit"
|
||||
msgstr "Precio venta"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_tax_description
|
||||
msgid "Tax Description"
|
||||
msgstr "Descripción de impuesto"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_price_tax
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_tax_id
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_amount_tax
|
||||
msgid "Taxes"
|
||||
msgstr "Impuestos"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_price_total
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_amount_total
|
||||
msgid "Total"
|
||||
msgstr "Total"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model,name:stock_valued_picking_report.model_stock_picking
|
||||
msgid "Transfer"
|
||||
msgstr "Transferir"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_amount_untaxed
|
||||
msgid "Untaxed Amount"
|
||||
msgstr "Base imponible"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_res_partner_valued_picking
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_valued
|
||||
msgid "Valued picking"
|
||||
msgstr "Albarán valorado"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_website_message_ids
|
||||
msgid "Website Messages"
|
||||
msgstr "Mensajes del sitio web"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,help:stock_valued_picking_report.field_stock_picking_website_message_ids
|
||||
msgid "Website communication history"
|
||||
msgstr "Historial de comunicaciones del sitio web"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,help:stock_valued_picking_report.field_res_partner_valued_picking
|
||||
#: model:ir.model.fields,help:stock_valued_picking_report.field_stock_picking_valued
|
||||
msgid "You can select which partners have valued pickings"
|
||||
msgstr "Puede seleccionar qué empresas tienen albarán valorado"
|
||||
@@ -1,127 +0,0 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_valued_picking_report
|
||||
#
|
||||
# Translators:
|
||||
# Bole <bole@dajmi5.com>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-12-01 02:22+0000\n"
|
||||
"PO-Revision-Date: 2017-12-01 02:22+0000\n"
|
||||
"Last-Translator: Bole <bole@dajmi5.com>, 2018\n"
|
||||
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: hr\n"
|
||||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Discount</strong>"
|
||||
msgstr "<strong>Popust</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Subtotal</strong>"
|
||||
msgstr "<strong>Subtotal</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Taxes</strong>"
|
||||
msgstr "<strong>Porezi</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Total</strong>"
|
||||
msgstr "<strong>Total</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Unit Price</strong>"
|
||||
msgstr "<strong>Jed.cijena</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking
|
||||
msgid "<strong>Untaxed Amount</strong>"
|
||||
msgstr "<strong>Bez poreza</strong>"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_currency_id
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_currency_id
|
||||
msgid "Currency"
|
||||
msgstr "Valuta"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model,name:stock_valued_picking_report.model_stock_pack_operation
|
||||
msgid "Packing Operation"
|
||||
msgstr "Operacija pakiranja"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model,name:stock_valued_picking_report.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr "Partner"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_price_subtotal
|
||||
msgid "Price subtotal"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_line
|
||||
msgid "Related order line"
|
||||
msgstr "Povezana stavka ponude"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_discount
|
||||
msgid "Sale discount (%)"
|
||||
msgstr "Popust prodaje (%)"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_price_unit
|
||||
msgid "Sale price unit"
|
||||
msgstr "Prodajna cijena"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_tax_description
|
||||
msgid "Tax Description"
|
||||
msgstr "Opis poreza"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_price_tax
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_tax_id
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_amount_tax
|
||||
msgid "Taxes"
|
||||
msgstr "Porezi"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_price_total
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_amount_total
|
||||
msgid "Total"
|
||||
msgstr "Ukupno"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model,name:stock_valued_picking_report.model_stock_picking
|
||||
msgid "Transfer"
|
||||
msgstr "Transfer"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_amount_untaxed
|
||||
msgid "Untaxed Amount"
|
||||
msgstr "Iznos bez poreza"
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_res_partner_valued_picking
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_res_users_valued_picking
|
||||
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_picking_valued
|
||||
msgid "Valued picking"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_valued_picking_report
|
||||
#: model:ir.model.fields,help:stock_valued_picking_report.field_res_partner_valued_picking
|
||||
#: model:ir.model.fields,help:stock_valued_picking_report.field_res_users_valued_picking
|
||||
#: model:ir.model.fields,help:stock_valued_picking_report.field_stock_picking_valued
|
||||
msgid "You can select which partners have valued pickings"
|
||||
msgstr ""
|
||||
@@ -1,5 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import res_partner
|
||||
from . import stock_pack_operation
|
||||
from . import stock_picking
|
||||
@@ -1,94 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2014 Pedro M. Baeza - Tecnativa <pedro.baeza@tecnativa.com>
|
||||
# Copyright 2015 Antonio Espinosa - Tecnativa <antonio.espinosa@tecnativa.com>
|
||||
# Copyright 2016 Carlos Dauden - Tecnativa <carlos.dauden@tecnativa.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo.addons import decimal_precision as dp
|
||||
|
||||
|
||||
class StockPackOperation(models.Model):
|
||||
_inherit = "stock.pack.operation"
|
||||
|
||||
currency_id = fields.Many2one(
|
||||
related='sale_line.currency_id', readonly=True,
|
||||
string='Currency')
|
||||
sale_line = fields.Many2one(
|
||||
comodel_name='sale.order.line',
|
||||
compute='_compute_sale_order_line_fields',
|
||||
string="Related order line")
|
||||
sale_tax_id = fields.Many2many(
|
||||
comodel_name='account.tax',
|
||||
compute='_compute_sale_order_line_fields',
|
||||
string="Taxes")
|
||||
sale_tax_description = fields.Char(
|
||||
compute='_compute_sale_order_line_fields',
|
||||
string='Tax Description')
|
||||
sale_price_unit = fields.Float(
|
||||
compute='_compute_sale_order_line_fields',
|
||||
digits=dp.get_precision('Product Price'),
|
||||
string="Sale price unit")
|
||||
sale_discount = fields.Float(
|
||||
compute='_compute_sale_order_line_fields',
|
||||
digits=dp.get_precision('Discount'),
|
||||
string="Sale discount (%)")
|
||||
sale_price_subtotal = fields.Monetary(
|
||||
compute='_compute_sale_order_line_fields',
|
||||
string="Price subtotal")
|
||||
sale_price_tax = fields.Float(
|
||||
compute='_compute_sale_order_line_fields',
|
||||
string='Taxes')
|
||||
sale_price_total = fields.Monetary(
|
||||
compute='_compute_sale_order_line_fields',
|
||||
string='Total')
|
||||
|
||||
@api.multi
|
||||
def _compute_sale_order_line_fields(self):
|
||||
for operation in self:
|
||||
sale_lines = operation.mapped(
|
||||
'linked_move_operation_ids.move_id.procurement_id.'
|
||||
'sale_line_id')
|
||||
operation.update(operation.sale_lines_values(sale_lines))
|
||||
|
||||
@api.multi
|
||||
def sale_lines_values(self, sale_lines):
|
||||
if len(sale_lines) <= 1:
|
||||
price_unit = sale_lines.price_unit
|
||||
discount = sale_lines.discount
|
||||
else:
|
||||
sum_qty = 0.0
|
||||
sum_price = 0.0
|
||||
sum_discount = 0.0
|
||||
for sale_line in sale_lines:
|
||||
sum_qty += sale_line.product_uom_qty
|
||||
sum_price += sale_line.price_unit * sale_line.product_uom_qty
|
||||
sum_discount += sale_line.discount * sale_line.product_uom_qty
|
||||
price_unit = sum_price / (sum_qty or 1)
|
||||
discount = sum_discount / (sum_qty or 1)
|
||||
price_reduce = price_unit * (1 - (discount or 0.0) / 100.0)
|
||||
sale_line = sale_lines[:1]
|
||||
sale_tax = sale_line.tax_id
|
||||
taxes = sale_tax.compute_all(
|
||||
price_unit=price_reduce,
|
||||
currency=sale_line.currency_id,
|
||||
quantity=self.product_qty,
|
||||
product=sale_line.product_id,
|
||||
partner=sale_line.order_id.partner_id)
|
||||
if sale_line.company_id.tax_calculation_rounding_method == (
|
||||
'round_globally'):
|
||||
price_tax = sum(
|
||||
t.get('amount', 0.0) for t in taxes.get('taxes', []))
|
||||
else:
|
||||
price_tax = taxes['total_included'] - taxes['total_excluded']
|
||||
return {
|
||||
'sale_line': sale_line,
|
||||
'sale_tax_id': sale_tax,
|
||||
'sale_tax_description': ', '.join(map(lambda x: (
|
||||
x.description or x.name), sale_tax)),
|
||||
'sale_price_unit': price_unit,
|
||||
'sale_discount': discount,
|
||||
'sale_price_subtotal': taxes['total_excluded'],
|
||||
'sale_price_tax': price_tax,
|
||||
'sale_price_total': taxes['total_included'],
|
||||
}
|
||||
Reference in New Issue
Block a user