google_map_review/views/res_company_views.xml
2026-06-11 14:13:20 +07:00

65 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!--
Inherit res.company form view:
- Add "Google Reviews" tab with the Place ID field
- Add smart button showing total review count
-->
<record id="view_company_form_google_review" model="ir.ui.view">
<field name="name">res.company.form.google.review</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<!-- Smart button area -->
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_stat_button"
type="object"
name="action_view_google_reviews"
icon="fa-star"
invisible="not google_business_id">
<field name="google_review_count"
widget="statinfo"
string="Google Reviews"/>
</button>
</xpath>
<!-- New tab: Google Reviews -->
<xpath expr="//page[@name='general_info']" position="after">
<page name="google_reviews_tab" string="Google Reviews">
<group>
<group string="Google Business Profile">
<field name="google_business_id"
placeholder="e.g. 12345678901234567890"/>
</group>
<group string="How to find your Place ID">
<div colspan="2" class="text-muted">
<ol>
<li>
Run <code>list_locations.py</code> from the
google_map_review project on a machine with
browser access.
</li>
<li>
Copy the long numeric Location ID shown in the
output for this branch.
</li>
<li>
Paste it in the "Google Business Place ID"
field above and save.
</li>
<li>
The scheduled crawl will automatically pick
up this branch on its next run.
</li>
</ol>
</div>
</group>
</group>
</page>
</xpath>
</field>
</record>
</data>
</odoo>