[MIG] stock_valued_picking_report: Migration to 9.0

This commit is contained in:
Carlos Dauden
2016-12-09 21:00:37 +01:00
committed by Pedro M. Baeza
parent 877d07d9f4
commit 0c402dac6a
17 changed files with 365 additions and 701 deletions

View File

@@ -1,21 +1,69 @@
Valued pickings
===============
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
Add amount information to picking list report and delivery order view.
===========================
Stock Valued Picking Report
===========================
Add amount information to Delivery Slip report.
You can select at partner level if picking list report must be valued or not.
Installation
============
To install this module, stock_picking_taxes is required, that it's available at:
Usage
=====
https://github.com/odoomrp/odoomrp-wip
To use this module, you need:
#. Go to Customers
#. Set valued field
#. Create a Sale Order with stockable products
#. Confirm Sale Order
#. Click Deliveries button
#. Go to Print > Delivery Slip
.. 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/9.0
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/stock-logistics-reporting/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Antonio Espinosa <antonioea@antiun.com>
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Antonio Espinosa <antonio.espinosa@tecnativa.com>
* Oihane Crucelaegui <oihane.crucelaegi@avanzosc.es>
* Carlos Dauden <carlos.dauden@tecnativa.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit https://odoo-community.org.

View File

@@ -1,20 +1,3 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
from . import models

View File

@@ -1,46 +1,26 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# Copyright (c) 2015 Antiun Ingenieria (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- 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).
{
"name": "Valued picking list",
"version": "8.0.0.2.0",
"author": "Serv. Tecnol. Avanzados - Pedro M. Baeza",
"website": "www.serviciosbaeza.com",
"name": "Stock Valued Picking Report",
"summary": "Adding Valued Picking on Delivery Slip report",
"version": "9.0.1.0.0",
"author": "Tecnativa, "
"Odoo Community Association (OCA)",
"website": "https://www.tecnativa.com",
"category": "Warehouse Management",
"license": "GPL-3",
"license": "AGPL-3",
"depends": [
"base",
"account",
"stock",
"sale",
"delivery",
"stock_picking_taxes",
"web_context_tunnel"
],
"data": [
'views/res_partner_view.xml',
'views/stock_picking_view.xml',
'report/stock_picking_valued_report.xml',
],
"installable": True

View File

@@ -1,19 +1,62 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_valued_picking_report
# * stock_valued_picking_report
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-04-20 10:01+0000\n"
"PO-Revision-Date: 2015-04-20 10:01+0000\n"
"Last-Translator: <>\n"
"POT-Creation-Date: 2017-03-13 14:39+0100\n"
"PO-Revision-Date: 2017-03-13 14:41+0100\n"
"Last-Translator: Carlos Dauden <carlos.dauden@tecnativa.com>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \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</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
@@ -21,42 +64,64 @@ msgid "Partner"
msgstr "Empresa"
#. module: stock_valued_picking_report
#: model:ir.model,name:stock_valued_picking_report.model_stock_picking
msgid "Picking List"
msgstr "Albarán"
#. module: stock_valued_picking_report
#: model:ir.model,name:stock_valued_picking_report.model_stock_move
msgid "Stock Move"
msgstr "Movimiento de existencias"
#. module: stock_valued_picking_report
#: view:website:stock.report_picking
msgid "Subtotal"
#: 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
#: view:website:stock.report_picking
#: model:ir.model.fields,field_description:stock_valued_picking_report.field_stock_pack_operation_sale_line
msgid "Related order line"
msgstr "Linea 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
#: view:website:stock.report_picking
#: 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
#: view:website:stock.report_picking
msgid "Untaxed amount"
#: 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
#: field:stock.picking,valued:0
msgid "Valued"
msgstr "Valorado"
#. module: stock_valued_picking_report
#: field:res.partner,valued_picking:0
#: 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,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 que empresas tienen albarán valorado"
#~ msgid "Amount total"
#~ msgstr "Importe total"

View File

@@ -1,62 +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 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-04-20 10:00+0000\n"
"PO-Revision-Date: 2015-04-20 10:00+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: stock_valued_picking_report
#: model:ir.model,name:stock_valued_picking_report.model_res_partner
msgid "Partner"
msgstr ""
#. module: stock_valued_picking_report
#: model:ir.model,name:stock_valued_picking_report.model_stock_picking
msgid "Picking List"
msgstr ""
#. module: stock_valued_picking_report
#: model:ir.model,name:stock_valued_picking_report.model_stock_move
msgid "Stock Move"
msgstr ""
#. module: stock_valued_picking_report
#: view:website:stock.report_picking
msgid "Subtotal"
msgstr ""
#. module: stock_valued_picking_report
#: view:website:stock.report_picking
msgid "Taxes"
msgstr ""
#. module: stock_valued_picking_report
#: view:website:stock.report_picking
msgid "Total"
msgstr ""
#. module: stock_valued_picking_report
#: view:website:stock.report_picking
msgid "Untaxed amount"
msgstr ""
#. module: stock_valued_picking_report
#: field:stock.picking,valued:0
msgid "Valued"
msgstr ""
#. module: stock_valued_picking_report
#: field:res.partner,valued_picking:0
msgid "Valued picking"
msgstr ""

View File

@@ -1,22 +1,5 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
from . import res_partner
from . import stock_move
from . import stock_pack_operation
from . import stock_picking

View File

@@ -1,30 +1,16 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# Copyright (c) 2015 Antiun Ingenieria (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- 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 openerp import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
# You can select which partners has valued pickings
valued_picking = fields.Boolean(string='Valued picking', default=True)
valued_picking = fields.Boolean(
default=True,
help='You can select which partners have valued pickings'
)

View File

@@ -1,58 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# Copyright (c) 2015 Antiun Ingenieria (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import fields, models, api
class StockMove(models.Model):
_inherit = "stock.move"
sale_price_unit = fields.Float(
string="Sale price unit", readonly=True,
related='procurement_id.sale_line_id.price_unit')
sale_discount = fields.Float(
string="Sale discount (%)", readonly=True,
related='procurement_id.sale_line_id.discount')
sale_price_subtotal = fields.Float(
string="Price subtotal", readonly=True,
compute='_get_sale_price_subtotal')
@api.one
@api.depends(
'sale_price_unit',
'sale_discount',
'product_qty',
'procurement_id.sale_line_id.order_id.currency_id',
)
def _get_sale_price_subtotal(self):
subtotal = (self.sale_price_unit * self.product_qty *
(1 - (self.sale_discount or 0.0) / 100.0))
# Only get subtotal if this stock.move belongs to a
# stock.picking created from a sale.order
if self.procurement_id and self.procurement_id.sale_line_id:
# Round by currency precision
currency = self.procurement_id.sale_line_id.order_id.currency_id
if currency:
subtotal = currency.round(subtotal)
# Write subtotal into record (cache because this field is store=False)
self.sale_price_subtotal = subtotal

View File

@@ -0,0 +1,94 @@
# -*- 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 openerp import api, fields, models
from openerp.addons.decimal_precision import decimal_precision as dp
class StockPackOperation(models.Model):
_inherit = "stock.pack.operation"
currency_id = fields.Many2one(
related='sale_line.currency_id',
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'],
}

View File

@@ -1,33 +1,38 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# Copyright (c) 2015 Antiun Ingenieria (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- 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 openerp import fields, models
from openerp import api, fields, models
class StockPicking(models.Model):
_inherit = "stock.picking"
valued = fields.Boolean(
string='Valued', related='partner_id.valued_picking', store=True,
readonly=True)
valued = fields.Boolean(related='partner_id.valued_picking')
currency_id = fields.Many2one(
related='sale_id.currency_id',
string='Currency')
amount_untaxed = fields.Monetary(
compute='_compute_amount_all',
string='Untaxed Amount')
amount_tax = fields.Monetary(
compute='_compute_amount_all',
string='Taxes')
amount_total = fields.Monetary(
compute='_compute_amount_all',
string='Total')
@api.multi
def _compute_amount_all(self):
for pick in self:
amount_untaxed = sum(pick.pack_operation_ids.mapped(
'sale_price_subtotal'))
amount_tax = sum(pick.pack_operation_ids.mapped(
'sale_price_tax'))
pick.update({
'amount_untaxed': amount_untaxed,
'amount_tax': amount_tax,
'amount_total': amount_untaxed + amount_tax,
})

View File

@@ -1,302 +0,0 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="30.0" y1="27.0" width="508" height="815"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Tabla2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#666666" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#666666" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#666666" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#666666" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Tabla4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Tabla3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Footer" fontName="Helvetica"/>
<paraStyle name="Table Contents" fontName="Helvetica"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<para style="terp_default_9">[[repeatIn(objects,'o')]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_default_9">[[ (not(o.sale_id) and o.type== 'out') and 'Error, no sale order attached to this picking !' or removeParentNode('para') ]]</para>
<blockTable colWidths="287.0,254.0" repeatRows="1" style="Tableau1">
<tr>
<td>
<para style="terp_default_Bold_9">Invoiced to</para>
<para style="terp_default_9">[[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.name or '']]</para>
<para style="terp_default_9">[[ o.sale_id and o.sale_id.partner_invoice_id and display_address(o.sale_id.partner_invoice_id) ]]</para>
</td>
<td>
<para style="terp_default_9">[[ o.partner_id and o.partner_id and o.partner_id.name or '' ]]</para>
<para style="terp_default_9">[[ o.partner_id and o.partner_id and display_address(o.partner_id) ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_header">Delivery Order : [[ o.name ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="126.0,103.0,103.0,103.0,103.0" style="Table1">
<tr>
<td>
<para style="terp_tblheader_General_Centre">Order Ref.</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Order Date</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Shipping Date</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Carrier</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Weight</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="126.0,103.0,103.0,103.0,103.0" style="Table2">
<tr>
<td>
<para style="terp_default_Centre_8">[[ o.sale_id and o.sale_id.name ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(o.date,date_time=True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(o.min_date,date_time = True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.carrier_id and o.carrier_id.name or '' ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(o.weight) ]]</para>
</td>
</tr>
</blockTable>
<para style="Standard">
<font color="white"> </font>
</para>
<para style="Standard">
<font color="white"> </font>
</para>
<blockTable colWidths="283.0,88.0,94.0,73.0" repeatRows="1" style="Tabla2">
<tr>
<td>
<para style="terp_tblheader_Details">[[ o.sale_id and o.sale_id.partner_id and o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]] Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Unit price</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Subtotal</para>
</td>
</tr>
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details">[[ o.sale_id and o.sale_id.partner_id and not o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Lot</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_1">[[repeatIn(o.move_lines,'line')]]</para>
<blockTable colWidths="283.0,88.0,94.0,72.0" style="Tabla4">
<tr>
<td>
<para style="terp_default_9">[[line.product_id.code ]] [[ line.product_id and line.product_id.name or '']]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ o.sale_id and o.sale_id.partner_id and o.sale_id.partner_id.valued_picking and formatLang(line.sale_price_unit, dp='Product Price', currency_obj=o.sale_id.currency_id) or removeParentNode('tr') ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.product_qty) ]] [[ line.product_uom and line.product_uom.name ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.sale_price_subtotal, dp='Account', currency_obj=o.sale_id.currency_id) ]]</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9">[[line.product_id.code ]] [[ line.product_id and line.product_id.name or '']]</para>
</td>
<td>
<para style="Standard">[[ o.sale_id and o.sale_id.partner_id and not o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ (line.prodlot_id and (line.prodlot_id.name + (line.prodlot_id.ref and ('/' + line.prodlot_id.ref) or ''))) or ' ' ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.product_qty) ]] [[ line.product_uom and line.product_uom.name ]]</para>
</td>
</tr>
</blockTable>
</section>
<blockTable colWidths="371.0,94.0,74.0" style="Tabla3">
<tr>
<td>
<para style="Standard">[[ o.sale_id and o.sale_id.partner_id and o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Untaxed amount</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(o.amount_untaxed, dp='Account', currency_obj=o.sale_id.currency_id) ]]</para>
</td>
</tr>
<tr>
<td>
<para style="Standard">[[ o.sale_id and o.sale_id.partner_id and o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Taxes</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.sale_id.currency_id) ]]</para>
</td>
</tr>
<tr>
<td>
<para style="Standard">[[ o.sale_id and o.sale_id.partner_id and o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Total</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(o.amount_total, dp='Account', currency_obj=o.sale_id.currency_id) ]]</para>
</td>
</tr>
<tr>
<td>
<para style="Standard">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<para style="Standard">
<font color="white"> </font>
</para>
</story>
</document>

View File

@@ -1 +0,0 @@
python /opt/openerp/v7/ocb-addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py ./shipping.sxw > ./shipping.rml

View File

@@ -1,51 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="valued_report_picking" inherit_id="stock.report_picking">
<xpath expr="//table[@t-if='not o.pack_operation_ids']//strong[.='Destination']/../.."
position="after">
<t t-if="o.partner_id.valued_picking">
<th><strong>Unit Price</strong></th>
<th groups="sale.group_discount_per_so_line">
<strong>Discount</strong>
</th>
<th><strong>Subtotal</strong></th>
</t>
</xpath>
<xpath expr="//span[@t-field='move.location_dest_id']/../.." position="after">
<t t-if="o.partner_id.valued_picking">
<td><span t-field="move.sale_price_unit" /></td>
<td groups="sale.group_discount_per_so_line">
<span t-field="move.sale_discount" />
</td>
<td><span t-field="move.sale_price_subtotal" /></td>
</t>
</xpath>
<xpath expr="//table[@t-if='o.pack_operation_ids']" position="after">
<br />
<br />
<table>
<tr>
<td>Untaxed amount</td>
<td><span t-field="o.amount_untaxed" /></td>
</tr>
<tr>
<td>Taxes</td>
<td><span t-field="o.amount_tax" />
<table>
<tr t-foreach="o.taxes" t-as="tax">
<td><span t-field="tax.name" /></td>
<td><span t-field="tax.amount" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>Total</td>
<td><span t-field="o.amount_total" /></td>
</tr>
<odoo>
<template id="valued_report_picking" inherit_id="stock.report_delivery_document">
<xpath expr="//table[@t-if='o.pack_operation_ids']/thead/tr"
position="inside">
<t t-if="o.valued and o.sale_id">
<th class="text-right"><strong>Unit Price</strong></th>
<th class="text-right" groups="sale.group_discount_per_so_line">
<strong>Discount</strong>
</th>
<th class="text-right"><strong>Subtotal</strong></th>
<th class="text-right"><strong>Taxes</strong></th>
</t>
</xpath>
<xpath expr="//span[@t-field='pack_operation.product_uom_id']/.." position="after">
<t t-if="o.valued">
<td class="text-right"><span t-field="pack_operation.sale_price_unit" /></td>
<td class="text-right" groups="sale.group_discount_per_so_line">
<span t-field="pack_operation.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>
</t>
</xpath>
<xpath expr="//table[@t-if='o.pack_operation_ids']" position="after">
<t t-if="o.valued and o.sale_id">
<table class="table table-condensed table-bordered mt32">
<thead>
<tr>
<th class="text-right"><strong>Untaxed Amount</strong></th>
<th class="text-right"><strong>Taxes</strong></th>
<th class="text-right"><strong>Total</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-right">
<span t-field="o.amount_untaxed"/>
</td>
<td class="text-right">
<span t-field="o.amount_tax"/>
</td>
<td class="text-right">
<span t-field="o.amount_total"/>
</td>
</tr>
</tbody>
</table>
</xpath>
</template>
</data>
</openerp>
</t>
</xpath>
</template>
</odoo>

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.actions.report.xml" id="delivery.report_shipping">
<field name="name">Valued delivery order</field>
<field name="model">stock.picking</field>
<field name="report_name">stock_valued_picking_report.report_shipping</field>
<field name="report_file">stock_valued_picking/report/shipping.rml</field>
</record>
</data>
</openerp>

View File

@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<odoo>
<record model="ir.ui.view" id="view_partner_valued_pickimg">
<field name="name">Partner view (Valued picking)</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="active" position="after">
<field name="valued_picking"
attrs="{'invisible': [('customer', '=', False)]}"/>
</field>
<record model="ir.ui.view" id="view_partner_valued_picking">
<field name="name">Partner view (Valued picking)</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="valued_picking"
attrs="{'invisible': [('customer', '=', False)]}"/>
</field>
</record>
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_move_picking_tree">
<field name="name">stock.move.tree</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_picking_tree" />
<field name="arch" type="xml">
<field name="location_id" position="before">
<field name="sale_price_unit" invisible="not context.get('show_valued')"/>
<field name="sale_discount" invisible="not context.get('show_valued')" groups="sale.group_discount_per_so_line"/>
<field name="sale_price_subtotal" invisible="not context.get('show_valued')"/>
</field>
</field>
</record>
<!-- Inherited from : /addons/stock/stock_view.xml -->
<record model="ir.ui.view" id="view_picking_form_valued">
<field name="name">Valued Stock Picking</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock_picking_taxes.view_picking_form"/>
<field name="arch" type="xml">
<field name="move_lines" position="attributes">
<attribute name="context_valued">{'show_valued': bool(sale_id) and valued}</attribute>
</field>
<group name="subtotal_footer" position="before">
<group class="oe_subtotal_footer oe_right" name="valued_info">
<field name="valued" invisible="1"/>
</group>
</group>
<group name="subtotal_footer" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('sale_id', '=', False),('valued', '=', False)]}</attribute>
</group>
<page string="Taxes" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('sale_id', '=', False),('valued', '=', False)]}</attribute>
</page>
</field>
</record>
</data>
</openerp>