diff --git a/product_supplierinfo_expand_view/README.rst b/product_supplierinfo_expand_view/README.rst new file mode 100644 index 0000000..da7508f --- /dev/null +++ b/product_supplierinfo_expand_view/README.rst @@ -0,0 +1,16 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 +================================ +Product supplierinfo expand view +================================ +This module expands product_supplierinfo view to show partner reference and +also product data on product procurements tab tree view. + +Credits +======= + +Contributors +------------ +* Daniel Campos +* Pedro M. Baeza +* Ana Juaristi diff --git a/product_supplierinfo_expand_view/__init__.py b/product_supplierinfo_expand_view/__init__.py new file mode 100644 index 0000000..323bfc0 --- /dev/null +++ b/product_supplierinfo_expand_view/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Daniel Campos - Avanzosc S.L. +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import models diff --git a/product_supplierinfo_expand_view/__openerp__.py b/product_supplierinfo_expand_view/__openerp__.py new file mode 100644 index 0000000..39c2dc8 --- /dev/null +++ b/product_supplierinfo_expand_view/__openerp__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Daniel Campos - Avanzosc S.L. +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +{ + "name": "Product Supplierinfo expand view", + "version": "1.0", + 'author': 'OdooMRP team', + 'website': "http://www.odoomrp.com", + 'contributors': ["Daniel Campos ", + "Pedro M. Baeza ", + "Ana Juaristi "], + "depends": ['product'], + "category": "Tools", + "data": ['views/product_supplierinfo_view.xml' + ], + "installable": True +} diff --git a/product_supplierinfo_expand_view/models/__init__.py b/product_supplierinfo_expand_view/models/__init__.py new file mode 100644 index 0000000..dcde398 --- /dev/null +++ b/product_supplierinfo_expand_view/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Daniel Campos - Avanzosc S.L. +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import product_supplierinfo diff --git a/product_supplierinfo_expand_view/models/product_supplierinfo.py b/product_supplierinfo_expand_view/models/product_supplierinfo.py new file mode 100644 index 0000000..1e3a529 --- /dev/null +++ b/product_supplierinfo_expand_view/models/product_supplierinfo.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Daniel Campos - Avanzosc S.L. +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from openerp import models, fields, api + + +class ProductSupplierinfo(models.Model): + _inherit = 'product.supplierinfo' + + partner_code = fields.Char(related='name.ref') + +# +# @api.multi +# @api.onchange('name') +# def _supplier_code(self): +# res = {} +# if self.product_tmpl_id: +# res = {'default_code': self.name.ref} +# self.product_tmpl_id.default_code = self.name.ref +# return res +# +# @api.multi +# @api.onchange('type') +# def onchange_type(self): +# if self.type == 'supplier': +# return {'domain': {'name': [('supplier', '=', True)]}} +# elif self.type == 'customer': +# return {'domain': {'name': [('customer', '=', True)]}} +# return {'domain': {'name': []}} +# +# def search(self, cr, uid, args, offset=0, limit=None, order=None, +# context=None, count=False): +# """Add search argument for field type if the context says so. This +# should be in old API because context argument is not the last one. +# """ +# if context is None: +# context = {} +# if not any(arg[0] == 'type' for arg in args): +# args += [('type', '=', +# context.get('supplierinfo_type', 'supplier'))] +# return super(ProductSupplierinfo, self).search( +# cr, uid, args, offset=offset, limit=limit, order=order, +# context=context, count=count) diff --git a/product_supplierinfo_expand_view/views/product_supplierinfo_view.xml b/product_supplierinfo_expand_view/views/product_supplierinfo_view.xml new file mode 100644 index 0000000..1c20992 --- /dev/null +++ b/product_supplierinfo_expand_view/views/product_supplierinfo_view.xml @@ -0,0 +1,27 @@ + + + + + product.supplierinfo.form.view.ext + product.supplierinfo + + + + + + + + + product.supplierinfo.tree.view + product.supplierinfo + + + + + + + + + + +