Browse Source

Ajout configuration URL Mayam

12.0
Juliana 4 years ago
parent
commit
93d258fb0f
  1. 1
      __manifest__.py
  2. 2
      models/__init__.py
  3. BIN
      models/__pycache__/__init__.cpython-35.pyc
  4. BIN
      models/__pycache__/pos_transaction.cpython-35.pyc
  5. 2
      models/pos_transaction.py
  6. 9
      models/res_company.py
  7. 10
      models/res_config_settings.py
  8. 30
      views/res_config_setting_views.xml

1
__manifest__.py

@ -14,6 +14,7 @@
],
"data": [
'views/pos_transaction_views.xml',
'views/res_config_setting_views.xml',
'data/service_cron_send_mayam.xml',
],
'qweb': [

2
models/__init__.py

@ -2,3 +2,5 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import pos_transaction
from . import res_config_settings
from . import res_company

BIN
models/__pycache__/__init__.cpython-35.pyc

BIN
models/__pycache__/pos_transaction.cpython-35.pyc

2
models/pos_transaction.py

@ -33,7 +33,7 @@ class PosTransaction(models.Model):
def send_to_mayam(self):
list_transaction = []
data_transaction = {}
url = "https://api.mayam.fr/transaction"
url = self.env.user.company_id.url_mayam
key_vracoop = "VracoopAPI@2020"
for transaction in self:

9
models/res_company.py

@ -0,0 +1,9 @@
# Copyright 2021 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, _
class ResCompany(models.Model):
_inherit = "res.company"
url_mayam = fields.Char("URL Mayam")

10
models/res_config_settings.py

@ -0,0 +1,10 @@
# Copyright 2020 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
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
url_mayam = fields.Char("URL Mayam", related='company_id.url_mayam', readonly=False)

30
views/res_config_setting_views.xml

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.vracoop</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="100"/>
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@class='app_settings_block']" position="inside">
<h2>Balance</h2>
<div class="row mt16 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box" title="This tax is applied to any new product created in the catalog.">
<div class="o_setting_right_pane">
<div>
<label string="URL Mayam" for="url_mayam"/>
<div class="text-muted">
URL Mayam pour l'envoi des transactions
</div>
<div class="content-group mt16">
<field name="url_mayam" colspan="4" nolabel="1" />
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>
Loading…
Cancel
Save