From 1e18ef22de6652d1548607405779a74c43a6ece2 Mon Sep 17 00:00:00 2001 From: Osval Reyes Date: Thu, 19 Nov 2015 18:55:53 -0430 Subject: [PATCH] [ADD] new module crm_claim_product_supplier --- crm_claim_product_supplier/README.rst | 75 +++++++++++++++++++ crm_claim_product_supplier/__init__.py | 22 ++++++ crm_claim_product_supplier/__openerp__.py | 34 +++++++++ .../i18n/crm_claim_product_supplier.pot | 42 +++++++++++ crm_claim_product_supplier/i18n/es.po | 42 +++++++++++ crm_claim_product_supplier/i18n/es_MX.po | 21 ++++++ crm_claim_product_supplier/i18n/es_PA.po | 16 ++++ crm_claim_product_supplier/i18n/es_VE.po | 21 ++++++ crm_claim_product_supplier/models/__init__.py | 21 ++++++ .../models/claim_line.py | 46 ++++++++++++ 10 files changed, 340 insertions(+) create mode 100644 crm_claim_product_supplier/README.rst create mode 100644 crm_claim_product_supplier/__init__.py create mode 100644 crm_claim_product_supplier/__openerp__.py create mode 100644 crm_claim_product_supplier/i18n/crm_claim_product_supplier.pot create mode 100644 crm_claim_product_supplier/i18n/es.po create mode 100644 crm_claim_product_supplier/i18n/es_MX.po create mode 100644 crm_claim_product_supplier/i18n/es_PA.po create mode 100644 crm_claim_product_supplier/i18n/es_VE.po create mode 100644 crm_claim_product_supplier/models/__init__.py create mode 100644 crm_claim_product_supplier/models/claim_line.py diff --git a/crm_claim_product_supplier/README.rst b/crm_claim_product_supplier/README.rst new file mode 100644 index 00000000..d02af3f1 --- /dev/null +++ b/crm_claim_product_supplier/README.rst @@ -0,0 +1,75 @@ +.. 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 + +========================== +CRM Claim Product Supplier +========================== + +This module adds information in claim lines to keep supplier and supplier +invoice when creating/editing a claim. + +As this module shows, this is not used directly be the end user, it may be used +as complementary for another modules to explode information stored by this one. + +Installation +============ + +To install this module, just select it from available modules + +Configuration +============= + +Aditional configuration is not needed + +Usage +===== + +* End-user direct usage is not possible, all the functionality contained in this + module is done under the hood and no view is included + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/145/8.0 + +For further information, please visit: + +* https://www.odoo.com/forum/help-1 + +Known issues / Roadmap +====================== + +No issues exists yet + +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 +`here `_. + + +Credits +======= + +Contributors +------------ + +* Yanina Aular +* Osval Reyes + +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 http://odoo-community.org. diff --git a/crm_claim_product_supplier/__init__.py b/crm_claim_product_supplier/__init__.py new file mode 100644 index 00000000..8fdccbce --- /dev/null +++ b/crm_claim_product_supplier/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2015 Vauxoo +# Author: Yanina Aular +# +# 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 . +# +############################################################################## + +from . import models diff --git a/crm_claim_product_supplier/__openerp__.py b/crm_claim_product_supplier/__openerp__.py new file mode 100644 index 00000000..a548cbd4 --- /dev/null +++ b/crm_claim_product_supplier/__openerp__.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2015 Vauxoo +# Author: Yanina Aular +# +# 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': 'CRM Claim Product Supplier', + 'version': '8.0.1.0.0', + 'author': 'Vauxoo, Odoo Community Association (OCA)', + 'website': 'http://www.vauxoo.com/', + 'license': 'AGPL-3', + 'category': 'Generic Modules/CRM & SRM', + 'depends': [ + 'crm_rma_lot_mass_return', + ], + 'installable': True, + 'auto_install': False, +} diff --git a/crm_claim_product_supplier/i18n/crm_claim_product_supplier.pot b/crm_claim_product_supplier/i18n/crm_claim_product_supplier.pot new file mode 100644 index 00000000..67981deb --- /dev/null +++ b/crm_claim_product_supplier/i18n/crm_claim_product_supplier.pot @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_product_supplier +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-14 19:24+0000\n" +"PO-Revision-Date: 2015-08-14 19:24+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: crm_claim_product_supplier +#: model:ir.model,name:crm_claim_product_supplier.model_claim_line +msgid "List of product to return" +msgstr "" + +#. module: crm_claim_product_supplier +#: field:claim.line,supplier_id:0 +msgid "Supplier" +msgstr "" + +#. module: crm_claim_product_supplier +#: field:claim.line,supplier_invoice_id:0 +msgid "Supplier Invoice" +msgstr "" + +#. module: crm_claim_product_supplier +#: help:claim.line,supplier_invoice_id:0 +msgid "Supplier invoice with the purchase of goods sold to customer" +msgstr "" + +#. module: crm_claim_product_supplier +#: help:claim.line,supplier_id:0 +msgid "Supplier of good in claim" +msgstr "" + diff --git a/crm_claim_product_supplier/i18n/es.po b/crm_claim_product_supplier/i18n/es.po new file mode 100644 index 00000000..6e4d3fee --- /dev/null +++ b/crm_claim_product_supplier/i18n/es.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_product_supplier +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-17 18:01+0000\n" +"PO-Revision-Date: 2015-07-17 18: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: \n" +"Plural-Forms: \n" + +#. module: crm_claim_product_supplier +#: model:ir.model,name:crm_claim_product_supplier.model_claim_line +msgid "List of product to return" +msgstr "Lista de productos a retornar" + +#. module: crm_claim_product_supplier +#: field:claim.line,supplier_id:0 +msgid "Supplier" +msgstr "Proveedor" + +#. module: crm_claim_product_supplier +#: field:claim.line,supplier_invoice_id:0 +msgid "Supplier Invoice" +msgstr "Factura de proveedor" + +#. module: crm_claim_product_supplier +#: help:claim.line,supplier_invoice_id:0 +msgid "Supplier invoice with the purchase of goods sold to customer" +msgstr "Factura de proveedor con la orden de compra de materiales vendidos al cliente" + +#. module: crm_claim_product_supplier +#: help:claim.line,supplier_id:0 +msgid "Supplier of good in claim" +msgstr "Proveedor de productos en el reclamación" + diff --git a/crm_claim_product_supplier/i18n/es_MX.po b/crm_claim_product_supplier/i18n/es_MX.po new file mode 100644 index 00000000..51c41d0f --- /dev/null +++ b/crm_claim_product_supplier/i18n/es_MX.po @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_product_supplier +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-17 18:01+0000\n" +"PO-Revision-Date: 2015-07-17 18: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: \n" +"Plural-Forms: \n" + +#. module: crm_claim_product_supplier +#: help:claim.line,supplier_id:0 +msgid "Supplier of good in claim" +msgstr "Proveedor de productos en el reclamo" \ No newline at end of file diff --git a/crm_claim_product_supplier/i18n/es_PA.po b/crm_claim_product_supplier/i18n/es_PA.po new file mode 100644 index 00000000..56a95d2e --- /dev/null +++ b/crm_claim_product_supplier/i18n/es_PA.po @@ -0,0 +1,16 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_product_supplier +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-17 18:01+0000\n" +"PO-Revision-Date: 2015-07-17 18: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: \n" +"Plural-Forms: \n" diff --git a/crm_claim_product_supplier/i18n/es_VE.po b/crm_claim_product_supplier/i18n/es_VE.po new file mode 100644 index 00000000..51c41d0f --- /dev/null +++ b/crm_claim_product_supplier/i18n/es_VE.po @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_claim_product_supplier +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-17 18:01+0000\n" +"PO-Revision-Date: 2015-07-17 18: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: \n" +"Plural-Forms: \n" + +#. module: crm_claim_product_supplier +#: help:claim.line,supplier_id:0 +msgid "Supplier of good in claim" +msgstr "Proveedor de productos en el reclamo" \ No newline at end of file diff --git a/crm_claim_product_supplier/models/__init__.py b/crm_claim_product_supplier/models/__init__.py new file mode 100644 index 00000000..7ee9cd84 --- /dev/null +++ b/crm_claim_product_supplier/models/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2015 Vauxoo +# Author: Yanina Aular +# +# 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 . +# +############################################################################## +from . import claim_line diff --git a/crm_claim_product_supplier/models/claim_line.py b/crm_claim_product_supplier/models/claim_line.py new file mode 100644 index 00000000..6f917a79 --- /dev/null +++ b/crm_claim_product_supplier/models/claim_line.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2015 Vauxoo +# Author: Yanina Aular +# +# 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 . +# +############################################################################## +from openerp import api, fields, models + + +class ClaimLine(models.Model): + + _inherit = 'claim.line' + + supplier_id = \ + fields.Many2one('res.partner', string='Supplier', store=True, + compute='_compute_supplier_and_supplier_invoice', + help="Supplier of good in claim") + supplier_invoice_id = \ + fields.Many2one('account.invoice', + string='Supplier Invoice', store=True, + compute='_compute_supplier_and_supplier_invoice', + help="Supplier invoice with the " + "purchase of goods sold to " + "customer") + + @api.depends('prodlot_id') + def _compute_supplier_and_supplier_invoice(self): + for claim_line in self: + if claim_line.prodlot_id: + claim_line.supplier_id = claim_line.prodlot_id.supplier_id.id + claim_line.supplier_invoice_id = claim_line.prodlot_id.\ + supplier_invoice_line_id.invoice_id.id