Browse Source

Merge PR #409 into 12.0

Signed-off-by legalsylvain
pull/466/head
OCA-git-bot 4 years ago
parent
commit
d7d5582a27
  1. 0
      pos_journal_image/README.rst
  2. 1
      pos_journal_image/__init__.py
  3. 20
      pos_journal_image/__manifest__.py
  4. 27
      pos_journal_image/i18n/fr.po
  5. 1
      pos_journal_image/models/__init__.py
  6. 10
      pos_journal_image/models/account_journal.py
  7. 9
      pos_journal_image/readme/CONFIGURE.rst
  8. 1
      pos_journal_image/readme/CONTRIBUTORS.rst
  9. 6
      pos_journal_image/readme/DESCRIPTION.rst
  10. BIN
      pos_journal_image/static/description/account_journal_form.png
  11. BIN
      pos_journal_image/static/description/pos_payment.png
  12. 6
      pos_journal_image/static/src/css/pos_journal_image.css
  13. 18
      pos_journal_image/static/src/js/pos_journal_image.js
  14. 17
      pos_journal_image/static/src/xml/pos_journal_image.xml
  15. 16
      pos_journal_image/views/templates.xml
  16. 21
      pos_journal_image/views/view_account_journal.xml

0
pos_journal_image/README.rst

1
pos_journal_image/__init__.py

@ -0,0 +1 @@
from . import models

20
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,
}

27
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"

1
pos_journal_image/models/__init__.py

@ -0,0 +1 @@
from . import account_journal

10
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)

9
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

1
pos_journal_image/readme/CONTRIBUTORS.rst

@ -0,0 +1 @@
* Sylvain LE GAL <https://twitter.com/legalsylvain>

6
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

BIN
pos_journal_image/static/description/account_journal_form.png

After

Width: 942  |  Height: 372  |  Size: 24 KiB

BIN
pos_journal_image/static/description/pos_payment.png

After

Width: 866  |  Height: 221  |  Size: 21 KiB

6
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;
}

18
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';
},
});
});

17
pos_journal_image/static/src/xml/pos_journal_image.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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).
-->
<templates id="template" xml:space="preserve">
<t t-extend="PaymentScreen-Paymentmethods">
<t t-jquery="[t-esc='cashregister.journal_id[1]']" t-operation="before">
<img t-att-src="widget.journal_icon_url(cashregister.journal_id[0])"
class="journal-image"/>
</t>
</t>
</templates>

16
pos_journal_image/views/templates.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_journal_image/static/src/js/pos_journal_image.js"/>
<link rel="stylesheet" href="/pos_journal_image/static/src/css/pos_journal_image.css"/>
</xpath>
</template>
</odoo>

21
pos_journal_image/views/view_account_journal.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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>
<record id="view_account_journal_form" model="ir.ui.view">
<field name="model">account.journal</field>
<field name="inherit_id" ref="point_of_sale.view_account_journal_pos_user_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='amount_authorized']" position="after">
<group>
<field name="pos_image" widget="image" class="oe_avatar"/>
</group>
</xpath>
</field>
</record>
</odoo>
Loading…
Cancel
Save