Duplicate field issue in form view odoo - odoo-8

I have create one field in stock.quant.package model.
tracking_ref=fields.Char("Tracking Ref")
This field is used in two separate modules and I am not able to give module dependency because both are separate modules.
It may be possible that both modules are installed in same database or it may
be possible that in some database only one module is installed.
Due to that reason i have create same field & view in both modules.
But now issue is that if both modules are installed then field is
available two times in the form view.
Is there any possibility that if we install both modules then field will visible only one time in form view.

I am not sure it is the best solution. Just try:
Create a new Module, say module_common
Put all common fields and functions in new module module_common
Make this module dependent of another two modules.
Ex: module_a depends module_common and module_common depends module_common.
Hope it will resolve your problem.

Related

Sub-modules in codeiginter HMVC?

I am building a shopping cart system as part of a CodeIgniter 2 site that uses HMVC.
Instead of having one big "cart" module I was hoping I could break up the module into sub modules.
E.g.
/modules/cart
/modules/cart/config
/modules/cart/controllers
/modules/cart/models
/modules/cart/views
/modules/cart/modules
/modules/cart/modules/categories
/modules/cart/modules/categories/config
/modules/cart/modules/categories/controllers
/modules/cart/modules/categories/models
/modules/cart/modules/categories/views
/modules/cart/modules/products
/modules/cart/modules/products/config
/modules/cart/modules/products/controllers
/modules/cart/modules/products/models
/modules/cart/modules/products/views
Is it possible to do this or something similar?
i worked on codeigniter before 4-5 months. As per as i remember in application folder we can make modules.
Under modules package, we can create the package with the name which we required. We may call it as cart.
Under cart, as per i know, we can not create modules under it. But like each and every folder we can create the particular sub folders and this can solve the your problem as well.
Your folder structure will be like as follows
/modules/cart
/modules/cart/config
/modules/cart/controllers
/modules/cart/controllers/categories
/modules/cart/controllers/product
/modules/cart/models
/modules/cart/models/categories
/modules/cart/models/product
/modules/cart/views
/modules/cart/views/categories
/modules/cart/views/product
i may we wrong. On this link https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home described very well.

Joomla Save Module As Another Copy

I'm using Joomla 2.5.3.
I have this module that incorporates with authentication. For some reasons I want this module to be duplicated, so I save it as another copy.
Now, as its Module Type is same as the original one,say Auth, how do I customize the files of the copied module?
There is no folder for the copied module inside modules. Only the original one is there.
Thanks.
It depends on what you want to modify and how the module was created.
If the module was created using the MVC design pattern you want to modify ONLY the view (layout, html, css, js), then you'll need to check if the module supports multiple views/layouts or override the layout and create a view for each module depending on its Id. http://www.minitek.gr/tutorials/joomla-16-tutorials/item/21-how-to-create-a-new-custom-module-in-joomla-16.html
If the module wasn't created using the MVC design pattern, you could duplicate the module folder with another name and modify the name of the module in the xml, however it also depends on what the module does (does it write anything to the db?).
Maybe the easiest (probably not the best), would be modifying the current module depending on the module id. Check this out: http://docs.joomla.org/JModuleHelper/getModule
Think of a module as being similar to a class. You have one instance of the module created already. When you either clone the current instance or create a new instance there is still only one underlying set of files.
Each instance of the module contains its own individual settings so they should not clash with each other.
I can't think of any reason why you would need to customise the underlying files. If you do find a need then your best bet is to copy all of the files from the original module and use them as a base to build your own - entirely new - module, with a new name, new class names, etc.

Joomla 1.5 - Creating SQL tables in components

Joomla 1.5 has JTable, which can be extended to act as an Active Record system (Create/Read/Update/Delete).
However, I can not find any way for this interface to create the table represented by my JTable sub-class.
Every example I have found has started with "manually create the database tables... ", then created a JTable class to work with it. I would like to be able to distribute my plugin and have it create the tables on setup, so that this is not necessary.
Any easy way to do this?
This is usually done in the install.sql of your extension (The link is related to component but I guess for plugins it's the same).

How to design Joomla style plugin in CodeIgniter

First of all, I want to describe my project architecture:
My project uses jqGrid.
Controllers only define the Grid.
Then Models retrieve the Data for the Grid.
Models are used to Add/Edit/Delete Records.
Views are used to show the page.
Consider, I have 10 different kinds of customers for my project. My project is a hosted solution which serves my all 10 customers from a single source. Among them, eight needs the exact same as I created. Only two are different than the common.
For example, imagine that I want to show a product list. As my project is a hosted solution I can't change the menu by which I can change the controller for the said two customers.
To solve the problem, I want to implement plugin system like Joomla.
How can I do that in CodeIgniter?
Edit
I am using CI 1.7.2.
Maybe it will help you:
There is module solution for Codeigniter HMVC module . It gives you way to divide application logic into modules with their own MVC structure (each module will have it's own model\view\controller).
After installing this module into CI you'll be able to call another module from main app's controller (or view or model) like that:
<?php echo modules::run('module/controller/method', $param, $...); ?>
So I think you can use modules functionality provided by this extension to build per customer modules structure based on customers roles.

How to create multiple module instances in joomla 1.5?

I have installed joomla module. It seems that I can only display the same module with the same configuration on any page.
How do you have this same module, with a different configuration on different page ? (I do not want to display the same rss feed under each joomla article)...
Is it possible to have multiple "instances" of a module ?
I have taken an rss feed module for example, but I could have taken any joomla module.
Thank you for your answer
Frd...its easy..
Pls follow my link:
Administrator--> Extensions--> module manager-->Select ur module(Which module u need)-->click new Button (in top right menu)-->here u got all module (select ur required module)--> now u can get it...!!! pls check it..!!
Modules can be assigned to specific menu items. In 1.5 you have the option to assign a module to All, Selected, or None menu items. Simple make multiple copies of the module you want to use then assign each version to the menu items you wish with the associated variations in configuration.
You can create multiple instances of a module through module manager in Admin side of your site. And different instances can have different configurations.

Resources