Skip to content

Commit

Permalink
[NEW] product_code_replacement: Module to move product code next to p…
Browse files Browse the repository at this point in the history
…roduct name.
  • Loading branch information
gediminasvenc committed Sep 17, 2018
1 parent 1ff51af commit fce89fc
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions product_code_replacement/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# -*- coding: utf-8 -*-
38 changes: 38 additions & 0 deletions product_code_replacement/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# Copyright (C) 2016-TODAY Linserv Aktiebolag, Sweden (<http://www.linserv.se>).
#
##############################################################################
{
'name': "Product Code Replacement",
"version": "1.0",
"author": "Linserv AB",
"category": "Sales Management",
"summary": "Product Code Replacement",
"website": "www.linserv.se",
"contributors": [
'Gediminas Venclova <[email protected]>'
],
"license": "",
'depends': [
'product'
],
'description': """
Modification moves product code field from information tab next to product name.
""",
"demo": [],
"data": [
'views/inherited_product.xml',
],
"test": [],
"js": [],
"css": [],
"qweb": [],
"installable": True,
"auto_install": False,

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions product_code_replacement/views/inherited_product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<!--replaced default code field location to header-->
<record id="product_code_replacement_inherit_product_template_only_form" model="ir.ui.view">
<field name="name">product.code.replacement.inherit.product.template.only.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<field name="default_code" position="replace"/>
<xpath expr="//div[@class='oe_left']/div[@class='oe_title']" position="inside">
<label for="default_code" attrs="{'invisible': [('product_variant_count', '>', 1)]}" class="oe_edit_only"/>
<field name="default_code" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
</xpath>
</field>
</record>

</data>
</openerp>

0 comments on commit fce89fc

Please sign in to comment.