Browse Source

Removal of Gogocarto map URL from config settings

partner_gogocarto
Stéphan Sainléger 4 years ago
committed by default
parent
commit
25ea212f4d
  1. 6
      partner_gogocarto_export_api/models/res_config_settings.py
  2. 13
      partner_gogocarto_export_api/views/gogocarto_config_settings_view.xml

6
partner_gogocarto_export_api/models/res_config_settings.py

@ -7,20 +7,17 @@ _logger = logging.getLogger(__name__)
class ResConfigSettings(models.TransientModel): class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings' _inherit = 'res.config.settings'
gogocarto_map_url = fields.Char(readonly=False)
export_gogocarto_fields = fields.Many2many('ir.model.fields', 'export_field_rel', 'export_id', 'fields_id', export_gogocarto_fields = fields.Many2many('ir.model.fields', 'export_field_rel', 'export_id', 'fields_id',
domain="[""('model_id', '=', 'res.partner')\ domain="[""('model_id', '=', 'res.partner')\
,('name', 'not in', ('name','partner_longitude','partner_latitude'))""]",
,('name', 'not in', ('name','partner_longitude','partner_latitude','message_follower_ids','message_ids'))""]",
readonly=False) readonly=False)
@api.model @api.model
def get_values(self): def get_values(self):
res = super(ResConfigSettings, self).get_values() res = super(ResConfigSettings, self).get_values()
ICPSudo = self.env['ir.config_parameter'].sudo() ICPSudo = self.env['ir.config_parameter'].sudo()
gogocarto_map_url = ICPSudo.get_param('gogocarto_export_api.gogocarto_map_url')
export_gogocarto_fields = ICPSudo.get_param('gogocarto_export_api.export_gogocarto_fields') if ICPSudo.get_param('gogocarto_export_api.export_gogocarto_fields') else "[]" export_gogocarto_fields = ICPSudo.get_param('gogocarto_export_api.export_gogocarto_fields') if ICPSudo.get_param('gogocarto_export_api.export_gogocarto_fields') else "[]"
res.update( res.update(
gogocarto_map_url=gogocarto_map_url,
export_gogocarto_fields= [(6, 0, literal_eval(export_gogocarto_fields))] export_gogocarto_fields= [(6, 0, literal_eval(export_gogocarto_fields))]
) )
return res return res
@ -29,7 +26,6 @@ class ResConfigSettings(models.TransientModel):
def set_values(self): def set_values(self):
res = super(ResConfigSettings, self).set_values() res = super(ResConfigSettings, self).set_values()
ICPSudo = self.env['ir.config_parameter'] ICPSudo = self.env['ir.config_parameter']
ICPSudo.set_param('gogocarto_export_api.gogocarto_map_url',self.gogocarto_map_url)
ICPSudo.set_param('gogocarto_export_api.export_gogocarto_fields',self.export_gogocarto_fields.ids) ICPSudo.set_param('gogocarto_export_api.export_gogocarto_fields',self.export_gogocarto_fields.ids)
return res return res

13
partner_gogocarto_export_api/views/gogocarto_config_settings_view.xml

@ -10,19 +10,6 @@
<div class="app_settings_block" data-string="Gogocarto" string="Gogocarto" data-key="gogocarto"> <div class="app_settings_block" data-string="Gogocarto" string="Gogocarto" data-key="gogocarto">
<h2>Gogocarto export configuration</h2> <h2>Gogocarto export configuration</h2>
<div class="row mt16 o_settings_container" id="gogocarto_selection_settings"> <div class="row mt16 o_settings_container" id="gogocarto_selection_settings">
<div class="col-12 col-lg-6 o_setting_box" id="gogocarto_url">
<div class="o_setting_right_pane">
<div class="text-muted">
URL of your Gogocarto map, to be displayed in Odoo main menu
</div>
<div class="content-group">
<div class="row mt16">
<label class="col-lg-3 o_light_label" string="Map URL" for="gogocarto_map_url"/>
<field name="gogocarto_map_url"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="gogocarto_fields"> <div class="col-12 col-lg-6 o_setting_box" id="gogocarto_fields">
<div class="o_setting_right_pane"> <div class="o_setting_right_pane">
<div class="text-muted"> <div class="text-muted">

Loading…
Cancel
Save