<commit_before>{capture assign="odoo_status"}{strip}
<table class="no-border">
    <tbody>
    <tr>
        <td class="section-shown form-item">
            <div class="crm-accordion-wrapper">
                <div class="crm-accordion-header">{ts}Odoo information{/ts}</div>
                <div class="crm-accordion-body">
                    <table class="crm-info-panel">
                        <tbody>
                        <tr>
                            <td class="label">{ts}Odoo sync status{/ts}</td>
                            <td class="html-adjust">{$odoo_sync_status}</td>
                        </tr>
                        {if ($odoo_is_resyncable)}
                        <tr>
                            <td class="label"></td>
                            <td class="html-adject">
                                <a href="#" class="odoo button" title="Restore Sync" onclick="restoreSync({$contribution_id}); return false;">
                                    <span>{ts}Restore sync{/ts}</span>
                                </a>
                            </td>
                        </tr>
                        {/if}
                        </tbody>
                    </table>
                </div>
            </div>
        </td>
    </tr>
    </tbody>
</table>
{/strip}{/capture}

<script type="text/javascript">
    {literal}
    cj(function() {
        cj('.crm-contribution-view-form-block  > table.crm-info-panel').after('{/literal}{$odoo_status}{literal}');
    });

    function restoreSync(id) {
        CRM.api3('Odoo', 'Resync', {
            'object_name': 'Contribution',
            'id': id
        }).done(function(result) {
            if (typeof result.is_error === 'undefined' || !result.is_error) {
                location.reload();
            }
        });
    }

    {/literal}
</script><commit_msg>javascript error on contribution page<commit_after>{capture assign="odoo_status"}{strip}
<table class="no-border">
    <tbody>
    <tr>
        <td class="section-shown form-item">
            <div class="crm-accordion-wrapper">
                <div class="crm-accordion-header">{ts}Odoo information{/ts}</div>
                <div class="crm-accordion-body">
                    <table class="crm-info-panel">
                        <tbody>
                        <tr>
                            <td class="label">{ts}Odoo sync status{/ts}</td>
                            <td class="html-adjust">{$odoo_sync_status}</td>
                        </tr>
                        {if ($odoo_is_resyncable)}
                        <tr>
                            <td class="label"></td>
                            <td class="html-adject">
                                <a href="#" class="odoo button" title="Restore Sync" onclick="restoreSync({$contribution_id}); return false;">
                                    <span>{ts}Restore sync{/ts}</span>
                                </a>
                            </td>
                        </tr>
                        {/if}
                        </tbody>
                    </table>
                </div>
            </div>
        </td>
    </tr>
    </tbody>
</table>
{/strip}{/capture}

<script type="text/javascript">
    {literal}
    cj(function() {
        cj('.crm-contribution-view-form-block  > table.crm-info-panel').after('{/literal}{$odoo_status|replace:"'":"\'"}{literal}');
    });

    function restoreSync(id) {
        CRM.api3('Odoo', 'Resync', {
            'object_name': 'Contribution',
            'id': id
        }).done(function(result) {
            if (typeof result.is_error === 'undefined' || !result.is_error) {
                location.reload();
            }
        });
    }

    {/literal}
</script>
{'fraction_non_alphanumeric': 0.15580962509970753, 'fraction_numerical': 0.0005317734645041213, 'mean_word_length': 1.215547703180212, 'pattern_counts': {'":': 1, '<': 75, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5620706', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1028, 'n_words': 165}