Skip to content

Commit

Permalink
[IMP] website_sale_delivery: show delivery methods link if module ins…
Browse files Browse the repository at this point in the history
…talled
  • Loading branch information
dut-odoo authored and rim-odoo committed Jul 25, 2017
1 parent a7b0b24 commit 179601e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions addons/website_sale_delivery/models/__init__.py
Expand Up @@ -4,3 +4,4 @@
from . import res_country
from . import delivery
from . import sale_order
from . import website_config_settings
16 changes: 16 additions & 0 deletions addons/website_sale_delivery/models/website_config_settings.py
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import api, models, fields


class WebsiteConfigSettings(models.TransientModel):
_inherit = 'website.config.settings'

is_installed_easypost = fields.Boolean()

@api.multi
def get_values(self, fields):
return {
'is_installed_easypost': self.env['ir.module.module'].search([('name', '=', 'delivery_easypost'), ('state', '=', 'installed')]).id
}
Expand Up @@ -12,6 +12,14 @@
</div>
</div>
</div>
<div id="website_delivery_easypost" position="after">
<field name="is_installed_easypost" invisible="1"/>
<div class="content-group">
<div class="mt16" attrs="{'invisible': ['|', ('module_delivery_easypost', '=', False), ('is_installed_easypost','=',False)]}">
<button name="%(delivery.action_delivery_carrier_form)d" icon="fa-arrow-right" type="action" string="Easypost Delivery Methods" class="btn-link" context="{'search_default_delivery_type': 'easypost'}"/>
</div>
</div>
</div>
</field>
</record>
</odoo>

0 comments on commit 179601e

Please sign in to comment.