diff --git a/stock_valued_picking_report/README.rst b/stock_valued_picking_report/README.rst index 29e0f7f..381133d 100644 --- a/stock_valued_picking_report/README.rst +++ b/stock_valued_picking_report/README.rst @@ -4,6 +4,13 @@ Valued pickings Add amount information to picking list report and delivery order view. 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: + +https://github.com/odoomrp/odoomrp-wip + Credits ======= @@ -11,3 +18,4 @@ Contributors ------------ * Pedro M. Baeza * Antonio Espinosa +* Oihane Crucelaegui diff --git a/stock_valued_picking_report/__openerp__.py b/stock_valued_picking_report/__openerp__.py index 7cd8dc8..ac75dee 100644 --- a/stock_valued_picking_report/__openerp__.py +++ b/stock_valued_picking_report/__openerp__.py @@ -24,18 +24,10 @@ { "name": "Valued picking list", - "version": "1.0", + "version": "8.0.0.2.0", "author": "Serv. Tecnol. Avanzados - Pedro M. Baeza", "website": "www.serviciosbaeza.com", "category": "Warehouse Management", - "description": """ -Valued pickings -=============== - -Add amount information to picking list report and delivery order view. - -You can select at partner level if picking list report must be valued or not. -""", "license": "GPL-3", "depends": [ "base", @@ -43,11 +35,13 @@ You can select at partner level if picking list report must be valued or not. "stock", "sale", "delivery", + "stock_picking_taxes", + "web_context_tunnel" ], "data": [ 'views/res_partner_view.xml', 'views/stock_picking_view.xml', - 'report/stock_valued_report.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 dba6cd3..ee414a2 100644 --- a/stock_valued_picking_report/i18n/es.po +++ b/stock_valued_picking_report/i18n/es.po @@ -1,102 +1,62 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: -# * stock_valued_picking +# * stock_valued_picking_report # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-29 10:48+0000\n" -"PO-Revision-Date: 2014-05-29 09:18+0000\n" -"Last-Translator: Pedro Manuel Baeza \n" +"POT-Creation-Date: 2015-04-20 10:01+0000\n" +"PO-Revision-Date: 2015-04-20 10:01+0000\n" +"Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-10-21 07:24+0000\n" -"X-Generator: Launchpad (build 17203)\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" -#. module: stock_valued_picking -#: code:_description:0 -#: model:ir.model,name:stock_valued_picking.model_stock_picking_out -#, python-format -msgid "Delivery Orders" -msgstr "Albaranes de salida" - -#. module: stock_valued_picking -#: code:_description:0 -#: model:ir.model,name:stock_valued_picking.model_res_partner -#, python-format +#. module: stock_valued_picking_report +#: model:ir.model,name:stock_valued_picking_report.model_res_partner msgid "Partner" msgstr "Empresa" -#. module: stock_valued_picking -#: code:_description:0 -#: model:ir.model,name:stock_valued_picking.model_stock_picking -#, python-format +#. 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 -#: field:stock.move,sale_price_subtotal:0 -msgid "Price subtotal" -msgstr "Subtotal" - -#. module: stock_valued_picking -#: field:stock.picking,currency_id:0 -#: field:stock.picking.out,currency_id:0 -msgid "Sale currency" -msgstr "Moneda de la venta" - -#. module: stock_valued_picking -#: field:stock.move,sale_discount:0 -msgid "Sale discount (%)" -msgstr "Descuento de la venta (%)" - -#. module: stock_valued_picking -#: field:stock.move,sale_price_unit:0 -msgid "Sale price unit" -msgstr "Precio unitario de la venta" - -#. module: stock_valued_picking -#: code:_description:0 -#: model:ir.model,name:stock_valued_picking.model_stock_move -#, python-format +#. 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 -#: field:stock.picking,amount_tax:0 -#: field:stock.picking.out,amount_tax:0 -#: report:sale.shipping:0 +#. module: stock_valued_picking_report +#: view:website:stock.report_picking +msgid "Subtotal" +msgstr "Subtotal" + +#. module: stock_valued_picking_report +#: view:website:stock.report_picking msgid "Taxes" msgstr "Impuestos" -#. module: stock_valued_picking -#: field:stock.picking,amount_total:0 -#: field:stock.picking.out,amount_total:0 -#: report:sale.shipping:0 +#. module: stock_valued_picking_report +#: view:website:stock.report_picking msgid "Total" msgstr "Total" -#. module: stock_valued_picking -#: field:stock.picking,amount_untaxed:0 -#: field:stock.picking.out,amount_untaxed:0 -#: report:sale.shipping:0 +#. module: stock_valued_picking_report +#: view:website:stock.report_picking msgid "Untaxed amount" msgstr "Base imponible" -#. module: stock_valued_picking +#. 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 msgid "Valued picking" msgstr "Albarán valorado" -#. module: stock_valued_picking -#: report:sale.shipping:0 -msgid "Unit price" -msgstr "Precio unitario" - -#. module: stock_valued_picking -#: report:sale.shipping:0 -msgid "Subtotal" -msgstr "Subtotal" diff --git a/stock_valued_picking_report/i18n/stock_valued_picking.pot b/stock_valued_picking_report/i18n/stock_valued_picking.pot deleted file mode 100644 index 1545f5c..0000000 --- a/stock_valued_picking_report/i18n/stock_valued_picking.pot +++ /dev/null @@ -1,102 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * stock_valued_picking -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-29 10:48+0000\n" -"PO-Revision-Date: 2014-04-29 12:49+0100\n" -"Last-Translator: Pedro Manuel Baeza \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" - -#. module: stock_valued_picking -#: code:_description:0 -#: model:ir.model,name:stock_valued_picking.model_stock_picking_out -#, python-format -msgid "Delivery Orders" -msgstr "" - -#. module: stock_valued_picking -#: code:_description:0 -#: model:ir.model,name:stock_valued_picking.model_res_partner -#, python-format -msgid "Partner" -msgstr "" - -#. module: stock_valued_picking -#: code:_description:0 -#: model:ir.model,name:stock_valued_picking.model_stock_picking -#, python-format -msgid "Picking List" -msgstr "" - -#. module: stock_valued_picking -#: field:stock.move,sale_price_subtotal:0 -msgid "Price subtotal" -msgstr "" - -#. module: stock_valued_picking -#: field:stock.picking,currency_id:0 -#: field:stock.picking.out,currency_id:0 -msgid "Sale currency" -msgstr "" - -#. module: stock_valued_picking -#: field:stock.move,sale_discount:0 -msgid "Sale discount (%)" -msgstr "" - -#. module: stock_valued_picking -#: field:stock.move,sale_price_unit:0 -msgid "Sale price unit" -msgstr "" - -#. module: stock_valued_picking -#: code:_description:0 -#: model:ir.model,name:stock_valued_picking.model_stock_move -#, python-format -msgid "Stock Move" -msgstr "" - -#. module: stock_valued_picking -#: field:stock.picking,amount_tax:0 -#: field:stock.picking.out,amount_tax:0 -#: report:sale.shipping:0 -msgid "Taxes" -msgstr "" - -#. module: stock_valued_picking -#: field:stock.picking,amount_total:0 -#: field:stock.picking.out,amount_total:0 -#: report:sale.shipping:0 -msgid "Total" -msgstr "" - -#. module: stock_valued_picking -#: field:stock.picking,amount_untaxed:0 -#: field:stock.picking.out,amount_untaxed:0 -#: report:sale.shipping:0 -msgid "Untaxed amount" -msgstr "" - -#. module: stock_valued_picking -#: field:res.partner,valued_picking:0 -msgid "Valued picking" -msgstr "" - -#. module: stock_valued_picking -#: report:sale.shipping:0 -msgid "Unit price" -msgstr "" - -#. module: stock_valued_picking -#: report:sale.shipping:0 -msgid "Subtotal" -msgstr "" - diff --git a/stock_valued_picking_report/i18n/stock_valued_picking_report.pot b/stock_valued_picking_report/i18n/stock_valued_picking_report.pot new file mode 100644 index 0000000..e751d92 --- /dev/null +++ b/stock_valued_picking_report/i18n/stock_valued_picking_report.pot @@ -0,0 +1,62 @@ +# 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/stock_picking.py b/stock_valued_picking_report/models/stock_picking.py index 8d88085..bda5bb0 100644 --- a/stock_valued_picking_report/models/stock_picking.py +++ b/stock_valued_picking_report/models/stock_picking.py @@ -21,8 +21,8 @@ # along with this program. If not, see . # ############################################################################## -from openerp import fields, models, api -from openerp.addons.decimal_precision import decimal_precision as dp + +from openerp import fields, models class StockPicking(models.Model): @@ -31,46 +31,3 @@ class StockPicking(models.Model): valued = fields.Boolean( string='Valued', related='partner_id.valued_picking', store=True, readonly=True) - currency_id = fields.Many2one( - string='Sale currency', related='sale_id.currency_id', store=True, - readonly=True) - amount_untaxed = fields.Float( - string='Untaxed amount', compute='_compute_amounts', - digits=dp.get_precision('Account'), store=True, readonly=True) - amount_tax = fields.Float( - string='Taxes', compute='_compute_amounts', - digits=dp.get_precision('Account'), store=True, readonly=True) - amount_total = fields.Float( - string='Total', compute='_compute_amounts', - digits=dp.get_precision('Account'), store=True, readonly=True) - - @api.one - @api.depends( - 'move_lines.sale_price_subtotal', - 'move_lines.product_id', - 'move_lines.procurement_id.sale_line_id.tax_id', - 'move_lines.procurement_id.sale_line_id.order_id.partner_id', - ) - def _compute_amounts(self): - # Calculate untaxed amount - untaxed = 0.0 - for move in self.move_lines: - untaxed += move.sale_price_subtotal - # Calculate taxed amount - tax = 0.0 - for move in self.move_lines: - if not (move.procurement_id and - move.procurement_id.sale_line_id): - continue - sale_line = move.procurement_id.sale_line_id - for c in sale_line.tax_id.compute_all( - move.sale_price_subtotal, move.product_qty, - move.product_id, sale_line.order_id.partner_id)['taxes']: - tax += c.get('amount', 0.0) - currency = self.currency_id - if currency: - tax = currency.round(tax) - # Write calculated amounts into recorrd - self.amount_untaxed = untaxed - self.amount_tax = tax - self.amount_total = untaxed + tax diff --git a/stock_valued_picking_report/report/stock_picking_valued_report.xml b/stock_valued_picking_report/report/stock_picking_valued_report.xml new file mode 100644 index 0000000..756544b --- /dev/null +++ b/stock_valued_picking_report/report/stock_picking_valued_report.xml @@ -0,0 +1,51 @@ + + + + + + diff --git a/stock_valued_picking_report/views/stock_picking_view.xml b/stock_valued_picking_report/views/stock_picking_view.xml index a372370..7059b11 100644 --- a/stock_valued_picking_report/views/stock_picking_view.xml +++ b/stock_valued_picking_report/views/stock_picking_view.xml @@ -2,31 +2,39 @@ + + 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)]} +