Browse Source

Modifs droits

12.0
Juliana 5 years ago
parent
commit
409a9da78c
  1. 3
      __manifest__.py
  2. 3
      models/__init__.py
  3. 24
      models/vracoop_res_config.py
  4. 23
      models/website.py
  5. 46
      views/payzen_views.xml

3
__manifest__.py

@ -12,6 +12,7 @@
"website", "payment_payzen" "website", "payment_payzen"
], ],
"data": [ "data": [
"views/payzen_views.xml"
# 'security/ir.model.access.csv',
"views/payzen_views.xml",
] ]
} }

3
models/__init__.py

@ -1,4 +1,5 @@
# © 2019 Le Filament (<http://www.le-filament.com>) # © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import vracoop_res_config
from . import vracoop_res_config
from . import website

24
models/vracoop_res_config.py

@ -9,23 +9,19 @@ class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings' _inherit = 'res.config.settings'
payzen_site_id = fields.Char( payzen_site_id = fields.Char(
string=_('Identifiant boutique'),
help=_('The identifier provided by PayZen.'),
default=constants.PAYZEN_PARAMS.get('SITE_ID'),
required=True)
string='Identifiant boutique',
related='website_id.payzen_site_id',
readonly=False)
payzen_key_test = fields.Char( payzen_key_test = fields.Char(
string=_('Clé en mode test'),
help=_('Clé fournie par PayZen pour le mode test (disponible dans le Back Office PayZen).'),
default=constants.PAYZEN_PARAMS.get('KEY_TEST'),
readonly=constants.PAYZEN_PLUGIN_FEATURES.get('qualif'),
required=True)
string='Clé en mode test',
related='website_id.payzen_key_test',
readonly=False)
payzen_key_prod = fields.Char( payzen_key_prod = fields.Char(
string=_('Clé en mode production'),
help=_('Clé fournie par PayZen (disponible dans le Back Office PayZen après activation du mode de production).'),
default=constants.PAYZEN_PARAMS.get('KEY_PROD'),
required=True)
string='Clé en mode production',
related='website_id.payzen_key_prod',
readonly=False)
@api.multi @api.multi
def execute_payzen(self): def execute_payzen(self):
self.ensure_one() self.ensure_one()
return self.execute()
return self.execute

23
models/website.py

@ -0,0 +1,23 @@
# © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models, _
from ..helpers import constants
class VracWebsite(models.Model):
_inherit = "website"
payzen_site_id = fields.Char(
string=_('Identifiant boutique'),
help=_('The identifier provided by PayZen.'),
default=constants.PAYZEN_PARAMS.get('SITE_ID'))
payzen_key_test = fields.Char(
string=_('Clé en mode test'),
help=_('Clé fournie par PayZen pour le mode test (disponible dans le Back Office PayZen).'),
default=constants.PAYZEN_PARAMS.get('KEY_TEST'),
readonly=constants.PAYZEN_PLUGIN_FEATURES.get('qualif'))
payzen_key_prod = fields.Char(
string=_('Clé en mode production'),
help=_('Clé fournie par PayZen (disponible dans le Back Office PayZen après activation du mode de production).'),
default=constants.PAYZEN_PARAMS.get('KEY_PROD'))

46
views/payzen_views.xml

@ -2,24 +2,38 @@
<odoo> <odoo>
<data> <data>
<record id="vracoop_res_config_settings" model="ir.ui.view">
<field name="name">vracoop.res.config.settings</field>
<record id="vracoop_payzen_config_form" model="ir.ui.view">
<field name="name">vracoop.payzen.config.form</field>
<field name="model">res.config.settings</field> <field name="model">res.config.settings</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Configuration des Temps">
<sheet>
<form string="Settings" class="oe_form_configuration o_base_settings" js_class="base_settings">
<div class="o_control_panel">
<header> <header>
<button string="Save" type="object" name="execute_payzen" class="oe_highlight" /> <button string="Save" type="object" name="execute_payzen" class="oe_highlight" />
<button string="Discard" type="object" name="cancel" special="cancel" /> <button string="Discard" type="object" name="cancel" special="cancel" />
</header> </header>
<group>
<group string="Accès à la plateforme">
<field name="payzen_site_id" autocomplete="off" />
<field name="payzen_key_test" autocomplete="off" />
<field name="payzen_key_prod" autocomplete="off" />
</group>
</group>
</sheet>
</div>
<div class="o_setting_container">
<div class="settings_tab"/>
<div class="settings">
<div class="app_settings_block" data-string="Payzen" string="Payzen" data-key="website" groups="website.group_website_designer">
<div class="row mt16 o_settings_container" id="website_selection_settings2" groups="website.group_multi_website">
<div class="col-xs-12 col-md-6 o_setting_box" id="payzen">
<div class="o_setting_right_pane">
<label for="website_id" invisible="1" />
<field name="website_id" widget="selection" invisible="1"/>
<label for="payzen_site_id" />
<field name="payzen_site_id" autocomplete="off" />
<label for="payzen_key_test" />
<field name="payzen_key_test" autocomplete="off" />
<label for="payzen_key_prod" />
<field name="payzen_key_prod" autocomplete="off" />
</div>
</div>
</div>
</div>
</div>
</div>
</form> </form>
</field> </field>
</record> </record>
@ -30,15 +44,17 @@
<field name="res_model">res.config.settings</field> <field name="res_model">res.config.settings</field>
<field name="view_mode">form</field> <field name="view_mode">form</field>
<field name="target">inline</field> <field name="target">inline</field>
<field name="view_id" ref="vracoop_payzen_config_form"/>
<field name="context">{'module' : 'website'}</field>
</record> </record>
<menuitem id="menu_conf_delivery"
<menuitem id="menu_conf_payment"
name="Paiement" name="Paiement"
sequence="60" sequence="60"
parent="website.menu_website_configuration" parent="website.menu_website_configuration"
groups="website.group_website_designer"/>
groups="website.group_website_publisher"/>
<menuitem id="menu_payzen" parent="menu_conf_delivery" name="Payzen" action="action_payzen_view" sequence="10"/>
<menuitem id="menu_payzen" parent="menu_conf_payment" name="Payzen" action="action_payzen_view" sequence="10"/>
</data> </data>
</odoo> </odoo>
Loading…
Cancel
Save