From f156c276df880521c2a89142872128ed797d62e6 Mon Sep 17 00:00:00 2001 From: Carlos Dauden Date: Wed, 8 Mar 2017 18:20:02 +0100 Subject: [PATCH 01/78] [9.0][ADD] product_pricelist_direct_print (#223) --- product_pricelist_direct_print/README.rst | 87 +++++++++ product_pricelist_direct_print/__init__.py | 3 + product_pricelist_direct_print/__openerp__.py | 22 +++ product_pricelist_direct_print/i18n/es.po | 179 ++++++++++++++++++ product_pricelist_direct_print/i18n/fr.po | 179 ++++++++++++++++++ .../static/description/icon.png | Bin 0 -> 9455 bytes .../tests/__init__.py | 3 + .../test_product_pricelist_direct_print.py | 64 +++++++ .../views/report_product_pricelist.xml | 107 +++++++++++ .../wizards/__init__.py | 3 + .../wizards/product_pricelist_print.py | 64 +++++++ .../wizards/product_pricelist_print_view.xml | 88 +++++++++ 12 files changed, 799 insertions(+) create mode 100644 product_pricelist_direct_print/README.rst create mode 100644 product_pricelist_direct_print/__init__.py create mode 100644 product_pricelist_direct_print/__openerp__.py create mode 100644 product_pricelist_direct_print/i18n/es.po create mode 100644 product_pricelist_direct_print/i18n/fr.po create mode 100644 product_pricelist_direct_print/static/description/icon.png create mode 100644 product_pricelist_direct_print/tests/__init__.py create mode 100644 product_pricelist_direct_print/tests/test_product_pricelist_direct_print.py create mode 100644 product_pricelist_direct_print/views/report_product_pricelist.xml create mode 100644 product_pricelist_direct_print/wizards/__init__.py create mode 100644 product_pricelist_direct_print/wizards/product_pricelist_print.py create mode 100644 product_pricelist_direct_print/wizards/product_pricelist_print_view.xml diff --git a/product_pricelist_direct_print/README.rst b/product_pricelist_direct_print/README.rst new file mode 100644 index 000000000000..6d2c44be4151 --- /dev/null +++ b/product_pricelist_direct_print/README.rst @@ -0,0 +1,87 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +============================== +Product Pricelist Direct Print +============================== + +Print price list from menu option, product templates, products variants or +price lists + +Configuration +============= + +To configure this module, you need to: + +* Go to **Apps** and install **Sales Management** +* Go to **Sales > Configuration > Settings** +* Scroll to **Quotations & Sales > Sale Price** +* Set **Different prices per customer segment** or + **Advanced pricing based on formula** + +Usage +===== + +To use this module, you have several options: + +#. Go to **Sales > Sales > Print Price List** + +#. Go to **Sales > Sales > Products** + * Select products in list view + * Press **Print > Price List** + +#. Go to **Sales > Sales > Product Variants** + * Select products in list view + * Press **Print > Price List** + +#. Go to **Sales > Configuration > Pricelists > Pricelists** + * Select one Pricelist + * Press **Print > Price List** + +#. Go to **Sales > Sales > Customers** + * Select one customer + * Press **Print > Price List** + + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/135/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 +------------ + +* 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/product_pricelist_direct_print/__init__.py b/product_pricelist_direct_print/__init__.py new file mode 100644 index 000000000000..9e69410edad1 --- /dev/null +++ b/product_pricelist_direct_print/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import wizards diff --git a/product_pricelist_direct_print/__openerp__.py b/product_pricelist_direct_print/__openerp__.py new file mode 100644 index 000000000000..0052fba3a3fc --- /dev/null +++ b/product_pricelist_direct_print/__openerp__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Product Pricelist Direct Print", + "summary": "Print price list from menu option, product templates, " + "products variants or price lists", + "version": "9.0.1.0.0", + "category": "Product", + "website": "http://www.tecnativa.com", + "author": "Tecnativa, " + "Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": [ + "product", + ], + "data": [ + "views/report_product_pricelist.xml", + "wizards/product_pricelist_print_view.xml", + ], +} diff --git a/product_pricelist_direct_print/i18n/es.po b/product_pricelist_direct_print/i18n/es.po new file mode 100644 index 000000000000..b7f5a3de279c --- /dev/null +++ b/product_pricelist_direct_print/i18n/es.po @@ -0,0 +1,179 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_pricelist_direct_print +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-09 03:40+0000\n" +"PO-Revision-Date: 2017-03-09 03:40+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Cost Price" +msgstr "Precio coste" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Currency:
" +msgstr "Moneda:
" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Description" +msgstr "Descripción" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "List Price" +msgstr "Precio tarifa" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Price List Name:
" +msgstr "Nombre tarifa:
" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Print date:
" +msgstr "Fecha impresión:
" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Sale Price" +msgstr "Precio ficha" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Cancel" +msgstr "Cancelar" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_categ_ids +msgid "Categories" +msgstr "Categorías" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_create_date +msgid "Created on" +msgstr "Creado en" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_partner_id +msgid "Customer" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Filter Options" +msgstr "Opciones de filtrado" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_id +msgid "ID" +msgstr "ID (identificación)" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,help:product_pricelist_direct_print.field_product_pricelist_print_product_ids +#: model:ir.model.fields,help:product_pricelist_direct_print.field_product_pricelist_print_product_tmpl_ids +msgid "Keep empty for all products" +msgstr "Dejar vacío para mostrar todos los productos" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print___last_update +msgid "Last Modified on" +msgstr "Última modificación en" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_write_uid +msgid "Last Updated by" +msgstr "Última actualización de" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_write_date +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: product_pricelist_direct_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_partner_pricelist_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_pricelist_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_product_pricelist_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_template_pricelist_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Price List" +msgstr "Tarifa" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_pricelist_id +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Pricelist" +msgstr "Tarifa" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Print" +msgstr "Imprimir" + +#. module: product_pricelist_direct_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_pricelist_print +#: model:ir.ui.menu,name:product_pricelist_direct_print.menu_product_pricelist_print +msgid "Print Price List" +msgstr "Imprimir tarifa" + +#. module: product_pricelist_direct_print +#: model:ir.actions.report.xml,name:product_pricelist_direct_print.action_report_product_pricelist +msgid "Product Price List" +msgstr "Tarifa de productos" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_product_ids +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_product_tmpl_ids +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Products" +msgstr "Productos" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_show_standard_price +msgid "Show Cost Price" +msgstr "Mostrar precio de coste" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_show_sale_price +msgid "Show Sale Price" +msgstr "Mostrar precio ficha" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_show_variants +msgid "Show variants" +msgstr "Mostrar variantes" + +#. module: product_pricelist_direct_print +#: code:addons/product_pricelist_direct_print/wizards/product_pricelist_print.py:61 +#, python-format +msgid "You must set price list or any show price option." +msgstr "Debe seleccionar una tarifa o alguna opción mostrar precio." + +#. module: product_pricelist_direct_print +#: model:ir.model,name:product_pricelist_direct_print.model_product_pricelist_print +msgid "product.pricelist.print" +msgstr "" diff --git a/product_pricelist_direct_print/i18n/fr.po b/product_pricelist_direct_print/i18n/fr.po new file mode 100644 index 000000000000..d8f98f221a81 --- /dev/null +++ b/product_pricelist_direct_print/i18n/fr.po @@ -0,0 +1,179 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_pricelist_direct_print +# +# Translators: +# leemannd , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-09 03:40+0000\n" +"PO-Revision-Date: 2017-03-09 03:40+0000\n" +"Last-Translator: leemannd , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Cost Price" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Currency:
" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Description" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "List Price" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Price List Name:
" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Print date:
" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Sale Price" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Cancel" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_categ_ids +msgid "Categories" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_create_date +msgid "Created on" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_partner_id +msgid "Customer" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_display_name +msgid "Display Name" +msgstr "Nom d'affichage" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Filter Options" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_id +msgid "ID" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,help:product_pricelist_direct_print.field_product_pricelist_print_product_ids +#: model:ir.model.fields,help:product_pricelist_direct_print.field_product_pricelist_print_product_tmpl_ids +msgid "Keep empty for all products" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print___last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_write_uid +msgid "Last Updated by" +msgstr "Dernière modification par" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_partner_pricelist_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_pricelist_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_product_pricelist_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_template_pricelist_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Price List" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_pricelist_id +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Pricelist" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Print" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_pricelist_print +#: model:ir.ui.menu,name:product_pricelist_direct_print.menu_product_pricelist_print +msgid "Print Price List" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.actions.report.xml,name:product_pricelist_direct_print.action_report_product_pricelist +msgid "Product Price List" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_product_ids +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_product_tmpl_ids +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Products" +msgstr "Produits" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_show_standard_price +msgid "Show Cost Price" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_show_sale_price +msgid "Show Sale Price" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_show_variants +msgid "Show variants" +msgstr "" + +#. module: product_pricelist_direct_print +#: code:addons/product_pricelist_direct_print/wizards/product_pricelist_print.py:61 +#, python-format +msgid "You must set price list or any show price option." +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model,name:product_pricelist_direct_print.model_product_pricelist_print +msgid "product.pricelist.print" +msgstr "" diff --git a/product_pricelist_direct_print/static/description/icon.png b/product_pricelist_direct_print/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHs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fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/product_pricelist_direct_print/tests/__init__.py b/product_pricelist_direct_print/tests/__init__.py new file mode 100644 index 000000000000..681c4b08dcb2 --- /dev/null +++ b/product_pricelist_direct_print/tests/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import test_product_pricelist_direct_print diff --git a/product_pricelist_direct_print/tests/test_product_pricelist_direct_print.py b/product_pricelist_direct_print/tests/test_product_pricelist_direct_print.py new file mode 100644 index 000000000000..bc3f2e660c5f --- /dev/null +++ b/product_pricelist_direct_print/tests/test_product_pricelist_direct_print.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp.tests.common import SavepointCase +from openerp.exceptions import ValidationError + + +class TestProductPricelistDirectPrint(SavepointCase): + + @classmethod + def setUpClass(cls): + super(TestProductPricelistDirectPrint, cls).setUpClass() + cls.pricelist = cls.env.ref('product.list0') + cls.category = cls.env['product.category'].create({ + 'name': 'Test category', + 'type': 'normal', + }) + cls.product = cls.env['product.product'].create({ + 'name': 'Product for test', + 'categ_id': cls.category.id, + 'default_code': 'TESTPROD01', + }) + + cls.partner = cls.env['res.partner'].create({ + 'name': 'Partner for test', + 'property_product_pricelist': cls.pricelist.id, + }) + + cls.wiz_obj = cls.env['product.pricelist.print'] + + def test_defaults(self): + wiz = self.wiz_obj.new() + res = wiz.with_context( + active_model='product.pricelist', + active_id=self.pricelist.id, + ).default_get([]) + self.assertEqual(res['pricelist_id'], self.pricelist.id) + res = wiz.with_context( + active_model='res.partner', + active_id=self.partner.id, + ).default_get([]) + self.assertEqual( + res['pricelist_id'], self.partner.property_product_pricelist.id) + res = wiz.with_context( + active_model='product.template', + active_ids=self.product.product_tmpl_id.ids, + ).default_get([]) + self.assertEqual( + res['product_tmpl_ids'][0][2], self.product.product_tmpl_id.ids) + res = wiz.with_context( + active_model='product.product', + active_ids=self.product.ids, + ).default_get([]) + self.assertEqual( + res['product_ids'][0][2], self.product.ids) + self.assertTrue(res['show_variants']) + + with self.assertRaises(ValidationError): + wiz.print_report() + + wiz.show_sale_price = True + res = wiz.print_report() + self.assertIn('report_name', res) diff --git a/product_pricelist_direct_print/views/report_product_pricelist.xml b/product_pricelist_direct_print/views/report_product_pricelist.xml new file mode 100644 index 000000000000..f4c12b1de633 --- /dev/null +++ b/product_pricelist_direct_print/views/report_product_pricelist.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + diff --git a/product_pricelist_direct_print/wizards/__init__.py b/product_pricelist_direct_print/wizards/__init__.py new file mode 100644 index 000000000000..1c3b98a82656 --- /dev/null +++ b/product_pricelist_direct_print/wizards/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import product_pricelist_print diff --git a/product_pricelist_direct_print/wizards/product_pricelist_print.py b/product_pricelist_direct_print/wizards/product_pricelist_print.py new file mode 100644 index 000000000000..3025d42f47ed --- /dev/null +++ b/product_pricelist_direct_print/wizards/product_pricelist_print.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import _, api, fields, models +from openerp.exceptions import ValidationError + + +class ProductPricelistPrint(models.TransientModel): + _name = 'product.pricelist.print' + + pricelist_id = fields.Many2one( + comodel_name='product.pricelist', + string='Pricelist', + ) + partner_id = fields.Many2one( + comodel_name='res.partner', + string='Customer', + ) + categ_ids = fields.Many2many( + comodel_name='product.category', + string='Categories', + ) + show_variants = fields.Boolean() + product_tmpl_ids = fields.Many2many( + comodel_name='product.template', + string='Products', + help='Keep empty for all products', + ) + product_ids = fields.Many2many( + comodel_name='product.product', + string='Products', + help='Keep empty for all products', + ) + show_standard_price = fields.Boolean(string='Show Cost Price') + show_sale_price = fields.Boolean(string='Show Sale Price') + + @api.model + def default_get(self, fields): + res = super(ProductPricelistPrint, self).default_get(fields) + if self.env.context.get('active_model') == 'product.template': + res['product_tmpl_ids'] = [ + (6, 0, self.env.context.get('active_ids', []))] + elif self.env.context.get('active_model') == 'product.product': + res['show_variants'] = True + res['product_ids'] = [ + (6, 0, self.env.context.get('active_ids', []))] + elif self.env.context.get('active_model') == 'product.pricelist': + res['pricelist_id'] = self.env.context.get('active_id', False) + elif self.env.context.get('active_model') == 'res.partner': + res['partner_id'] = self.env.context.get('active_id', False) + partner = self.env['res.partner'].browse( + self.env.context.get('active_id', False)) + res['pricelist_id'] = partner.property_product_pricelist.id + return res + + @api.multi + def print_report(self): + if not(self.pricelist_id or self.show_standard_price or + self.show_sale_price): + raise ValidationError(_( + 'You must set price list or any show price option.')) + return self.env['report'].get_action( + self, 'product_pricelist_direct_print.report_product_pricelist') diff --git a/product_pricelist_direct_print/wizards/product_pricelist_print_view.xml b/product_pricelist_direct_print/wizards/product_pricelist_print_view.xml new file mode 100644 index 000000000000..64fd0a09e5f9 --- /dev/null +++ b/product_pricelist_direct_print/wizards/product_pricelist_print_view.xml @@ -0,0 +1,88 @@ + + + + + + Product pricelist print + product.pricelist.print + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + +
From 58ab46c517955ed2ab671852a8e0d64be78aa1df Mon Sep 17 00:00:00 2001 From: Carlos Dauden Date: Fri, 23 Feb 2018 16:22:21 +0100 Subject: [PATCH 02/78] [IMP] product_pricelist_direct_print: Add order option + change widget for pricelist (#290) --- product_pricelist_direct_print/__openerp__.py | 2 +- product_pricelist_direct_print/i18n/es.po | 32 ++- product_pricelist_direct_print/i18n/fr.po | 21 +- .../i18n/product_pricelist_direct_print.pot | 190 ++++++++++++++++++ .../views/report_product_pricelist.xml | 8 + .../wizards/product_pricelist_print.py | 4 + .../wizards/product_pricelist_print_view.xml | 3 +- 7 files changed, 247 insertions(+), 13 deletions(-) create mode 100644 product_pricelist_direct_print/i18n/product_pricelist_direct_print.pot diff --git a/product_pricelist_direct_print/__openerp__.py b/product_pricelist_direct_print/__openerp__.py index 0052fba3a3fc..b023cc36df72 100644 --- a/product_pricelist_direct_print/__openerp__.py +++ b/product_pricelist_direct_print/__openerp__.py @@ -6,7 +6,7 @@ "name": "Product Pricelist Direct Print", "summary": "Print price list from menu option, product templates, " "products variants or price lists", - "version": "9.0.1.0.0", + "version": "9.0.1.1.0", "category": "Product", "website": "http://www.tecnativa.com", "author": "Tecnativa, " diff --git a/product_pricelist_direct_print/i18n/es.po b/product_pricelist_direct_print/i18n/es.po index b7f5a3de279c..2a28164d55bd 100644 --- a/product_pricelist_direct_print/i18n/es.po +++ b/product_pricelist_direct_print/i18n/es.po @@ -1,22 +1,23 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_pricelist_direct_print -# +# # Translators: # OCA Transbot , 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-09 03:40+0000\n" -"PO-Revision-Date: 2017-03-09 03:40+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-02-19 18:53+0100\n" +"PO-Revision-Date: 2018-02-19 19:00+0100\n" +"Last-Translator: Carlos Dauden \n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: es\n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.7.1\n" #. module: product_pricelist_direct_print #: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document @@ -76,7 +77,7 @@ msgstr "Creado en" #. module: product_pricelist_direct_print #: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_partner_id msgid "Customer" -msgstr "" +msgstr "Cliente" #. module: product_pricelist_direct_print #: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_display_name @@ -93,6 +94,11 @@ msgstr "Opciones de filtrado" msgid "ID" msgstr "ID (identificación)" +#. module: product_pricelist_direct_print +#: selection:product.pricelist.print,order_field:0 +msgid "Internal Reference" +msgstr "Referencia interna" + #. module: product_pricelist_direct_print #: model:ir.model.fields,help:product_pricelist_direct_print.field_product_pricelist_print_product_ids #: model:ir.model.fields,help:product_pricelist_direct_print.field_product_pricelist_print_product_tmpl_ids @@ -114,6 +120,16 @@ msgstr "Última actualización de" msgid "Last Updated on" msgstr "Última actualización en" +#. module: product_pricelist_direct_print +#: selection:product.pricelist.print,order_field:0 +msgid "Name" +msgstr "Nombre" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_order_field +msgid "Order" +msgstr "Orden" + #. module: product_pricelist_direct_print #: model:ir.actions.act_window,name:product_pricelist_direct_print.action_partner_pricelist_print #: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_pricelist_print @@ -168,7 +184,7 @@ msgid "Show variants" msgstr "Mostrar variantes" #. module: product_pricelist_direct_print -#: code:addons/product_pricelist_direct_print/wizards/product_pricelist_print.py:61 +#: code:addons/product_pricelist_direct_print/wizards/product_pricelist_print.py:65 #, python-format msgid "You must set price list or any show price option." msgstr "Debe seleccionar una tarifa o alguna opción mostrar precio." diff --git a/product_pricelist_direct_print/i18n/fr.po b/product_pricelist_direct_print/i18n/fr.po index d8f98f221a81..580f003782ce 100644 --- a/product_pricelist_direct_print/i18n/fr.po +++ b/product_pricelist_direct_print/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_pricelist_direct_print -# +# # Translators: # leemannd , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-03-09 03:40+0000\n" "Last-Translator: leemannd , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: product_pricelist_direct_print @@ -93,6 +93,11 @@ msgstr "" msgid "ID" msgstr "" +#. module: product_pricelist_direct_print +#: selection:product.pricelist.print,order_field:0 +msgid "Internal Reference" +msgstr "" + #. module: product_pricelist_direct_print #: model:ir.model.fields,help:product_pricelist_direct_print.field_product_pricelist_print_product_ids #: model:ir.model.fields,help:product_pricelist_direct_print.field_product_pricelist_print_product_tmpl_ids @@ -114,6 +119,16 @@ msgstr "Dernière modification par" msgid "Last Updated on" msgstr "" +#. module: product_pricelist_direct_print +#: selection:product.pricelist.print,order_field:0 +msgid "Name" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_order_field +msgid "Order" +msgstr "" + #. module: product_pricelist_direct_print #: model:ir.actions.act_window,name:product_pricelist_direct_print.action_partner_pricelist_print #: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_pricelist_print @@ -168,7 +183,7 @@ msgid "Show variants" msgstr "" #. module: product_pricelist_direct_print -#: code:addons/product_pricelist_direct_print/wizards/product_pricelist_print.py:61 +#: code:addons/product_pricelist_direct_print/wizards/product_pricelist_print.py:65 #, python-format msgid "You must set price list or any show price option." msgstr "" diff --git a/product_pricelist_direct_print/i18n/product_pricelist_direct_print.pot b/product_pricelist_direct_print/i18n/product_pricelist_direct_print.pot new file mode 100644 index 000000000000..d3f4a7f3351f --- /dev/null +++ b/product_pricelist_direct_print/i18n/product_pricelist_direct_print.pot @@ -0,0 +1,190 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_pricelist_direct_print +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \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: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Cost Price" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Currency:
" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Description" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "List Price" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Price List Name:
" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Print date:
" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Sale Price" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Cancel" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_categ_ids +msgid "Categories" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_create_uid +msgid "Created by" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_create_date +msgid "Created on" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_partner_id +msgid "Customer" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_display_name +msgid "Display Name" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Filter Options" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_id +msgid "ID" +msgstr "" + +#. module: product_pricelist_direct_print +#: selection:product.pricelist.print,order_field:0 +msgid "Internal Reference" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,help:product_pricelist_direct_print.field_product_pricelist_print_product_ids +#: model:ir.model.fields,help:product_pricelist_direct_print.field_product_pricelist_print_product_tmpl_ids +msgid "Keep empty for all products" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print___last_update +msgid "Last Modified on" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_pricelist_direct_print +#: selection:product.pricelist.print,order_field:0 +msgid "Name" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_order_field +msgid "Order" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_partner_pricelist_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_pricelist_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_product_pricelist_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_product_template_pricelist_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.report_product_pricelist_document +msgid "Price List" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_pricelist_id +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Pricelist" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Print" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.actions.act_window,name:product_pricelist_direct_print.action_pricelist_print +#: model:ir.ui.menu,name:product_pricelist_direct_print.menu_product_pricelist_print +msgid "Print Price List" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.actions.report.xml,name:product_pricelist_direct_print.action_report_product_pricelist +msgid "Product Price List" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_product_ids +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_product_tmpl_ids +#: model:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print +msgid "Products" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_show_standard_price +msgid "Show Cost Price" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_show_sale_price +msgid "Show Sale Price" +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print_show_variants +msgid "Show variants" +msgstr "" + +#. module: product_pricelist_direct_print +#: code:addons/product_pricelist_direct_print/wizards/product_pricelist_print.py:65 +#, python-format +msgid "You must set price list or any show price option." +msgstr "" + +#. module: product_pricelist_direct_print +#: model:ir.model,name:product_pricelist_direct_print.model_product_pricelist_print +msgid "product.pricelist.print" +msgstr "" + diff --git a/product_pricelist_direct_print/views/report_product_pricelist.xml b/product_pricelist_direct_print/views/report_product_pricelist.xml index f4c12b1de633..d0054479d5a8 100644 --- a/product_pricelist_direct_print/views/report_product_pricelist.xml +++ b/product_pricelist_direct_print/views/report_product_pricelist.xml @@ -58,6 +58,14 @@ + + + + + + diff --git a/product_pricelist_direct_print/wizards/product_pricelist_print.py b/product_pricelist_direct_print/wizards/product_pricelist_print.py index 3025d42f47ed..d42af1705535 100644 --- a/product_pricelist_direct_print/wizards/product_pricelist_print.py +++ b/product_pricelist_direct_print/wizards/product_pricelist_print.py @@ -34,6 +34,10 @@ class ProductPricelistPrint(models.TransientModel): ) show_standard_price = fields.Boolean(string='Show Cost Price') show_sale_price = fields.Boolean(string='Show Sale Price') + order_field = fields.Selection([ + ('name', 'Name'), + ('default_code', 'Internal Reference'), + ], string='Order') @api.model def default_get(self, fields): diff --git a/product_pricelist_direct_print/wizards/product_pricelist_print_view.xml b/product_pricelist_direct_print/wizards/product_pricelist_print_view.xml index 64fd0a09e5f9..a1614270d1f1 100644 --- a/product_pricelist_direct_print/wizards/product_pricelist_print_view.xml +++ b/product_pricelist_direct_print/wizards/product_pricelist_print_view.xml @@ -9,11 +9,12 @@
- + + From 4c29156760a0dd6e586248bcbc0f47b46223bc5f Mon Sep 17 00:00:00 2001 From: David Date: Wed, 18 Jul 2018 09:44:00 +0200 Subject: [PATCH 03/78] [MIG] product_pricelist_direct_print: Migration to 11.0 --- product_pricelist_direct_print/README.rst | 104 ++-- product_pricelist_direct_print/__init__.py | 3 +- .../{__openerp__.py => __manifest__.py} | 10 +- .../data/mail_template_data.xml | 31 ++ .../data/pricelist_send_action.xml | 15 + .../models/__init__.py | 1 + .../models/res_partner.py | 16 + .../readme/CONFIGURE.rst | 7 + .../readme/CONTRIBUTORS.rst | 4 + .../readme/DESCRIPTION.rst | 2 + .../readme/USAGE.rst | 15 + .../static/description/index.html | 471 ++++++++++++++++++ .../test_product_pricelist_direct_print.py | 15 +- .../views/report_product_pricelist.xml | 6 +- .../wizards/__init__.py | 2 - .../wizards/product_pricelist_print.py | 59 ++- .../wizards/product_pricelist_print_view.xml | 24 +- 17 files changed, 708 insertions(+), 77 deletions(-) rename product_pricelist_direct_print/{__openerp__.py => __manifest__.py} (75%) create mode 100644 product_pricelist_direct_print/data/mail_template_data.xml create mode 100644 product_pricelist_direct_print/data/pricelist_send_action.xml create mode 100644 product_pricelist_direct_print/models/__init__.py create mode 100644 product_pricelist_direct_print/models/res_partner.py create mode 100644 product_pricelist_direct_print/readme/CONFIGURE.rst create mode 100644 product_pricelist_direct_print/readme/CONTRIBUTORS.rst create mode 100644 product_pricelist_direct_print/readme/DESCRIPTION.rst create mode 100644 product_pricelist_direct_print/readme/USAGE.rst create mode 100644 product_pricelist_direct_print/static/description/index.html diff --git a/product_pricelist_direct_print/README.rst b/product_pricelist_direct_print/README.rst index 6d2c44be4151..1869aed13fa9 100644 --- a/product_pricelist_direct_print/README.rst +++ b/product_pricelist_direct_print/README.rst @@ -1,87 +1,107 @@ -.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg - :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html - :alt: License: LGPL-3 - ============================== Product Pricelist Direct Print ============================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/11.0/product_pricelist_direct_print + :alt: OCA/product-attribute +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-attribute-11-0/product-attribute-11-0-product_pricelist_direct_print + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/135/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + Print price list from menu option, product templates, products variants or price lists +**Table of contents** + +.. contents:: + :local: + Configuration ============= To configure this module, you need to: -* Go to **Apps** and install **Sales Management** -* Go to **Sales > Configuration > Settings** -* Scroll to **Quotations & Sales > Sale Price** -* Set **Different prices per customer segment** or - **Advanced pricing based on formula** +#. Go to *Apps* and install *Sales Management* +#. Go to *Sales > Configuration > Settings* +#. Scroll to *Pricing* +#. Set *Multiple Sales Prices per Product* on an either + *Multiple prices per product* or *Prices computed from formulas* Usage ===== To use this module, you have several options: -#. Go to **Sales > Sales > Print Price List** +#. Go to *Sales > Catalog > Print Price List* -#. Go to **Sales > Sales > Products** +#. Go to *Sales > Catalog > Products* * Select products in list view - * Press **Print > Price List** + * Press *Print > Price List* -#. Go to **Sales > Sales > Product Variants** +#. Go to *Sales > Catalog > Product Variants* * Select products in list view - * Press **Print > Price List** + * Press *Print > Price List* -#. Go to **Sales > Configuration > Pricelists > Pricelists** - * Select one Pricelist - * Press **Print > Price List** - -#. Go to **Sales > Sales > Customers** - * Select one customer - * Press **Print > Price List** - - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/135/9.0 +#. Go to *Sales > Orders > Customers** + * Select a customer + * Press *Print > Price List* 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. +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 `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- - -* Odoo Community Association: `Icon `_. +Authors +~~~~~~~ +* Tecnativa Contributors ------------- +~~~~~~~~~~~~ + +* `Tecnativa `_: -* Carlos Dauden + * Carlos Dauden + * David Vidal -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. 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. +This module is part of the `OCA/product-attribute `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_pricelist_direct_print/__init__.py b/product_pricelist_direct_print/__init__.py index 9e69410edad1..aee8895e7a31 100644 --- a/product_pricelist_direct_print/__init__.py +++ b/product_pricelist_direct_print/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- - +from . import models from . import wizards diff --git a/product_pricelist_direct_print/__openerp__.py b/product_pricelist_direct_print/__manifest__.py similarity index 75% rename from product_pricelist_direct_print/__openerp__.py rename to product_pricelist_direct_print/__manifest__.py index b023cc36df72..428f906c032a 100644 --- a/product_pricelist_direct_print/__openerp__.py +++ b/product_pricelist_direct_print/__manifest__.py @@ -1,22 +1,22 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Carlos Dauden # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - { "name": "Product Pricelist Direct Print", "summary": "Print price list from menu option, product templates, " "products variants or price lists", - "version": "9.0.1.1.0", + "version": "11.0.1.0.0", "category": "Product", - "website": "http://www.tecnativa.com", + "website": "https://www.github.com/OCA/product-attribute", "author": "Tecnativa, " "Odoo Community Association (OCA)", "license": "AGPL-3", "depends": [ - "product", + "sale", ], "data": [ + "data/pricelist_send_action.xml", "views/report_product_pricelist.xml", "wizards/product_pricelist_print_view.xml", + "data/mail_template_data.xml", ], } diff --git a/product_pricelist_direct_print/data/mail_template_data.xml b/product_pricelist_direct_print/data/mail_template_data.xml new file mode 100644 index 000000000000..f458d209e5d2 --- /dev/null +++ b/product_pricelist_direct_print/data/mail_template_data.xml @@ -0,0 +1,31 @@ + + + + + Pricelist - Send by Email + ${(object.write_uid.email and '"%s" <%s>' % (object.write_uid.name, object.write_uid.email) or '')|safe} + ${object.pricelist_id.company_id.name or object.write_uid.company_id.name} Pricelist (Ref ${object.pricelist_id.name or 'n/a' }) + ${object.partner_id and object.partner_id.id or ''} + + + + ${object.pricelist_id.name} + ${object.partner_id and object.partner_id.lang or object.write_uid.partner_id.lang} + Dear ${object.partner_id and object.partner_id.name or 'customer'},

+

+The attached file is a PDF document containg the +${object.pricelist_id.name} pricelist. +

+

You can reply to this email if you have any questions.

+

Thank you,

+ +

+% if object.write_uid and object.write_uid.signature: + ${object.write_uid.signature | safe} +% endif +

+]]>
+
+ +
diff --git a/product_pricelist_direct_print/data/pricelist_send_action.xml b/product_pricelist_direct_print/data/pricelist_send_action.xml new file mode 100644 index 000000000000..eb6ead84c08c --- /dev/null +++ b/product_pricelist_direct_print/data/pricelist_send_action.xml @@ -0,0 +1,15 @@ + + + + + Send customer pricelist by EMail + ir.actions.server + + code + + if records: + action = records.action_customer_pricelist_email_send() + + + + diff --git a/product_pricelist_direct_print/models/__init__.py b/product_pricelist_direct_print/models/__init__.py new file mode 100644 index 000000000000..91fed54d404e --- /dev/null +++ b/product_pricelist_direct_print/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/product_pricelist_direct_print/models/res_partner.py b/product_pricelist_direct_print/models/res_partner.py new file mode 100644 index 000000000000..5827b5d9a1ab --- /dev/null +++ b/product_pricelist_direct_print/models/res_partner.py @@ -0,0 +1,16 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, models + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + @api.multi + def action_customer_pricelist_email_send(self): + wiz = self.env['product.pricelist.print'] + for partner in self.filtered(lambda x: not x.parent_id): + wiz.create({ + 'partner_id': partner.id, + 'pricelist_id': partner.property_product_pricelist.id, + }).force_pricelist_send() diff --git a/product_pricelist_direct_print/readme/CONFIGURE.rst b/product_pricelist_direct_print/readme/CONFIGURE.rst new file mode 100644 index 000000000000..4ea78d11a046 --- /dev/null +++ b/product_pricelist_direct_print/readme/CONFIGURE.rst @@ -0,0 +1,7 @@ +To configure this module, you need to: + +#. Go to *Apps* and install *Sales Management* +#. Go to *Sales > Configuration > Settings* +#. Scroll to *Pricing* +#. Set *Multiple Sales Prices per Product* on an either + *Multiple prices per product* or *Prices computed from formulas* diff --git a/product_pricelist_direct_print/readme/CONTRIBUTORS.rst b/product_pricelist_direct_print/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..4ca7694cc75c --- /dev/null +++ b/product_pricelist_direct_print/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Tecnativa `_: + + * Carlos Dauden + * David Vidal diff --git a/product_pricelist_direct_print/readme/DESCRIPTION.rst b/product_pricelist_direct_print/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..48e18bfe13ac --- /dev/null +++ b/product_pricelist_direct_print/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +Print price list from menu option, product templates, products variants or +price lists diff --git a/product_pricelist_direct_print/readme/USAGE.rst b/product_pricelist_direct_print/readme/USAGE.rst new file mode 100644 index 000000000000..dfad26fec6d9 --- /dev/null +++ b/product_pricelist_direct_print/readme/USAGE.rst @@ -0,0 +1,15 @@ +To use this module, you have several options: + +#. Go to *Sales > Catalog > Print Price List* + +#. Go to *Sales > Catalog > Products* + * Select products in list view + * Press *Print > Price List* + +#. Go to *Sales > Catalog > Product Variants* + * Select products in list view + * Press *Print > Price List* + +#. Go to *Sales > Orders > Customers** + * Select a customer + * Press *Print > Price List* diff --git a/product_pricelist_direct_print/static/description/index.html b/product_pricelist_direct_print/static/description/index.html new file mode 100644 index 000000000000..43b2df7921ae --- /dev/null +++ b/product_pricelist_direct_print/static/description/index.html @@ -0,0 +1,471 @@ + + + + + + +Product Pricelist Direct Print + + + +
+

Product Pricelist Direct Print

+ + +

Beta License: AGPL-3 OCA/product-attribute Translate me on Weblate Try me on Runbot

+

Print price list from menu option, product templates, products variants or +price lists

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  1. Go to Apps and install Sales Management
  2. +
  3. Go to Sales > Configuration > Settings
  4. +
  5. Scroll to Pricing
  6. +
  7. Set Multiple Sales Prices per Product on an either +Multiple prices per product or Prices computed from formulas
  8. +
+
+
+

Usage

+

To use this module, you have several options:

+
    +
  1. Go to Sales > Catalog > Print Price List
  2. +
  3. +
    Go to Sales > Catalog > Products
    +
      +
    • Select products in list view
    • +
    • Press Print > Price List
    • +
    +
    +
    +
  4. +
  5. +
    Go to Sales > Catalog > Product Variants
    +
      +
    • Select products in list view
    • +
    • Press Print > Price List
    • +
    +
    +
    +
  6. +
  7. +
    Go to Sales > Orders > Customers*
    +
      +
    • Select a customer
    • +
    • Press Print > Price List
    • +
    +
    +
    +
  8. +
+
+
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/product-attribute project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/product_pricelist_direct_print/tests/test_product_pricelist_direct_print.py b/product_pricelist_direct_print/tests/test_product_pricelist_direct_print.py index bc3f2e660c5f..90d0797d0acb 100644 --- a/product_pricelist_direct_print/tests/test_product_pricelist_direct_print.py +++ b/product_pricelist_direct_print/tests/test_product_pricelist_direct_print.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Carlos Dauden # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.tests.common import SavepointCase -from openerp.exceptions import ValidationError +from odoo.tests.common import SavepointCase +from odoo.exceptions import ValidationError class TestProductPricelistDirectPrint(SavepointCase): @@ -21,12 +20,11 @@ def setUpClass(cls): 'categ_id': cls.category.id, 'default_code': 'TESTPROD01', }) - cls.partner = cls.env['res.partner'].create({ 'name': 'Partner for test', 'property_product_pricelist': cls.pricelist.id, + 'email': 'test@test.com', }) - cls.wiz_obj = cls.env['product.pricelist.print'] def test_defaults(self): @@ -55,10 +53,13 @@ def test_defaults(self): self.assertEqual( res['product_ids'][0][2], self.product.ids) self.assertTrue(res['show_variants']) - with self.assertRaises(ValidationError): wiz.print_report() - wiz.show_sale_price = True res = wiz.print_report() self.assertIn('report_name', res) + + def test_partner_pricelist_batch_mailing(self): + partner = self.partner.copy({'email': 'other@test.com'}) + partner |= self.partner + partner.action_customer_pricelist_email_send() diff --git a/product_pricelist_direct_print/views/report_product_pricelist.xml b/product_pricelist_direct_print/views/report_product_pricelist.xml index d0054479d5a8..628b7205f695 100644 --- a/product_pricelist_direct_print/views/report_product_pricelist.xml +++ b/product_pricelist_direct_print/views/report_product_pricelist.xml @@ -4,8 +4,8 @@