Browse Source

[ADD] pos_journal_image (v8.0 version)

pull/409/head
Sylvain LE GAL 5 years ago
parent
commit
78138ae96b
  1. 93
      pos_journal_image/README.rst
  2. 2
      pos_journal_image/__init__.py
  3. 32
      pos_journal_image/__openerp__.py
  4. 17
      pos_journal_image/demo/account_journal.xml
  5. 27
      pos_journal_image/i18n/fr.po
  6. 2
      pos_journal_image/models/__init__.py
  7. 12
      pos_journal_image/models/account_journal.py
  8. 9
      pos_journal_image/readme/CONFIGURE.rst
  9. 1
      pos_journal_image/readme/CONTRIBUTORS.rst
  10. 7
      pos_journal_image/readme/CREDITS.rst
  11. 10
      pos_journal_image/readme/DESCRIPTION.rst
  12. BIN
      pos_journal_image/static/description/account_journal_form.png
  13. BIN
      pos_journal_image/static/description/pos_payment_list_image.png
  14. BIN
      pos_journal_image/static/description/pos_paypad_image.png
  15. BIN
      pos_journal_image/static/img/cash_journal-pos_image.png
  16. BIN
      pos_journal_image/static/img/check_journal-pos_image.png
  17. 38
      pos_journal_image/static/src/css/pos_journal_image.css
  18. 18
      pos_journal_image/static/src/js/pos_journal_image.js
  19. 30
      pos_journal_image/static/src/xml/pos_journal_image.xml
  20. 21
      pos_journal_image/views/templates.xml
  21. 19
      pos_journal_image/views/view_account_journal.xml

93
pos_journal_image/README.rst

@ -0,0 +1,93 @@
=============================
Point of Sale - Journal Image
=============================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-grap%2Fgrap--odoo--incubator-lightgray.png?logo=github
:target: https://github.com/grap/grap-odoo-incubator/tree/8.0_ADD_pos_image_journal/pos_journal_image
:alt: grap/grap-odoo-incubator
|badge1| |badge2| |badge3|
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 Paypad part
.. figure:: https://raw.githubusercontent.com/grap/grap-odoo-incubator/8.0_ADD_pos_image_journal/pos_journal_image/static/description/pos_paypad_image.png
* There are also available in the payment screen
.. figure:: https://raw.githubusercontent.com/grap/grap-odoo-incubator/8.0_ADD_pos_image_journal/pos_journal_image/static/description/pos_payment_list_image.png
**Table of contents**
.. contents::
:local:
Configuration
=============
To configure this module, you need to:
* Go to 'Invoicing' / 'Configuration' / 'Journals' / 'Journals'
* Select journals available in the PoS
* In the 'Point of Sale' tab, set an image
.. figure:: https://raw.githubusercontent.com/grap/grap-odoo-incubator/8.0_ADD_pos_image_journal/pos_journal_image/static/description/account_journal_form.png
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/grap/grap-odoo-incubator/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/grap/grap-odoo-incubator/issues/new?body=module:%20pos_journal_image%0Aversion:%208.0_ADD_pos_image_journal%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* GRAP
Contributors
~~~~~~~~~~~~
* Sylvain LE GAL <https://twitter.com/legalsylvain>
Other credits
~~~~~~~~~~~~~
Images for demo data come from flaticon.com
* Check Image, https://www.flaticon.com/free-icon/checked_259499, by
https://www.flaticon.com/authors/freepik
* Cash Image, https://www.flaticon.com/free-icon/hand_1235446, by
https://www.flaticon.com/authors/freepik
Maintainers
~~~~~~~~~~~
This module is part of the `grap/grap-odoo-incubator <https://github.com/grap/grap-odoo-incubator/tree/8.0_ADD_pos_image_journal/pos_journal_image>`_ project on GitHub.
You are welcome to contribute.

2
pos_journal_image/__init__.py

@ -0,0 +1,2 @@
# coding: utf-8
from . import models

32
pos_journal_image/__openerp__.py

@ -0,0 +1,32 @@
# coding: 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).
{
'name': "Point of Sale - Journal Image",
'summary': "Add images on Account Journals available in the PoS",
'version': '8.0.1.0.0',
'category': 'Point of Sale',
'author': 'GRAP',
'website': 'http://www.grap.coop',
'license': 'AGPL-3',
'depends': [
'point_of_sale',
],
'data': [
'views/templates.xml',
'views/view_account_journal.xml',
],
'qweb': [
'static/src/xml/pos_journal_image.xml',
],
'demo': [
'demo/account_journal.xml',
],
'images': [
'static/description/account_journal_form.png',
'static/description/pos_payment_list_image.png',
'static/description/pos_paypad_image.png',
],
'installable': False,
}

17
pos_journal_image/demo/account_journal.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).
-->
<openerp><data>
<record id="account.cash_journal" model="account.journal">
<field name="pos_image" type="base64" file="pos_journal_image/static/img/cash_journal-pos_image.png"/>
</record>
<record id="account.check_journal" model="account.journal">
<field name="pos_image" type="base64" file="pos_journal_image/static/img/check_journal-pos_image.png"/>
</record>
</data></openerp>

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 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-03-27 11:43+0000\n"
"PO-Revision-Date: 2019-03-27 11:43+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
#: field:account.journal,pos_image:0
msgid "PoS Image"
msgstr "Image PdV"

2
pos_journal_image/models/__init__.py

@ -0,0 +1,2 @@
# coding: utf-8
from . import account_journal

12
pos_journal_image/models/account_journal.py

@ -0,0 +1,12 @@
# coding: 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).
from openerp import fields, models
class AccountJournal(models.Model):
_inherit = 'account.journal'
# Columns section
pos_image = fields.Binary(string='PoS Image')

9
pos_journal_image/readme/CONFIGURE.rst

@ -0,0 +1,9 @@
To configure this module, you need to:
* Go to 'Invoicing' / 'Configuration' / 'Journals' / 'Journals'
* 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>

7
pos_journal_image/readme/CREDITS.rst

@ -0,0 +1,7 @@
Images for demo data come from flaticon.com
* Check Image, https://www.flaticon.com/free-icon/checked_259499, by
https://www.flaticon.com/authors/freepik
* Cash Image, https://www.flaticon.com/free-icon/hand_1235446, by
https://www.flaticon.com/authors/freepik

10
pos_journal_image/readme/DESCRIPTION.rst

@ -0,0 +1,10 @@
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 Paypad part
.. figure:: ../static/description/pos_paypad_image.png
* There are also available in the payment screen
.. figure:: ../static/description/pos_payment_list_image.png

BIN
pos_journal_image/static/description/account_journal_form.png

After

Width: 733  |  Height: 367  |  Size: 38 KiB

BIN
pos_journal_image/static/description/pos_payment_list_image.png

After

Width: 556  |  Height: 417  |  Size: 22 KiB

BIN
pos_journal_image/static/description/pos_paypad_image.png

After

Width: 429  |  Height: 498  |  Size: 31 KiB

BIN
pos_journal_image/static/img/cash_journal-pos_image.png

After

Width: 100  |  Height: 100  |  Size: 3.0 KiB

BIN
pos_journal_image/static/img/check_journal-pos_image.png

After

Width: 100  |  Height: 100  |  Size: 1.9 KiB

38
pos_journal_image/static/src/css/pos_journal_image.css

@ -0,0 +1,38 @@
/*Paypad CSS*/
.paypad-button {
text-align: left;
font-size: 16px;
line-height: 30px;
}
.paypad-button .cashregister-img{
padding-right: 5px;
float: left;
}
.paypad-button .cashregister-img img{
max-width: 25px;
max-height: 25px;
}
/*Payment Screen CSS*/
.pos .pos-payment-container{
width: 500px;
}
.paymentline .paymentline-name{
font-size: 25px;
line-height: 40px;
}
.paymentline .paymentline-img{
float: left;
padding-right: 10px;
}
.paymentline .paymentline-img img{
max-width: 50px;
max-height: 50px;
}

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).
*/
"use strict";
openerp.pos_journal_image = function(instance){
var module = instance.point_of_sale;
module.PosBaseWidget.include({
journal_icon_url: function(id){
return '/web/binary/image?model=account.journal&id=' + id + '&field=pos_image';
},
});
};

30
pos_journal_image/static/src/xml/pos_journal_image.xml

@ -0,0 +1,30 @@
<?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="PaypadButtonWidget">
<t t-jquery="[t-esc='widget.cashregister.journal.name']" t-operation="before">
<t t-if="widget.cashregister.journal.pos_image">
<div class="cashregister-img">
<img t-att-src="widget.journal_icon_url(widget.cashregister.journal.id)"/>
</div>
</t>
</t>
</t>
<t t-extend="Paymentline">
<t t-jquery="[class='paymentline-name']" t-operation="before">
<div class="paymentline-img">
<img t-att-src="widget.journal_icon_url(line.cashregister.journal.id)"/>
</div>
</t>
</t>
</templates>

21
pos_journal_image/views/templates.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).
-->
<openerp><data>
<template id="pos_journal_image_js" inherit_id="point_of_sale.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_journal_image/static/src/js/pos_journal_image.js"></script>
</xpath>
</template>
<template id="pos_journal_image_css" inherit_id="point_of_sale.index">
<xpath expr="//head" position="inside">
<link rel="stylesheet" href="/pos_journal_image/static/src/css/pos_journal_image.css"/>
</xpath>
</template>
</data></openerp>

19
pos_journal_image/views/view_account_journal.xml

@ -0,0 +1,19 @@
<?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).
-->
<openerp><data>
<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">
<field name="amount_authorized_diff" position="after">
<field name="pos_image" widget="image"/>
</field>
</field>
</record>
</data></openerp>
Loading…
Cancel
Save