diff --git a/pos_journal_image/README.rst b/pos_journal_image/README.rst new file mode 100644 index 00000000..e69de29b diff --git a/pos_journal_image/__init__.py b/pos_journal_image/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/pos_journal_image/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_journal_image/__manifest__.py b/pos_journal_image/__manifest__.py new file mode 100644 index 00000000..c68b6020 --- /dev/null +++ b/pos_journal_image/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright (C) 2019 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Point of Sale - Journal Image", + "summary": "Add images on Account Journals available in the PoS", + "version": "12.0.1.0.0", + "category": "Point of Sale", + "author": "GRAP, Odoo Community Association (OCA)", + "website": "https://www.github.com/OCA/pos", + "license": "AGPL-3", + "depends": ["point_of_sale"], + "data": ["views/templates.xml", "views/view_account_journal.xml"], + "qweb": ["static/src/xml/pos_journal_image.xml"], + "images": [ + "static/description/account_journal_form.png", + "static/description/pos_payment.png", + ], + "installable": True, +} diff --git a/pos_journal_image/i18n/fr.po b/pos_journal_image/i18n/fr.po new file mode 100644 index 00000000..9be0a5f9 --- /dev/null +++ b/pos_journal_image/i18n/fr.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_journal_image +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-15 09:52+0000\n" +"PO-Revision-Date: 2019-11-15 09:52+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_journal_image +#: model:ir.model,name:pos_journal_image.model_account_journal +msgid "Journal" +msgstr "Journal" + +#. module: pos_journal_image +#: model:ir.model.fields,field_description:pos_journal_image.field_account_journal__pos_image +msgid "PoS Image" +msgstr "Image PdV" + diff --git a/pos_journal_image/models/__init__.py b/pos_journal_image/models/__init__.py new file mode 100644 index 00000000..2388e119 --- /dev/null +++ b/pos_journal_image/models/__init__.py @@ -0,0 +1 @@ +from . import account_journal diff --git a/pos_journal_image/models/account_journal.py b/pos_journal_image/models/account_journal.py new file mode 100644 index 00000000..b4c0b105 --- /dev/null +++ b/pos_journal_image/models/account_journal.py @@ -0,0 +1,10 @@ +# Copyright (C) 2019 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import fields, models + + +class AccountJournal(models.Model): + _inherit = "account.journal" + + pos_image = fields.Binary(string="PoS Image", attachment=True) diff --git a/pos_journal_image/readme/CONFIGURE.rst b/pos_journal_image/readme/CONFIGURE.rst new file mode 100644 index 00000000..60158886 --- /dev/null +++ b/pos_journal_image/readme/CONFIGURE.rst @@ -0,0 +1,9 @@ +To configure this module, you need to: + +* Go to 'Point Of Sale' / 'Configuration' / 'Payment Methods' + +* Select journals available in the PoS + +* In the 'Point of Sale' tab, set an image + +.. figure:: ../static/description/account_journal_form.png diff --git a/pos_journal_image/readme/CONTRIBUTORS.rst b/pos_journal_image/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..9f76a75b --- /dev/null +++ b/pos_journal_image/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Sylvain LE GAL diff --git a/pos_journal_image/readme/DESCRIPTION.rst b/pos_journal_image/readme/DESCRIPTION.rst new file mode 100644 index 00000000..ddabe041 --- /dev/null +++ b/pos_journal_image/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +This module extends the functionality of point of sale to display images +for each journal available in the Point of Sale. + +* The images are available in the payment screen + +.. figure:: ../static/description/pos_payment.png diff --git a/pos_journal_image/static/description/account_journal_form.png b/pos_journal_image/static/description/account_journal_form.png new file mode 100644 index 00000000..60d848a1 Binary files /dev/null and b/pos_journal_image/static/description/account_journal_form.png differ diff --git a/pos_journal_image/static/description/pos_payment.png b/pos_journal_image/static/description/pos_payment.png new file mode 100644 index 00000000..679cab8f Binary files /dev/null and b/pos_journal_image/static/description/pos_payment.png differ diff --git a/pos_journal_image/static/src/css/pos_journal_image.css b/pos_journal_image/static/src/css/pos_journal_image.css new file mode 100644 index 00000000..4295f4c4 --- /dev/null +++ b/pos_journal_image/static/src/css/pos_journal_image.css @@ -0,0 +1,6 @@ +.paymentmethods img.journal-image{ + max-width: 50px; + max-height: 50px; + margin-right: 20px; + vertical-align: middle; +} diff --git a/pos_journal_image/static/src/js/pos_journal_image.js b/pos_journal_image/static/src/js/pos_journal_image.js new file mode 100644 index 00000000..2e9245f7 --- /dev/null +++ b/pos_journal_image/static/src/js/pos_journal_image.js @@ -0,0 +1,18 @@ +/* +Copyright (C) 2019-Today GRAP (http://www.grap.coop) +@author: Sylvain LE GAL (https://twitter.com/legalsylvain) +License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +*/ + +odoo.define('pos_journal_image.pos_journal_image', function (require) { + "use strict"; + + var PosBaseWidget = require('point_of_sale.BaseWidget'); + + PosBaseWidget.include({ + journal_icon_url: function(id){ + return '/web/binary/image?model=account.journal&id=' + id + '&field=pos_image'; + }, + }); + +}); diff --git a/pos_journal_image/static/src/xml/pos_journal_image.xml b/pos_journal_image/static/src/xml/pos_journal_image.xml new file mode 100644 index 00000000..67cb3e95 --- /dev/null +++ b/pos_journal_image/static/src/xml/pos_journal_image.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/pos_journal_image/views/templates.xml b/pos_journal_image/views/templates.xml new file mode 100644 index 00000000..e7daaa51 --- /dev/null +++ b/pos_journal_image/views/templates.xml @@ -0,0 +1,16 @@ + + + + +