Browse Source

[MIG] pos_journal_image: Migration to 12.0

pull/409/head
Sylvain LE GAL 5 years ago
parent
commit
c11b56a4b9
  1. 93
      pos_journal_image/README.rst
  2. 1
      pos_journal_image/__init__.py
  3. 13
      pos_journal_image/__manifest__.py
  4. 17
      pos_journal_image/demo/account_journal.xml
  5. 10
      pos_journal_image/i18n/fr.po
  6. 1
      pos_journal_image/models/__init__.py
  7. 6
      pos_journal_image/models/account_journal.py
  8. 2
      pos_journal_image/readme/CONFIGURE.rst
  9. 7
      pos_journal_image/readme/CREDITS.rst
  10. 8
      pos_journal_image/readme/DESCRIPTION.rst
  11. BIN
      pos_journal_image/static/description/account_journal_form.png
  12. BIN
      pos_journal_image/static/description/pos_payment.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. 10
      pos_journal_image/static/src/js/pos_journal_image.js
  19. 21
      pos_journal_image/static/src/xml/pos_journal_image.xml
  20. 13
      pos_journal_image/views/templates.xml
  21. 12
      pos_journal_image/views/view_account_journal.xml

93
pos_journal_image/README.rst

@ -1,93 +0,0 @@
=============================
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.

1
pos_journal_image/__init__.py

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

13
pos_journal_image/__openerp__.py → pos_journal_image/__manifest__.py

@ -1,23 +1,20 @@
# 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",
"version": "12.0.1.0.0",
"category": "Point of Sale",
"author": "GRAP",
"website": "http://www.grap.coop",
"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"],
"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",
"static/description/pos_payment.png",
],
"installable": False,
"installable": True,
}

17
pos_journal_image/demo/account_journal.xml

@ -1,17 +0,0 @@
<?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>

10
pos_journal_image/i18n/fr.po

@ -1,13 +1,13 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_journal_image
# * pos_journal_image
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Project-Id-Version: Odoo Server 12.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"
"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"
@ -21,7 +21,7 @@ msgid "Journal"
msgstr "Journal"
#. module: pos_journal_image
#: field:account.journal,pos_image:0
#: 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

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

6
pos_journal_image/models/account_journal.py

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

2
pos_journal_image/readme/CONFIGURE.rst

@ -1,6 +1,6 @@
To configure this module, you need to:
* Go to 'Invoicing' / 'Configuration' / 'Journals' / 'Journals'
* Go to 'Point Of Sale' / 'Configuration' / 'Payment Methods'
* Select journals available in the PoS

7
pos_journal_image/readme/CREDITS.rst

@ -1,7 +0,0 @@
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

8
pos_journal_image/readme/DESCRIPTION.rst

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

BIN
pos_journal_image/static/description/account_journal_form.png

Before

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

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

BIN
pos_journal_image/static/description/pos_payment_list_image.png

Before

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

BIN
pos_journal_image/static/description/pos_paypad_image.png

Before

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

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

Before

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

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

Before

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

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

@ -1,38 +1,6 @@
/*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{
.paymentmethods img.journal-image{
max-width: 50px;
max-height: 50px;
margin-right: 20px;
vertical-align: middle;
}

10
pos_journal_image/static/src/js/pos_journal_image.js

@ -4,15 +4,15 @@ Copyright (C) 2019-Today GRAP (http://www.grap.coop)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
"use strict";
odoo.define('pos_journal_image.pos_journal_image', function (require) {
"use strict";
openerp.pos_journal_image = function(instance){
var module = instance.point_of_sale;
var PosBaseWidget = require('point_of_sale.BaseWidget');
module.PosBaseWidget.include({
PosBaseWidget.include({
journal_icon_url: function(id){
return '/web/binary/image?model=account.journal&id=' + id + '&field=pos_image';
},
});
};
});

21
pos_journal_image/static/src/xml/pos_journal_image.xml

@ -6,25 +6,12 @@ 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-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>
<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>

13
pos_journal_image/views/templates.xml

@ -4,18 +4,13 @@ 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>
<odoo>
<template id="pos_journal_image_js" inherit_id="point_of_sale.assets_backend">
<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"></script>
</xpath>
</template>
<template id="pos_journal_image_css" inherit_id="point_of_sale.index">
<xpath expr="//head" 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>
</data></openerp>
</odoo>

12
pos_journal_image/views/view_account_journal.xml

@ -4,16 +4,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).
-->
<openerp><data>
<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">
<field name="amount_authorized_diff" position="after">
<field name="pos_image" widget="image"/>
</field>
<xpath expr="//group[@name='amount_authorized']" position="after">
<group>
<field name="pos_image" widget="image" class="oe_avatar"/>
</group>
</xpath>
</field>
</record>
</data></openerp>
</odoo>
Loading…
Cancel
Save