-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] product_supplierinfo_expand_view
- Loading branch information
Daniel-CA
committed
Nov 17, 2015
1 parent
a1a147f
commit 793f654
Showing
6 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <danielcampos@avanzosc.es> | ||
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> | ||
* Ana Juaristi <ajuaristio@gmail.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2015 Daniel Campos <danielcampos@avanzosc.es> - Avanzosc S.L. | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <danielcampos@avanzosc.es>", | ||
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>", | ||
"Ana Juaristi <ajuaristio@gmail.com>"], | ||
"depends": ['product'], | ||
"category": "Tools", | ||
"data": ['views/product_supplierinfo_view.xml' | ||
], | ||
"installable": True | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2015 Daniel Campos <danielcampos@avanzosc.es> - Avanzosc S.L. | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from . import product_supplierinfo |
44 changes: 44 additions & 0 deletions
44
product_supplierinfo_expand_view/models/product_supplierinfo.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
27 changes: 27 additions & 0 deletions
27
product_supplierinfo_expand_view/views/product_supplierinfo_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<openerp> | ||
<data> | ||
<record model="ir.ui.view" id="product_supplierinfo_form_view"> | ||
<field name="name">product.supplierinfo.form.view.ext</field> | ||
<field name="model">product.supplierinfo</field> | ||
<field name="inherit_id" ref="product.product_supplierinfo_form_view" /> | ||
<field name="arch" type="xml"> | ||
<field name="name" position="after"> | ||
<field name="partner_code" string="Partner Reference" /> | ||
</field> | ||
</field> | ||
</record> | ||
<record id="product_supplierinfo_tree_view" model="ir.ui.view"> | ||
<field name="name">product.supplierinfo.tree.view</field> | ||
<field name="model">product.supplierinfo</field> | ||
<field name="inherit_id" ref="product.product_supplierinfo_tree_view" /> | ||
<field name="arch" type="xml"> | ||
<field name="name" position="after"> | ||
<field name="partner_code"/> | ||
<field name="product_name"/> | ||
<field name="product_code"/> | ||
</field> | ||
</field> | ||
</record> | ||
</data> | ||
</openerp> |