Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions website_form_metadata/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import models
20 changes: 20 additions & 0 deletions website_form_metadata/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2018 David Vidal <david.vidal@tecnativa.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
'name': 'Website Form Metadata',
'version': '11.0.1.0.0',
'category': 'Website',
'website': 'https://github.com/OCA/website',
'author': 'Tecnativa, '
'Odoo Community Association (OCA)',
'license': 'AGPL-3',
'application': False,
'installable': True,
'depends': [
'website',
],
'data': [
'views/res_config_view.xml',
],
}
3 changes: 3 additions & 0 deletions website_form_metadata/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import res_config_settings
13 changes: 13 additions & 0 deletions website_form_metadata/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# Copyright 2018 David Vidal <david.vidal@tecnativa.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'

website_form_enable_metadata = fields.Boolean(
related="website_id.website_form_enable_metadata",
)
3 changes: 3 additions & 0 deletions website_form_metadata/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
To configure this module, you need to go to *Website Admin > Settings >
Advanced Settings* and set *Write Metadata* on.

1 change: 1 addition & 0 deletions website_form_metadata/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* David Vidal <david.vidal@tecnativa.com>
4 changes: 4 additions & 0 deletions website_form_metadata/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Odoo has the hidden and unused ability to gather metadata from the website
forms and record into the record created from such form. This module unveils
it.

7 changes: 7 additions & 0 deletions website_form_metadata/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fill a website form and check the metadata has been recorded. For instance:

#. Go to the *Contact form* and fill it.
#. Go to the created *Lead* or *Oportunity* and scroll down to the chatter. The
metadata containing the origin IP address, user agent, accept language and
referer should be written.

22 changes: 22 additions & 0 deletions website_form_metadata/views/res_config_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="website.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='google_analytics_setting']" position="after">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="website_form_enable_metadata"/>
</div>
<div class="o_setting_right_pane">
<label for="website_form_enable_metadata"/>
<div class="text-muted">
Track metadata on your Website Forms
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>