diff --git a/stock_voucher_purchase/README.rst b/stock_voucher_purchase/README.rst new file mode 100644 index 000000000..55b48dddd --- /dev/null +++ b/stock_voucher_purchase/README.rst @@ -0,0 +1,70 @@ +.. |company| replace:: ADHOC SA + +.. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png + :alt: ADHOC SA + :target: https://www.adhoc.com.ar + +.. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png + +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +====================== +Stock Voucher Purchase +====================== + +#. This module adds stock voucher field on purchase order bill view. + +Installation +============ + +To install this module, you need to: + +#. Only need to install the module + +Configuration +============= + +To configure this module, you need to: + +#. You don't need to configure anything, just install the module. + +Usage +===== + +To use this module, you need to: + +#. Just create a purchase order, confirm, transfer the products and create a voucher. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: http://runbot.adhoc.com.ar/ + +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 +------ + +* |company| |icon| + +Contributors +------------ + +Maintainer +---------- + +|company_logo| + +This module is maintained by the |company|. + +To contribute to this module, please visit https://www.adhoc.com.ar. diff --git a/stock_voucher_purchase/__init__.py b/stock_voucher_purchase/__init__.py new file mode 100644 index 000000000..d03377692 --- /dev/null +++ b/stock_voucher_purchase/__init__.py @@ -0,0 +1,5 @@ +############################################################################## +# For copyright and license notices, see __manifest__.py file in module root +# directory +############################################################################## +from . import models diff --git a/stock_voucher_purchase/__manifest__.py b/stock_voucher_purchase/__manifest__.py new file mode 100644 index 000000000..9c7afc138 --- /dev/null +++ b/stock_voucher_purchase/__manifest__.py @@ -0,0 +1,37 @@ +############################################################################## +# +# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) +# All Rights Reserved. +# +# 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 Affero 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 . +# +############################################################################## +{ + "name": "Stock Voucher - Purchase", + "version": "18.0.1.0.0", + "category": "Warehouse Management", + "summary": "Muestra remitos en la vista de conciliación de facturas de compra", + "author": "ADHOC SA", + "website": "www.adhoc.com.ar", + "license": "AGPL-3", + "images": [], + "depends": ["stock_voucher", "purchase_ux"], + "data": [ + "views/purchase_bill_line_match_views.xml", + ], + "demo": [], + "installable": True, + "auto_install": True, + "application": False, +} diff --git a/stock_voucher_purchase/models/__init__.py b/stock_voucher_purchase/models/__init__.py new file mode 100644 index 000000000..3262ac322 --- /dev/null +++ b/stock_voucher_purchase/models/__init__.py @@ -0,0 +1,5 @@ +############################################################################## +# For copyright and license notices, see __manifest__.py file in module root +# directory +############################################################################## +from . import purchase_bill_line_match diff --git a/stock_voucher_purchase/models/purchase_bill_line_match.py b/stock_voucher_purchase/models/purchase_bill_line_match.py new file mode 100644 index 000000000..78e133ecb --- /dev/null +++ b/stock_voucher_purchase/models/purchase_bill_line_match.py @@ -0,0 +1,24 @@ +############################################################################## +# For copyright and license notices, see __manifest__.py file in module root +# directory +############################################################################## +from odoo import api, fields, models + + +class PurchaseBillLineMatch(models.Model): + _inherit = "purchase.bill.line.match" + + vouchers = fields.Char( + string="Remitos", + compute="_compute_vouchers", + ) + + @api.depends("pol_id.move_ids.picking_id.voucher_ids") + def _compute_vouchers(self): + for rec in self: + if rec.pol_id: + pickings = rec.pol_id.move_ids.mapped("picking_id") + names = pickings.mapped("voucher_ids.display_name") + rec.vouchers = ", ".join(names) if names else False + else: + rec.vouchers = False diff --git a/stock_voucher_purchase/views/purchase_bill_line_match_views.xml b/stock_voucher_purchase/views/purchase_bill_line_match_views.xml new file mode 100644 index 000000000..e4e264c9d --- /dev/null +++ b/stock_voucher_purchase/views/purchase_bill_line_match_views.xml @@ -0,0 +1,13 @@ + + + + purchase.bill.line.match.list.stock_voucher + purchase.bill.line.match + + + + + + + +