diff --git a/stock_valued_picking_report/README.rst b/stock_valued_picking_report/README.rst index 381133d..a58704d 100644 --- a/stock_valued_picking_report/README.rst +++ b/stock_valued_picking_report/README.rst @@ -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 +`_. 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 `_. + Contributors ------------ -* Pedro M. Baeza -* Antonio Espinosa + +* Pedro M. Baeza +* Antonio Espinosa * Oihane Crucelaegui +* Carlos Dauden + + +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. diff --git a/stock_valued_picking_report/__init__.py b/stock_valued_picking_report/__init__.py index 01ebe5c..cde864b 100644 --- a/stock_valued_picking_report/__init__.py +++ b/stock_valued_picking_report/__init__.py @@ -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 . -# -############################################################################## +# -*- coding: utf-8 -*- + from . import models diff --git a/stock_valued_picking_report/__openerp__.py b/stock_valued_picking_report/__openerp__.py index ac75dee..ce1f9ab 100644 --- a/stock_valued_picking_report/__openerp__.py +++ b/stock_valued_picking_report/__openerp__.py @@ -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 -# Copyright (c) 2015 Antiun Ingenieria (http://www.antiun.com) -# Antonio Espinosa -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright 2014 Pedro M. Baeza - Tecnativa +# Copyright 2015 Antonio Espinosa - Tecnativa +# Copyright 2016 Carlos Dauden - Tecnativa +# 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 diff --git a/stock_valued_picking_report/i18n/es.po b/stock_valued_picking_report/i18n/es.po index ee414a2..67d4bc0 100644 --- a/stock_valued_picking_report/i18n/es.po +++ b/stock_valued_picking_report/i18n/es.po @@ -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 \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 "Discount" +msgstr "Dto" + +#. module: stock_valued_picking_report +#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking +msgid "Subtotal" +msgstr "Subtotal" + +#. module: stock_valued_picking_report +#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking +msgid "Taxes" +msgstr "Impuestos" + +#. module: stock_valued_picking_report +#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking +msgid "Total" +msgstr "Total" + +#. module: stock_valued_picking_report +#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking +msgid "Unit Price" +msgstr "Precio" + +#. module: stock_valued_picking_report +#: model:ir.ui.view,arch_db:stock_valued_picking_report.valued_report_picking +msgid "Untaxed Amount" +msgstr "Base imponible" + +#. 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" diff --git a/stock_valued_picking_report/i18n/stock_valued_picking_report.pot b/stock_valued_picking_report/i18n/stock_valued_picking_report.pot deleted file mode 100644 index e751d92..0000000 --- a/stock_valued_picking_report/i18n/stock_valued_picking_report.pot +++ /dev/null @@ -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 "" - diff --git a/stock_valued_picking_report/models/__init__.py b/stock_valued_picking_report/models/__init__.py index e7621b0..bd44108 100644 --- a/stock_valued_picking_report/models/__init__.py +++ b/stock_valued_picking_report/models/__init__.py @@ -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 . -# -############################################################################## +# -*- coding: utf-8 -*- + from . import res_partner -from . import stock_move +from . import stock_pack_operation from . import stock_picking diff --git a/stock_valued_picking_report/models/res_partner.py b/stock_valued_picking_report/models/res_partner.py index 0c78931..2218d30 100644 --- a/stock_valued_picking_report/models/res_partner.py +++ b/stock_valued_picking_report/models/res_partner.py @@ -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 -# Copyright (c) 2015 Antiun Ingenieria (http://www.antiun.com) -# Antonio Espinosa -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright 2014 Pedro M. Baeza - Tecnativa +# Copyright 2015 Antonio Espinosa - Tecnativa +# Copyright 2016 Carlos Dauden - Tecnativa +# 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' + ) diff --git a/stock_valued_picking_report/models/stock_move.py b/stock_valued_picking_report/models/stock_move.py deleted file mode 100644 index 4088968..0000000 --- a/stock_valued_picking_report/models/stock_move.py +++ /dev/null @@ -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 -# Copyright (c) 2015 Antiun Ingenieria (http://www.antiun.com) -# Antonio Espinosa -# -# 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 . -# -############################################################################## -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 diff --git a/stock_valued_picking_report/models/stock_pack_operation.py b/stock_valued_picking_report/models/stock_pack_operation.py new file mode 100644 index 0000000..2bd1e34 --- /dev/null +++ b/stock_valued_picking_report/models/stock_pack_operation.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- +# Copyright 2014 Pedro M. Baeza - Tecnativa +# Copyright 2015 Antonio Espinosa - Tecnativa +# Copyright 2016 Carlos Dauden - Tecnativa +# 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'], + } diff --git a/stock_valued_picking_report/models/stock_picking.py b/stock_valued_picking_report/models/stock_picking.py index bda5bb0..ed57f64 100644 --- a/stock_valued_picking_report/models/stock_picking.py +++ b/stock_valued_picking_report/models/stock_picking.py @@ -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 -# Copyright (c) 2015 Antiun Ingenieria (http://www.antiun.com) -# Antonio Espinosa -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright 2014 Pedro M. Baeza - Tecnativa +# Copyright 2015 Antonio Espinosa - Tecnativa +# Copyright 2016 Carlos Dauden - Tecnativa +# 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, + }) diff --git a/stock_valued_picking_report/report/shipping.rml b/stock_valued_picking_report/report/shipping.rml deleted file mode 100644 index 0ae0875..0000000 --- a/stock_valued_picking_report/report/shipping.rml +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[repeatIn(objects,'o')]] - - - - [[ (not(o.sale_id) and o.type== 'out') and 'Error, no sale order attached to this picking !' or removeParentNode('para') ]] - - - - Invoiced to - [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.name or '']] - [[ o.sale_id and o.sale_id.partner_invoice_id and display_address(o.sale_id.partner_invoice_id) ]] - - - [[ o.partner_id and o.partner_id and o.partner_id.name or '' ]] - [[ o.partner_id and o.partner_id and display_address(o.partner_id) ]] - - - - Delivery Order : [[ o.name ]] - - - - - - - Order Ref. - - - Order Date - - - Shipping Date - - - Carrier - - - Weight - - - - - - - [[ o.sale_id and o.sale_id.name ]] - - - [[ formatLang(o.date,date_time=True) ]] - - - [[ formatLang(o.min_date,date_time = True) ]] - - - [[ o.carrier_id and o.carrier_id.name or '' ]] - - - [[ formatLang(o.weight) ]] - - - - - - - - - - - - - [[ o.sale_id and o.sale_id.partner_id and o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]] Description - - - Unit price - - - Quantity - - - Subtotal - - - - - Description - - - [[ o.sale_id and o.sale_id.partner_id and not o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]] - - - Lot - - - Quantity - - - -
- [[repeatIn(o.move_lines,'line')]] - - - - [[line.product_id.code ]] [[ line.product_id and line.product_id.name or '']] - - - [[ 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') ]] - - - [[ formatLang(line.product_qty) ]] [[ line.product_uom and line.product_uom.name ]] - - - [[ formatLang(line.sale_price_subtotal, dp='Account', currency_obj=o.sale_id.currency_id) ]] - - - - - [[line.product_id.code ]] [[ line.product_id and line.product_id.name or '']] - - - [[ o.sale_id and o.sale_id.partner_id and not o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]] - - - [[ (line.prodlot_id and (line.prodlot_id.name + (line.prodlot_id.ref and ('/' + line.prodlot_id.ref) or ''))) or ' ' ]] - - - [[ formatLang(line.product_qty) ]] [[ line.product_uom and line.product_uom.name ]] - - - -
- - - - [[ o.sale_id and o.sale_id.partner_id and o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]] - - - Untaxed amount - - - [[ formatLang(o.amount_untaxed, dp='Account', currency_obj=o.sale_id.currency_id) ]] - - - - - [[ o.sale_id and o.sale_id.partner_id and o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]] - - - Taxes - - - [[ formatLang(o.amount_tax, dp='Account', currency_obj=o.sale_id.currency_id) ]] - - - - - [[ o.sale_id and o.sale_id.partner_id and o.sale_id.partner_id.valued_picking and ' ' or removeParentNode('tr') ]] - - - Total - - - [[ formatLang(o.amount_total, dp='Account', currency_obj=o.sale_id.currency_id) ]] - - - - - - - - - - - - - - - - - - - - - - - -
-
- diff --git a/stock_valued_picking_report/report/shipping.sxw b/stock_valued_picking_report/report/shipping.sxw deleted file mode 100644 index 98e751b..0000000 Binary files a/stock_valued_picking_report/report/shipping.sxw and /dev/null differ diff --git a/stock_valued_picking_report/report/shipping_convert.sh b/stock_valued_picking_report/report/shipping_convert.sh deleted file mode 100755 index f503dc4..0000000 --- a/stock_valued_picking_report/report/shipping_convert.sh +++ /dev/null @@ -1 +0,0 @@ -python /opt/openerp/v7/ocb-addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py ./shipping.sxw > ./shipping.rml diff --git a/stock_valued_picking_report/report/stock_picking_valued_report.xml b/stock_valued_picking_report/report/stock_picking_valued_report.xml index 756544b..f6fc3fe 100644 --- a/stock_valued_picking_report/report/stock_picking_valued_report.xml +++ b/stock_valued_picking_report/report/stock_picking_valued_report.xml @@ -1,51 +1,52 @@ - - - + diff --git a/stock_valued_picking_report/report/stock_valued_report.xml b/stock_valued_picking_report/report/stock_valued_report.xml deleted file mode 100644 index 01aecd2..0000000 --- a/stock_valued_picking_report/report/stock_valued_report.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Valued delivery order - stock.picking - stock_valued_picking_report.report_shipping - stock_valued_picking/report/shipping.rml - - - - - diff --git a/stock_valued_picking_report/views/res_partner_view.xml b/stock_valued_picking_report/views/res_partner_view.xml index 1f7957b..e331eaf 100644 --- a/stock_valued_picking_report/views/res_partner_view.xml +++ b/stock_valued_picking_report/views/res_partner_view.xml @@ -1,18 +1,16 @@ - - + - - Partner view (Valued picking) - res.partner - - - - - + + Partner view (Valued picking) + res.partner + + + + - + + - - + diff --git a/stock_valued_picking_report/views/stock_picking_view.xml b/stock_valued_picking_report/views/stock_picking_view.xml deleted file mode 100644 index 7059b11..0000000 --- a/stock_valued_picking_report/views/stock_picking_view.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - stock.move.tree - stock.move - - - - - - - - - - - - - Valued Stock Picking - stock.picking - - - - {'show_valued': bool(sale_id) and valued} - - - - - - - - {'invisible': ['|', ('sale_id', '=', False),('valued', '=', False)]} - - - {'invisible': ['|', ('sale_id', '=', False),('valued', '=', False)]} - - - - - -