diff --git a/__manifest__.py b/__manifest__.py index 6587d17ff920591c9668eb37425ff48ed666147b..ad4f53204c7fcb7c2b50424eb6414ee88a2e3859 100644 --- a/__manifest__.py +++ b/__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': [ diff --git a/models/__init__.py b/models/__init__.py index 390af6068a7de99e1d216408b09b3bf370590f4b..2478562713121755880590603f39fcdad387b8a8 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from . import pos_transaction \ No newline at end of file +from . import pos_transaction +from . import res_config_settings +from . import res_company \ No newline at end of file diff --git a/models/__pycache__/__init__.cpython-35.pyc b/models/__pycache__/__init__.cpython-35.pyc deleted file mode 100644 index d2fb209f0101178887bfb26ba6581b7148401ae1..0000000000000000000000000000000000000000 Binary files a/models/__pycache__/__init__.cpython-35.pyc and /dev/null differ diff --git a/models/__pycache__/pos_transaction.cpython-35.pyc b/models/__pycache__/pos_transaction.cpython-35.pyc deleted file mode 100644 index e9ed05179eeb37e87d3993d2159495a061cfcb2c..0000000000000000000000000000000000000000 Binary files a/models/__pycache__/pos_transaction.cpython-35.pyc and /dev/null differ diff --git a/models/pos_transaction.py b/models/pos_transaction.py index b8cbf426bf7116d57762112e6ab8afb2b9656445..9a982229b0f81737fa5ff9fd0e19cac6777d246d 100644 --- a/models/pos_transaction.py +++ b/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: diff --git a/models/res_company.py b/models/res_company.py new file mode 100644 index 0000000000000000000000000000000000000000..d90953c0558b7bda4198e0af95e91f65fdc8e73f --- /dev/null +++ b/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") \ No newline at end of file diff --git a/models/res_config_settings.py b/models/res_config_settings.py new file mode 100644 index 0000000000000000000000000000000000000000..147936fff66078433ebf5c441b5c30d6136b8f14 --- /dev/null +++ b/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) \ No newline at end of file diff --git a/views/res_config_setting_views.xml b/views/res_config_setting_views.xml new file mode 100644 index 0000000000000000000000000000000000000000..6bb4e4747a521c31ff0dd7b863dcc82b8782328f --- /dev/null +++ b/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>