Skip to content

Commit

Permalink
BSIBSO-1102 fix migration 10.17.0 (OCA#254)
Browse files Browse the repository at this point in the history
* Revert "fix migration"

This reverts commit 7867feb.

* Fix migration 10.17.0

Force the drop of specific_crm.assets_backend view after its move to bso_telephony module.

This view was moved from specific_crm module to bso_telephony on fe5de79 (OCA#248)
The module specific_crm is updated so the view should have been dropped at update but somehow it did not happen.
Therefore when installing bso_telephony we got the error that the "XML element cannot be located in parent view"
and we did an hotfix on the xpath expression on 7867feb.
However doing this did remove form_widgets.js from web module instead of the web_enterprise one we wanted to get
rid of in the first place, and we tought it fixes the error, whereas this did break the web client.

closes OCA#252

* fix travis crash
  • Loading branch information
grindtildeath authored and gurneyalex committed Oct 30, 2018
1 parent cc77304 commit 774e7d9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Latest (Unreleased)

**Bugfixes**

* BSIBSO-1102: Force the drop of specific_crm.assets_backend view after its move to bso_telephony module

**Build**

**Documentation**
Expand Down
15 changes: 6 additions & 9 deletions odoo/local-src/bso_telephony/templates/assets.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="web_enterprise_assets_backend"
name="Prevent `phone` widget definition in web_enterprise"
<template id="web_enterprise_assets_backend" name="Prevent `phone` widget definition in web_enterprise"
inherit_id="web_enterprise.assets_backend">
<!-- exclude phone widget from enterprise assets
actually, replaces the original JS source w/ the same file w/o `phone`
widget definition - just as if it was never present in there -->
<xpath
expr="//script[@src[contains(.,'form_widgets.js')]]"
position="replace">
<script type="text/javascript" src="/bso_telephony/static/src/js/patched_form_widgets.js"></script>
</xpath>
<script type="text/javascript"
src="/web_enterprise/static/src/js/views/form_widgets.js"
position="attributes">
<attribute name="src">/bso_telephony/static/src/js/patched_form_widgets.js</attribute>
</script>
</template>

<template id="assets_backend_inherit" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/less" href="/bso_telephony/static/src/less/phone.less"/>
</xpath>
</template>

</odoo>
2 changes: 2 additions & 0 deletions odoo/migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,5 @@ migration:
operations:
post:
- anthem songs.upgrade.upgrade_10_17_0::main
pre:
- anthem songs.upgrade.upgrade_10_17_0::pre
12 changes: 12 additions & 0 deletions odoo/songs/upgrade/upgrade_10_17_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@ def uninstall_base_dj(ctx):
@anthem.log
def main(ctx):
uninstall_base_dj(ctx)


@anthem.log
def pre(ctx):
drop_specific_crm_assets_view(ctx)


@anthem.log
def drop_specific_crm_assets_view(ctx):
view = ctx.env.ref('specific_crm.assets_backend', raise_if_not_found=False)
if view:
view.unlink()

0 comments on commit 774e7d9

Please sign in to comment.