How do I totally remove the "follow" functionality on Odoo/OpenERP? - odoo

I'm talking about the follow button under users. Can this be done with Access control without modifying the views?

Hi Alexander Suraphel,
In your form view of our object at the bottom you will find following syntax :
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
in this :
here message_follower_ids add the follow feature so you can remove that line, and that will remove that feature from that object on that view.
Thanks

Related

custom layout in form views in Odoo 14

I need a form view and I need its layout to be customized, using directly the Bootstrap 4 styles
How exactly can I do that ?
Also
I need some fields/tabs to appear conditionally (if some values is true) and such conditionally appearing fields need to be in my custom layout
Is this possible ?
How ?
First of all, I could use an example of a custom layout
And then I could use some enlightenment on how the conditional appearing of fields is done, behind the scenes
Thanks in advance
You can create a form view using any html you like. You can also use xpath to load custom css and javascript, such as bootstrap. You should load the xpath straight after your opening form tag.
<xpath expr="." position="inside">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
</xpath>
There a couple of ways to show things conditionally. I find the following example easiest when using the form views:
<div id="my-div" attrs="{'invisible': [('field','==',True)]}">Do not show this text if the field is true</div>

Fix an element "DIV" in the bottom of the page before the footer QWEB Invoice Report ODOO

I Want to fix a div element in the bottom of the page, just before the footer in the last page, it's a qweb report inherited from the standard invoice report of Odoo, the footer it's already visible only in the last page .
Any Idea ? suggestions ?
Here is a schema of what is wanted
Thanks,
As you mention your report inherits from the standard invoice report, I assume you already know that the standard invoice layout is a Qweb view named report_invoice_document and you have already defined a template like
<template id="your_module.report_invoice_document" priority="50" t-name="Your Module - Modifications to the Standard Invoice Layout" inherit_id="account.report_invoice_document">
<xpath expr="//div[hasclass('page')]" position="inside">
<div>Your content</div>
</xpath>
</template>
So the only issue is to fine tune both the XPath expression and the position. The whole report is inside a <div class="page"> tag, so using the above xpath tag will put your content just before the report's end.

TypeError: list.fields[order.name] is undefined

We are currently trying to upgrade to odoo 11 (from 10). We could fix most issues of our custom modules while installing them in new odoo 11 but now i get the following runtime error:
TypeError: list.fields[order.name] is undefined
http://10.15.0.183:8069/web/content/975-35dc0a2/web.assets_backend.js:1293
Traceback:
compareRecords#http://10.15.0.183:8069/web/content/975-35dc0a2/web.assets_backend.js:1293:190
Any ideas whats wrong? Any possibility to debug this or to find out where this exactly happens? the Traceback does not tell anything and in odoo-server log there is nothing.
we have different custom moduls extending articles,customers..
Try to unpack js files to get a better js error that will lead you exactly to where is located the issue, or at least a clear path to start debugging the JS issue in the browser. Try to reproduce the issue starting the page load from this URL
http://10.15.0.183:8069/web?debug=assets
you can also activate debugging mode from the Settings app or using a plugin for your browser:
chrome
Firefox
I know this question is old, but I had the same problem today.
I'm just sharing the fix in my case (Axel Mendoza "debug=assets" answer helped me to pinpoint the bug).
The problem was a mistake in a form view :
a <tree> element was used to render a many2many field, and the default_order attribute was referencing a field not used inside the <tree> definition.
Wrong XML :
<field name="my_many2many_field">
<tree default_order="my_field_0">
<field name="my_field_1"/>
<field name="my_field_2"/>
</tree>
</field>
In my case the fix was to add the field referenced by the default_order attribute, as an invisible field, inside the <tree> definition.
Fixed XML :
<field name="my_many2many_field">
<tree default_order="my_field_0">
<field name="my_field_0" invisible="1"/>
<field name="my_field_1"/>
<field name="my_field_2"/>
</tree>
</field>

Odoo 8 - How change content in div class="page"

i have Odoo 8 and i trying to edit content of template of invoice/order and more. I managed for now to change the header and footer entering in external_layout and external_layout_header/footer (From backend of Odoo). But i don't know how change content of div class="page".
Which files should i change?
Thanks for any help
I think what you are hoping to do is inherit from a particular report. Once you have inherited from the report you can use xpath to select the node in that report template.
<template id="template_name" inherit_id="other_addon.template_name">
<xpath expr="//div[#class='page']" position="replace">
<!-- YOUR CONTENT HERE -->
</xpath>
</template>

Override a default view by a custom module?

Is there a way to override openerp's default views, developing a module instead of doing it manually from Settings / Customization / User Interface / Views...?
We are using OpenERP and customizing a lot of default views (Project List, Invoice List, Invoice Search etc) adding and hiding fields from list and search filters / groups, we are doing it manually view by view from web client.
Is there a way to develop a module where I can write the xml for all the views I want to customize, and when I install that module all that views (and window actions as well) will be updated?
You can use View Inheritance to customize any view using XML files.
Using inheritance, you can add, remove and replace elements to any view. You can also define new complete views to replace the default instead of inheritance. Just create a new module with the XML files that customizes or replaces the current views and load that module. The module folder should contain only __init__.py, __openerp__.py and the XML files.
Here is a simple example to remove the EAN13 field from the product view.
__init__.py empty file
__openerp__.py:
{
"name" : "View Customization Test",
"version" : "1.0",
"category" : "Generic Modules/Inventory Control",
'depends' : ['product',],
"update_xml" : ["product.xml",],
"installable": True,
"active": True
}
product.xml:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_product_form_custom">
<field name="name">product.form.inherit2</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="arch" type="xml">
<field name="ean13" position="replace" />
</field>
</record>
</data>
</openerp>
Of course there is. You can create your custom module and install it. See the basics in the official docs. The Technical Memento is also something you should have at hand.
This makes it a lot easier to develop and test in a development environment, and afterwards copy and install in the production environment.
Certainly it is possible (and it is good idea to do it.)
First read the fundamentals of the view and view inheritance
then simply create a folder under your addons
add a __init__.py [python module descriptor]
Add __openerp__.py [OpenERP Module Descriptor]
Create an xml file and inheirt the required view with the XML Identifier of the existing view and register your view.xml in __openerp__.py.
And update your databse with your new module.