Compare commits
12 commits
Author | SHA1 | Date | |
---|---|---|---|
cb788d4a45 | |||
938b123d88 | |||
54cdb9c907 | |||
35f5712918 | |||
459d99a7c3 | |||
663479e4a2 | |||
f9efd08ff5 | |||
5cd63e80ac | |||
a796e31f22 | |||
6e42b9c38c | |||
3b0d37a0ac | |||
3d189d87a1 |
|
@ -1,165 +0,0 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
|
@ -1,3 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from . import models
|
||||
from . import controllers
|
|
@ -1,35 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016, 2019 Openworx
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
{
|
||||
"name": "Obook Openworx Material Backend Theme V12",
|
||||
"summary": "Oboo Openworx Material Backend Theme V12 ",
|
||||
"version": "12.0.0.3",
|
||||
"category": "Theme/Backend",
|
||||
"website": "http://www.openworx.nl",
|
||||
"description": """
|
||||
Obook Openworx Material Backend theme for Odoo 12.0 community edition.
|
||||
""",
|
||||
'images':[
|
||||
'images/screen.png'
|
||||
],
|
||||
"author": "Openworx",
|
||||
"license": "LGPL-3",
|
||||
"installable": True,
|
||||
"depends": [
|
||||
'web',
|
||||
'web_responsive',
|
||||
|
||||
],
|
||||
"data": [
|
||||
'views/assets.xml',
|
||||
'views/res_company_view.xml',
|
||||
'views/users.xml',
|
||||
'views/sidebar.xml',
|
||||
#'views/web.xml',
|
||||
],
|
||||
'live_test_url': 'https://youtu.be/JX-ntw2ORl8'
|
||||
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016, 2019 Openworx
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
{
|
||||
"name": "Openworx Material Backend Theme V12",
|
||||
"summary": "Openworx Material Backend Theme V12 ",
|
||||
"version": "12.0.0.3",
|
||||
"category": "Theme/Backend",
|
||||
"website": "http://www.openworx.nl",
|
||||
"description": """
|
||||
Openworx Material Backend theme for Odoo 12.0 community edition.
|
||||
""",
|
||||
'images':[
|
||||
'images/screen.png'
|
||||
],
|
||||
"author": "Openworx",
|
||||
"license": "LGPL-3",
|
||||
"installable": True,
|
||||
"depends": [
|
||||
'web',
|
||||
'web_responsive',
|
||||
|
||||
],
|
||||
"data": [
|
||||
'views/assets.xml',
|
||||
'views/res_company_view.xml',
|
||||
'views/users.xml',
|
||||
'views/sidebar.xml',
|
||||
#'views/web.xml',
|
||||
],
|
||||
'live_test_url': 'https://youtu.be/JX-ntw2ORl8'
|
||||
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from . import main
|
|
@ -1,23 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016, 2019 Openworx
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
import base64
|
||||
from odoo.http import Controller, request, route
|
||||
from werkzeug.utils import redirect
|
||||
|
||||
DEFAULT_IMAGE = '/backend_theme_v12/static/src/img/material-background.jpg'
|
||||
|
||||
class DasboardBackground(Controller):
|
||||
|
||||
@route(['/dashboard'], type='http', auth='user', website=False)
|
||||
def dashboard(self, **post):
|
||||
user = request.env.user
|
||||
company = user.company_id
|
||||
if company.dashboard_background:
|
||||
image = base64.b64decode(company.dashboard_background)
|
||||
else:
|
||||
return redirect(DEFAULT_IMAGE)
|
||||
|
||||
return request.make_response(
|
||||
image, [('Content-Type', 'image')])
|
Before Width: | Height: | Size: 191 KiB |
|
@ -1,3 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from . import res_company
|
||||
from . import res_users
|
|
@ -1,11 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016, 2019 Openworx
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
class ResCompany(models.Model):
|
||||
|
||||
_inherit = 'res.company'
|
||||
|
||||
dashboard_background = fields.Binary(attachment=True)
|
|
@ -1,25 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016, 2019 Openworx
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
class ResUsers(models.Model):
|
||||
|
||||
_inherit = 'res.users'
|
||||
|
||||
sidebar_visible = fields.Boolean("Show App Sidebar", default=True)
|
||||
|
||||
def __init__(self, pool, cr):
|
||||
""" Override of __init__ to add access rights on notification_email_send
|
||||
and alias fields. Access rights are disabled by default, but allowed
|
||||
on some specific fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
|
||||
"""
|
||||
init_res = super(ResUsers, self).__init__(pool, cr)
|
||||
# duplicate list to avoid modifying the original reference
|
||||
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
|
||||
type(self).SELF_WRITEABLE_FIELDS.extend(['sidebar_visible'])
|
||||
# duplicate list to avoid modifying the original reference
|
||||
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
|
||||
type(self).SELF_READABLE_FIELDS.extend(['sidebar_visible'])
|
||||
return init_res
|
Before Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 295 KiB |
Before Width: | Height: | Size: 14 KiB |
|
@ -1,51 +0,0 @@
|
|||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h1 class="oe_slogan" style="color:#337ab7;">Openworx Material Backend Theme</h1>
|
||||
<h2 class="oe_slogan">The first Odoo 12.0 community backend theme</h2>
|
||||
<div class="oe_screenshot" style="text-align: center;">
|
||||
<h3 class="oe_slogan" style="color:#337ab7;">Enterprise look'n'feel and App Sidebar</h3>
|
||||
<img style="max-width: 100%;" src="sidebar.png"/><br><br>
|
||||
<h3 class="oe_slogan" style="color:#337ab7;">App Dashboard</h3>
|
||||
<img style="max-width: 100%;" src="desktop.png"/><br><br>
|
||||
<h3 class="oe_slogan" style="color:#337ab7;">Quick search in App Dashboard</h3>
|
||||
<img style="max-width: 100%;" src="search.png"/><br><br>
|
||||
<h3 class="oe_slogan" style="color:#337ab7;">Side Chatter on widescreen</h3>
|
||||
<img style="max-width: 100%;" src="crm.png"/><br><br>
|
||||
<h3 class="oe_slogan" style="color:#337ab7;">Fully responsive</h3>
|
||||
<img style="max-width: 100%;" src="crm_mobile.png"/><br><br>
|
||||
<img style="max-width: 100%;" src="mobile.png"/><br><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_separator">
|
||||
</section>
|
||||
|
||||
<section class="oe_container" style="background-color:#E8E8E8; padding:20px 0px 90px 0px">
|
||||
<div class="oe_row">
|
||||
<div class="oe_span12">
|
||||
<div class="oe_centeralign">
|
||||
<p>Remark: It is possible that the Odoo service needs to be restarted after install.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_separator">
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<div class="oe_span12 oe_centeralign">
|
||||
<br/>
|
||||
<h3>Help & Support</h3>
|
||||
<br/>
|
||||
Website: <a href="https://www.openworx.nl" target="_blank">Openworx</a><br/>
|
||||
Contact: <a href="mailto:info@openworx.nl" subject="Material Backend Theme v12">Email Support</a><br/>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
Before Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 321 KiB |
Before Width: | Height: | Size: 275 KiB |
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
|
||||
<g>
|
||||
<path fill="#666766" d="M12.385,5.578L7.65,10.313l-0.89,0.888c-0.119,0.119-0.281,0.184-0.444,0.184
|
||||
c-0.162,0-0.328-0.064-0.445-0.184l-0.89-0.888L2.615,7.944C2.497,7.828,2.432,7.664,2.432,7.5c0-0.163,0.065-0.325,0.183-0.444
|
||||
l0.89-0.89c0.118-0.117,0.281-0.183,0.444-0.183c0.164,0,0.327,0.065,0.445,0.183l1.923,1.929l4.289-4.296
|
||||
c0.119-0.118,0.282-0.183,0.445-0.183c0.164,0,0.327,0.065,0.445,0.183l0.889,0.89c0.118,0.118,0.184,0.281,0.184,0.445
|
||||
C12.568,5.296,12.503,5.46,12.385,5.578z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 975 B |
Before Width: | Height: | Size: 45 KiB |
|
@ -1,25 +0,0 @@
|
|||
/* Copyright 2017 Openworx.
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
odoo.define('backend_theme_v12.sidebar-toggle', function (require) {
|
||||
"use strict";
|
||||
|
||||
var session = require('web.session');
|
||||
var rpc = require('web.rpc');
|
||||
var id = session.uid;
|
||||
rpc.query({
|
||||
model: 'res.users',
|
||||
method: 'read',
|
||||
args: [[id], ['sidebar_visible']],
|
||||
}).then(function(res) {
|
||||
var dbfield = res[0];
|
||||
var toggle = dbfield.sidebar_visible;
|
||||
if (toggle === true) {
|
||||
$("#app-sidebar").removeClass("toggle-sidebar");
|
||||
} else {
|
||||
$("#app-sidebar").addClass("toggle-sidebar");
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
/* Copyright 2016, 2019 Openworx.
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
// Check if debug mode is active and then add debug into URL when clicking on the App sidebar
|
||||
odoo.define('backend_theme_v12.Sidebar', function(require) {
|
||||
"use strict";
|
||||
var core = require('web.core');
|
||||
var session = require('web.session');
|
||||
var Widget = require('web.Widget');
|
||||
$(function() {
|
||||
(function($) {
|
||||
$.addDebug = function(url) {
|
||||
url = url.replace(/(.{4})/, "$1?debug");
|
||||
return url;
|
||||
}
|
||||
$.addDebugWithAssets = function(url) {
|
||||
url = url.replace(/(.{4})/, "$1?debug=assets");
|
||||
return url;
|
||||
}
|
||||
$.delDebug = function(url) {
|
||||
var str = url.match(/web(\S*)#/);
|
||||
url = url.replace("str/g", "");
|
||||
return url;
|
||||
}
|
||||
}) (jQuery);
|
||||
$("#sidebar a").each(function() {
|
||||
var url = $(this).attr('href');
|
||||
if (session.debug == 1) $(this).attr('href', $.addDebug(url));
|
||||
if (session.debug == 'assets') $(this).attr('href', $.addDebugWithAssets(url));
|
||||
if (session.debug == false) $(this).attr('href', $.delDebug(url));
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,69 +0,0 @@
|
|||
/* Copyright 2016, 2018 Openworx.
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
/* App Sidebar Panel */
|
||||
|
||||
$odoo-sidebar-width: 180px;
|
||||
|
||||
.app-sidebar-panel {
|
||||
flex: 0 0 $odoo-sidebar-width;
|
||||
background-color: $gray-base;
|
||||
height: 100% !important;
|
||||
overflow-y: auto;
|
||||
@media (max-width: 768px) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* @media (min-width: 768px) {
|
||||
.o_menu_apps {
|
||||
display: none !important;
|
||||
}
|
||||
} */
|
||||
|
||||
//.app-sidebar-panel:hover {
|
||||
// @include o-flex(0, 0, $odoo-sidebar-width);
|
||||
//}
|
||||
|
||||
.app-sidebar {
|
||||
white-space: nowrap;
|
||||
padding: 0;
|
||||
.app-sidebar-menu {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
>li {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0px;
|
||||
>a {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
border: 0px;
|
||||
padding: 8px 15px;
|
||||
text-decoration: none;
|
||||
font-size: 13px;
|
||||
font-weight: 300;
|
||||
color: $gray-lighter;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
> li:hover > a{
|
||||
background: darken(#0099ff, 15%);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.app-sidebar-menuitem {
|
||||
width: 23px;
|
||||
height: 22px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.toggle-sidebar {
|
||||
margin-left: 0px - $odoo-sidebar-width;
|
||||
}
|
|
@ -1,492 +0,0 @@
|
|||
/* Copyright 2016, 2019 Openworx.
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
|
||||
@font-face {
|
||||
font-family: Roboto;
|
||||
src: url(/backend_theme_v12/static/src/font/Roboto-Regular.ttf)
|
||||
}
|
||||
|
||||
|
||||
$gray-base: #000;
|
||||
$gray-darker: lighten($gray-base, 13.5%);
|
||||
$gray-dark: #666;
|
||||
$gray: #777;
|
||||
$gray-light: #AEA79F;
|
||||
$gray-lighter: lighten($gray-base, 93.5%);
|
||||
|
||||
|
||||
// Change colors here
|
||||
|
||||
// Odoo EE colors
|
||||
//$brand-primary: #875a7b;
|
||||
//$brand-secondary: #00A09D;
|
||||
//------------------------
|
||||
$brand-primary: #008DCA;
|
||||
$brand-secondary: #5EC269;
|
||||
//------------------------
|
||||
|
||||
|
||||
$brand-primary-dark: darken($brand-primary, 10%);
|
||||
$brand-secondary-dark: darken($brand-secondary, 10%);
|
||||
|
||||
body {
|
||||
|
||||
font-family: "Roboto";
|
||||
}
|
||||
|
||||
.o_loading {
|
||||
background-color: $brand-primary;
|
||||
}
|
||||
|
||||
.o_main_navbar {
|
||||
background-color : $brand-primary;
|
||||
}
|
||||
|
||||
.o_main_navbar > a:hover, .o_main_navbar > a:focus, .o_main_navbar > button:hover, .o_main_navbar > button:focus {
|
||||
|
||||
background-color: $brand-primary-dark;
|
||||
color: inherit;
|
||||
|
||||
}
|
||||
|
||||
.o_main_navbar > ul > li > a:hover, .o_main_navbar > ul > li > label:hover {
|
||||
background-color: $brand-primary-dark;
|
||||
}
|
||||
|
||||
.o_main_navbar .show .dropdown-toggle {
|
||||
|
||||
background-color: $brand-primary-dark;
|
||||
|
||||
}
|
||||
|
||||
// Fix color Add file button
|
||||
.o_control_panel .o_cp_sidebar .o_hidden_input_file .o_form_binary_form span {
|
||||
color: $gray-dark !important;
|
||||
}
|
||||
|
||||
// Buttons
|
||||
|
||||
.btn {
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
|
||||
color: #fff;
|
||||
background-color: $brand-secondary;
|
||||
border-color: $brand-secondary;
|
||||
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
|
||||
color: #fff;
|
||||
background-color: $brand-secondary-dark;
|
||||
border-color: $brand-secondary-dark;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn:active, .btn.active {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background-color: #eee !important;
|
||||
}
|
||||
|
||||
.btn-group.open .dropdown-toggle {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background-color: #eee !important;
|
||||
}
|
||||
|
||||
|
||||
.btn-link {
|
||||
color: $brand-secondary;
|
||||
}
|
||||
|
||||
.o_form_view .o_form_statusbar > .o_statusbar_status > .o_arrow_button.btn-primary.disabled {
|
||||
color: $brand-primary;
|
||||
}
|
||||
|
||||
.o_form_view .o_form_statusbar > .o_statusbar_status > .o_arrow_button:not(.disabled):hover {
|
||||
color: $brand-primary;
|
||||
}
|
||||
|
||||
.o_dropdown_toggler_btn, .o_dropdown_toggler_btn:hover, .o_dropdown_toggler_btn:focus, .o_dropdown_toggler_btn:hover, .o_dropdown_toggler_btn:focus, .btn-icon, .o_graph_button {
|
||||
text-transform: none !important;
|
||||
color: $gray-dark !important;
|
||||
background-color: transparent !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
oe_highlight {
|
||||
color: #ffffff !important;
|
||||
background-color: $brand-primary !important;
|
||||
}
|
||||
|
||||
.o_external_button {
|
||||
color: $brand-primary !important;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.o_button_icon {
|
||||
color: $brand-primary !important;
|
||||
}
|
||||
|
||||
|
||||
// Calendar
|
||||
|
||||
.o_calendar_container .o_calendar_sidebar_container .ui-datepicker table .ui-state-active {
|
||||
background: none;
|
||||
background-color: $brand-primary !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
.o_calendar_container .o_calendar_sidebar_container .ui-datepicker table .ui-state-default {
|
||||
color: $brand-primary;
|
||||
}
|
||||
|
||||
.datepicker {
|
||||
.table-sm {
|
||||
> thead {
|
||||
color: white;
|
||||
background-color: $brand-primary;
|
||||
|
||||
> tr {
|
||||
&:first-child {
|
||||
th:hover {
|
||||
color: white;
|
||||
background-color: darken($brand-primary, 10%);
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
color: $o-datepicker-week-color;
|
||||
background-color: $o-datepicker-week-bg-color;
|
||||
}
|
||||
> th {
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> tbody {
|
||||
> tr {
|
||||
> td {
|
||||
&.active, .active {
|
||||
background-color: $o-brand-primary;
|
||||
border-radius: 100px;
|
||||
}
|
||||
|
||||
&.today:before {
|
||||
border-bottom-color: $o-brand-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.datepicker .table-sm > tbody > tr > td.active, .datepicker .table-sm > tbody > tr > td .active {
|
||||
background-color: $brand-primary;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
// Filter search label
|
||||
|
||||
.o_searchview {
|
||||
.o_searchview_facet {
|
||||
|
||||
background-color: #ffffff;
|
||||
|
||||
.o_searchview_facet_label {
|
||||
background-color: $brand-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
|
||||
color: $brand-secondary;
|
||||
text-decoration: none;
|
||||
background-color: transparent;
|
||||
-webkit-text-decoration-skip: objects;
|
||||
|
||||
}
|
||||
|
||||
a:hover {
|
||||
|
||||
color: $brand-secondary-dark;
|
||||
text-decoration: none;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.o_control_panel {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
// Input
|
||||
|
||||
input[type="text"], input[type="password"], input[type="number"],
|
||||
textarea, select, .o_form_view.o_form_editable .o_form_field_many2manytags,
|
||||
.o_searchview
|
||||
{
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.o_web_client input:focus, .o_web_client textarea:focus, .o_web_client select:focus {
|
||||
outline: none;
|
||||
border-bottom: 2px solid $brand-primary;
|
||||
}
|
||||
|
||||
.o_input {
|
||||
border: 1px solid #ccc;
|
||||
border-top-style: none;
|
||||
border-right-style: none;
|
||||
border-left-style: none;
|
||||
color: $gray;
|
||||
}
|
||||
|
||||
.o_field_widget {
|
||||
&.o_field_many2one .o_external_button {
|
||||
color: $brand-secondary
|
||||
}
|
||||
}
|
||||
|
||||
.o_required_modifier {
|
||||
&.o_input, .o_input {
|
||||
background-color: lighten($brand-primary, 35%) ! important;
|
||||
}
|
||||
}
|
||||
|
||||
.input-group-text {
|
||||
background-color: transparent;
|
||||
color: #fff;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
// Listview
|
||||
|
||||
.o_list_view.table {
|
||||
border: none;
|
||||
}
|
||||
.o_list_view.table thead, .o_list_view.table tfoot, .o_list_view.table td,.o_list_view.table th {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.o_list_view.table thead {
|
||||
background-color: #e2e2e0;
|
||||
}
|
||||
|
||||
.o_list_view.table thead > tr > th.o_column_sortable:hover {
|
||||
background-color: #D6D6D3;
|
||||
}
|
||||
|
||||
.o_list_view.table tbody tr.o_group_header {
|
||||
background-color: #dfdfdf;
|
||||
background-image: none;
|
||||
border-top: 1px solid #e2e2e0;
|
||||
}
|
||||
|
||||
.table-striped > tbody > tr:nth-of-type(2n+1) {
|
||||
background-color: #eef0f0;
|
||||
}
|
||||
|
||||
.o_list_view tfoot tr:nth-child(1) td {
|
||||
background-color: $brand-primary !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
|
||||
.ui-autocomplete .ui-menu-item.ui-state-focus {
|
||||
background-color: #dee2e6;
|
||||
}
|
||||
|
||||
.ui-menu-item a:hover,.ui-menu-item a:focus {
|
||||
color: #666666 !important;
|
||||
}
|
||||
.ui-autocomplete .ui-menu-item.ui-state-focus a{
|
||||
color: #666666 !important;
|
||||
}
|
||||
|
||||
.o_form_view .oe_button_box .oe_stat_button .o_stat_info .o_stat_value {
|
||||
color: $brand-primary;
|
||||
}
|
||||
|
||||
.o_form_view .o_horizontal_separator {
|
||||
color: #666666;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
// Forms
|
||||
|
||||
.o_form_view {
|
||||
|
||||
.o_form_sheet_bg {
|
||||
background: none !important;
|
||||
background-color: #F9F9F9 !important;
|
||||
padding: 0px;
|
||||
.o_form_sheet {
|
||||
border: 1px solid #d9d7d7;
|
||||
box-shadow: 0 5px 20px -15px black;
|
||||
}
|
||||
}
|
||||
|
||||
.o_form_statusbar {
|
||||
//margin: -16px;
|
||||
|
||||
.o_statusbar_status {
|
||||
> .o_arrow_button {
|
||||
background: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// App Dashboard
|
||||
|
||||
/* .o_menu_apps .dropdown-menu.show {
|
||||
background: transparent url('/dashboard') no-repeat scroll center center / cover;
|
||||
|
||||
} */
|
||||
|
||||
.o_menu_apps .dropdown-menu.show {
|
||||
background: url(/dashboard);
|
||||
background-origin: border-box;
|
||||
background-size: cover;
|
||||
height: calc(100vh);
|
||||
max-height: calc(100vh);
|
||||
border-top: $o-navbar-height solid transparent;
|
||||
top: 0 !important;
|
||||
}
|
||||
|
||||
.o_main_navbar > ul.o_menu_systray {
|
||||
float: right;
|
||||
position: relative;
|
||||
z-index: 200;
|
||||
}
|
||||
|
||||
.fa-th-large::before {
|
||||
content: "\f00a";
|
||||
}
|
||||
|
||||
.o_menu_apps .full {
|
||||
width: 46px;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
z-index: 200;
|
||||
}
|
||||
|
||||
.o-app-name {
|
||||
color: #fff;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
.o_menu_apps .dropdown-menu.show .o-app-icon {
|
||||
padding: 20px 0 0;
|
||||
}
|
||||
|
||||
.o_menu_apps .dropdown-menu.show .o-app-icon:hover {
|
||||
box-shadow: 0 8px 15px -10px black;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.dropdown-item.o_app {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.o-menu-search-result {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
// Chat window
|
||||
|
||||
.o_thread_window .o_thread_window_header {
|
||||
background-color: $brand-primary;
|
||||
}
|
||||
|
||||
// Formview
|
||||
|
||||
|
||||
$gray-lighter-darker: #d9d7d7;
|
||||
$o-statbutton-height: 40px;
|
||||
$o-statbutton-spacing: 6px;
|
||||
|
||||
.o_form_view {
|
||||
@mixin o-form-sheet-negative-margin() {
|
||||
margin-left: -$o-horizontal-padding;
|
||||
margin-right: -$o-horizontal-padding;
|
||||
margin-top: -#{$o-horizontal-padding +1};
|
||||
}
|
||||
|
||||
.o_form_uri {
|
||||
display: inline-block;
|
||||
|
||||
color: $gray;
|
||||
|
||||
&:first-line {
|
||||
color: $link-color;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: darken($link-color, 15%); // hack required on chrome
|
||||
|
||||
&:first-line {
|
||||
color: darken($link-color, 15%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.oe_avatar {
|
||||
float: right;
|
||||
|
||||
>img {
|
||||
max-height: 90px;
|
||||
max-width: 90px;
|
||||
margin-bottom: 10px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
||||
border: none;
|
||||
}
|
||||
|
||||
+.oe_title {
|
||||
padding-right: 0px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Override `@include media-breakpoint-up` in module `web_responsive`
|
||||
@include media-breakpoint-up(md) {
|
||||
.o_form_view .oe_button_box + .oe_avatar + .oe_title {
|
||||
/* Add 110px in the calculation for the avatar space */
|
||||
width: calc(100% - 400px - 110px);
|
||||
min-width: 400px;
|
||||
max-width: 650px;
|
||||
}
|
||||
/* Same correction for res.users .oe_title div */
|
||||
.o_form_view .o_field_integer + .oe_button_box + .o_form_header + .o_field_boolean +
|
||||
.o_form_header + .oe_avatar + .oe_title {
|
||||
width: calc(100% - 400px - 110px);
|
||||
min-width: 400px;
|
||||
max-width: 650px;
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright 2016, 2019 Openworx.
|
||||
@author Mario Gielissen <mario@openworx.nl>
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="assets_backend" name="Openworx Backend Theme" inherit_id="web.assets_backend">
|
||||
<xpath expr=".">
|
||||
<link rel="stylesheet" href="/backend_theme_v12/static/src/scss/style.scss"/>
|
||||
<link rel="stylesheet" href="/backend_theme_v12/static/src/scss/sidebar.scss"/>
|
||||
<script type="application/javascript" src="/backend_theme_v12/static/src/js/sidebar.js"/>
|
||||
<script type="application/javascript" src="/backend_theme_v12/static/src/js/sidebar-toggle.js"/>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
</odoo>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="res_company_form" model="ir.ui.view">
|
||||
<field name="name">res.company.form</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook" position="inside">
|
||||
<page name="background" string="Apps Dashboard">
|
||||
<group name="dashboard_settings">
|
||||
<field name="dashboard_background" widget="image" class="oe_avatar"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
|
@ -1,35 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright 2016, 2019 Openworx.
|
||||
@author Mario Gielissen <mario@openworx.nl>
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<template id="app_sidebar" inherit_id="web.webclient_bootstrap" name="Apps Sidebar">
|
||||
<xpath expr="//div[hasclass('o_main')]//main[hasclass('o_main_content')]" position="before">
|
||||
<div id="app-sidebar" class="app-sidebar-panel">
|
||||
<!-- <div class="app-sidebar navbar-collapse collapse"> -->
|
||||
<div class="app-sidebar">
|
||||
<ul id="sidebar" class="app-sidebar-menu">
|
||||
<li class="nav-item" t-as="menu" t-foreach="menu_data['children']" >
|
||||
<t t-set="debug_param" t-value="''"/>
|
||||
<a t-att-href="'/web%s#menu_id=%s&action=' % (debug_param, menu['id'])"
|
||||
t-att-class="'nav-link nav-toggle' if menu.get('children') else 'nav-link '"
|
||||
t-att-data-menu="menu['id']"
|
||||
t-att-data-menu-xmlid="menu.get('xmlid')"
|
||||
t-att-data-action-model="menu['action'] and menu['action'].split(',')[0] or None"
|
||||
t-att-data-action-id="menu['action'] and menu['action'].split(',')[1] or None">
|
||||
<img t-attf-src="/web/image/ir.ui.menu/{{ menu['id'] }}/web_icon_data" t-att-alt="menu['name']" class="app-sidebar-menuitem" t-att-title="menu['name']"/>
|
||||
<span class="title" >
|
||||
<t t-esc="menu['name']"/>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="res_users_preferences" model="ir.ui.view">
|
||||
<field name="name">res.users.preferences</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[last()]" position="after">
|
||||
<group name="App Sidebar">
|
||||
<field name="sidebar_visible" readonly="0"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<template id="menu" inherit_id="web_responsive.apps">
|
||||
<!-- <xpath expr="//div[hasclass('panel-heading')]"
|
||||
position="replace" /> -->
|
||||
|
||||
<xpath expr="//div[hasclass('dropdown-menu')]" position="after">
|
||||
<div class="panel-footer" id="appDrawerAppPanelFooter">
|
||||
<div class="oe_logo">
|
||||
<img src="/web/binary/company_logo" />
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- <template id="webclient_bootstrap"
|
||||
inherit_id="web_responsive.webclient_bootstrap">
|
||||
<xpath expr="//i[hasclass('fa-th')]" position="after">
|
||||
<i class="fa fa-lg fa-chevron-left app-drawer-icon-close"
|
||||
t-translation="off" aria-hidden="true" />
|
||||
</xpath>
|
||||
</template> -->
|
||||
|
||||
</odoo>
|
|
@ -1,125 +0,0 @@
|
|||
====================================
|
||||
Add custom filters for fields via UI
|
||||
====================================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! 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-OCA%2Fserver--ux-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/server-ux/tree/12.0/base_search_custom_field_filter
|
||||
:alt: OCA/server-ux
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-base_search_custom_field_filter
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/250/12.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module allows to define custom filters in the search views for an specific
|
||||
field belonging to the document or any other related document.
|
||||
|
||||
This nature makes the definition quite technical, but once done, it adds the
|
||||
element in the UI for regular user use.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
#. Go to *Settings > Technical > User Interface > Custom Field Filters*.
|
||||
#. Create a new record, and define following information:
|
||||
|
||||
* The **Model** for which you are defining the filter. It will appear in all
|
||||
the search views of this model.
|
||||
* The label you want to see on the search line on the **Name** field. This
|
||||
field allows translations for proper UI in different languages.
|
||||
* The **Expression**, which is the field chain string with dot notation.
|
||||
Examples: `product_id`, `product_id.seller_ids.name`, `partner_id.lang`.
|
||||
* Optionally, you can fill **Position After** for indicating after which
|
||||
existing field (technical name) the filter will appear. If empty or not
|
||||
found, the filter will be added at the end.
|
||||
#. You can reorder records for determining sorting for multiple filters for the
|
||||
same model with the arrow handle in the left part.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
#. Go to the menu entry for which you have defined the custom field filter.
|
||||
#. On the search bar, type anything.
|
||||
#. In the filter list, you will see the line for the element you have defined.
|
||||
|
||||
As demo data, a custom field filter is included for sample purposes:
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/OCA/server-ux/12.0/base_search_custom_field_filter/static/src/img/ir_ui_custom_field_filter.png
|
||||
|
||||
Steps for trying this sample:
|
||||
|
||||
#. Install `contacts` module.
|
||||
#. Go to *Contacts*.
|
||||
#. Type "english" and you'll find the filter "Language" at the end:
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/OCA/server-ux/12.0/base_search_custom_field_filter/static/src/img/contact_search.png
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/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/OCA/server-ux/issues/new?body=module:%20base_search_custom_field_filter%0Aversion:%2012.0%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
|
||||
~~~~~~~
|
||||
|
||||
* Tecnativa
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* `Tecnativa <https://www.tecnativa.com>`_:
|
||||
|
||||
* Carlos Dauden
|
||||
* Pedro M. Baeza
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
.. |maintainer-pedrobaeza| image:: https://github.com/pedrobaeza.png?size=40px
|
||||
:target: https://github.com/pedrobaeza
|
||||
:alt: pedrobaeza
|
||||
|
||||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
||||
|
||||
|maintainer-pedrobaeza|
|
||||
|
||||
This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/12.0/base_search_custom_field_filter>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@ -1,2 +0,0 @@
|
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
from . import models
|
|
@ -1,22 +0,0 @@
|
|||
# Copyright 2020 Tecnativa - Carlos Dauden
|
||||
# Copyright 2020 Tecnativa - Pedro M. Baeza
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
{
|
||||
"name": "Add custom filters for fields via UI",
|
||||
"version": "12.0.1.0.1",
|
||||
"category": "Usability",
|
||||
"website": "https://github.com/OCA/server-ux",
|
||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||
"demo": [
|
||||
"demo/demo_ir_ui_custom_field_filter.xml",
|
||||
],
|
||||
"data": [
|
||||
"security/ir.model.access.csv",
|
||||
"templates/assets.xml",
|
||||
"views/ir_ui_custom_field_filter_views.xml",
|
||||
],
|
||||
"depends": ["web"],
|
||||
"license": "AGPL-3",
|
||||
"installable": True,
|
||||
"maintainers": ["pedrobaeza"],
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
<odoo>
|
||||
|
||||
<record id="custom_field_filter_demo" model="ir.ui.custom.field.filter">
|
||||
<field name="model_id" ref="base.model_res_partner"/>
|
||||
<field name="name">Language</field>
|
||||
<field name="expression">lang</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
|
@ -1,3 +0,0 @@
|
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
from . import base
|
||||
from . import ir_ui_custom_field_filter
|
|
@ -1,64 +0,0 @@
|
|||
# Copyright 2020-2021 Tecnativa - Carlos Dauden
|
||||
# Copyright 2020 Tecnativa - Pedro M. Baeza
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import api, models
|
||||
from lxml import etree
|
||||
|
||||
|
||||
class Base(models.AbstractModel):
|
||||
_inherit = 'base'
|
||||
|
||||
@api.model
|
||||
def _add_custom_filters(self, res, custom_filters):
|
||||
arch = etree.fromstring(res['arch'])
|
||||
for custom_filter in custom_filters:
|
||||
node = False
|
||||
if custom_filter.position_after:
|
||||
node = arch.xpath(
|
||||
"//field[@name='%s']" % custom_filter.position_after)
|
||||
if not node:
|
||||
node = (arch.xpath("//field[last()]") or
|
||||
arch.xpath("//filter[last()]") or
|
||||
arch.xpath("//group[last()]"))
|
||||
if node:
|
||||
elem = etree.Element('field', {
|
||||
'name': 'ir_ui_custom_filter_%s' % custom_filter.id,
|
||||
'string': custom_filter.name,
|
||||
'custom_field_filter': custom_filter.expression,
|
||||
})
|
||||
node[0].addnext(elem)
|
||||
res['arch'] = etree.tostring(arch)
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def fields_view_get(self, view_id=None, view_type='form', toolbar=False,
|
||||
submenu=False):
|
||||
"""Inject fields field in search views."""
|
||||
res = super().fields_view_get(
|
||||
view_id=view_id, view_type=view_type, toolbar=toolbar,
|
||||
submenu=submenu)
|
||||
if view_type == 'search':
|
||||
custom_filters = self.env['ir.ui.custom.field.filter'].search(
|
||||
[("model_name", "=", res.get("model"))])
|
||||
if custom_filters:
|
||||
res = self._add_custom_filters(res, custom_filters)
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def load_views(self, views, options=None):
|
||||
"""Inject fake field definition for having custom filters available."""
|
||||
res = super(Base, self.with_context(
|
||||
custom_field_filter=True,
|
||||
)).load_views(views, options=options)
|
||||
custom_filters = self.env['ir.ui.custom.field.filter'].search(
|
||||
[("model_name", "=", self._name)])
|
||||
for custom_filter in custom_filters:
|
||||
field = custom_filter._get_related_field()
|
||||
field_name = 'ir_ui_custom_filter_%s' % custom_filter.id
|
||||
res['fields'][field_name] = field.get_description(self.env)
|
||||
# force this for avoiding to appear on the rest of the UI
|
||||
res['fields'][field_name]['selectable'] = False
|
||||
res['fields'][field_name]['sortable'] = False
|
||||
res['fields'][field_name]['store'] = False
|
||||
return res
|
|
@ -1,42 +0,0 @@
|
|||
# Copyright 2020 Tecnativa - Carlos Dauden
|
||||
# Copyright 2020 Tecnativa - Pedro M. Baeza
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import _, api, exceptions, fields, models
|
||||
|
||||
|
||||
class IrUiCustomFilter(models.Model):
|
||||
_name = "ir.ui.custom.field.filter"
|
||||
_description = "Custom UI field filter"
|
||||
_order = "model_id, sequence, id"
|
||||
|
||||
sequence = fields.Integer()
|
||||
model_id = fields.Many2one(comodel_name="ir.model", required=True)
|
||||
model_name = fields.Char(
|
||||
related="model_id.model", store=True, readonly=True, index=True,
|
||||
string="Model name",
|
||||
)
|
||||
name = fields.Char(required=True, translate=True)
|
||||
expression = fields.Char(required=True)
|
||||
position_after = fields.Char(
|
||||
help="Optional field name for putting the filter after that one. "
|
||||
"If empty or not found, it will be put at the end.",
|
||||
)
|
||||
|
||||
def _get_related_field(self):
|
||||
"""Determine the chain of fields."""
|
||||
self.ensure_one()
|
||||
related = self.expression.split('.')
|
||||
target = self.env[self.model_name]
|
||||
for name in related:
|
||||
field = target._fields[name]
|
||||
target = target[name]
|
||||
return field
|
||||
|
||||
@api.constrains('model_id', 'expression')
|
||||
def _check_expression(self):
|
||||
for record in self:
|
||||
try:
|
||||
record._get_related_field()
|
||||
except KeyError:
|
||||
raise exceptions.ValidationError(_("Incorrect expression."))
|
|
@ -1,14 +0,0 @@
|
|||
#. Go to *Settings > Technical > User Interface > Custom Field Filters*.
|
||||
#. Create a new record, and define following information:
|
||||
|
||||
* The **Model** for which you are defining the filter. It will appear in all
|
||||
the search views of this model.
|
||||
* The label you want to see on the search line on the **Name** field. This
|
||||
field allows translations for proper UI in different languages.
|
||||
* The **Expression**, which is the field chain string with dot notation.
|
||||
Examples: `product_id`, `product_id.seller_ids.name`, `partner_id.lang`.
|
||||
* Optionally, you can fill **Position After** for indicating after which
|
||||
existing field (technical name) the filter will appear. If empty or not
|
||||
found, the filter will be added at the end.
|
||||
#. You can reorder records for determining sorting for multiple filters for the
|
||||
same model with the arrow handle in the left part.
|
|
@ -1,4 +0,0 @@
|
|||
* `Tecnativa <https://www.tecnativa.com>`_:
|
||||
|
||||
* Carlos Dauden
|
||||
* Pedro M. Baeza
|
|
@ -1,5 +0,0 @@
|
|||
This module allows to define custom filters in the search views for an specific
|
||||
field belonging to the document or any other related document.
|
||||
|
||||
This nature makes the definition quite technical, but once done, it adds the
|
||||
element in the UI for regular user use.
|
|
@ -1,15 +0,0 @@
|
|||
#. Go to the menu entry for which you have defined the custom field filter.
|
||||
#. On the search bar, type anything.
|
||||
#. In the filter list, you will see the line for the element you have defined.
|
||||
|
||||
As demo data, a custom field filter is included for sample purposes:
|
||||
|
||||
.. image:: ../static/src/img/ir_ui_custom_field_filter.png
|
||||
|
||||
Steps for trying this sample:
|
||||
|
||||
#. Install `contacts` module.
|
||||
#. Go to *Contacts*.
|
||||
#. Type "english" and you'll find the filter "Language" at the end:
|
||||
|
||||
.. image:: ../static/src/img/contact_search.png
|
|
@ -1,3 +0,0 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_ir_ui_custom_field_filter_user,ir.ui.custom.field.filter,model_ir_ui_custom_field_filter,base.group_user,1,0,0,0
|
||||
access_ir_ui_custom_field_filter_system,ir.ui.custom.field.filter,model_ir_ui_custom_field_filter,base.group_system,1,1,1,1
|
|
Before Width: | Height: | Size: 9.2 KiB |
|
@ -1,467 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Add custom filters for fields via UI</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="add-custom-filters-for-fields-via-ui">
|
||||
<h1 class="title">Add custom filters for fields via UI</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-ux/tree/12.0/base_search_custom_field_filter"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-base_search_custom_field_filter"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/250/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module allows to define custom filters in the search views for an specific
|
||||
field belonging to the document or any other related document.</p>
|
||||
<p>This nature makes the definition quite technical, but once done, it adds the
|
||||
element in the UI for regular user use.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="configuration">
|
||||
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
|
||||
<ol class="arabic simple">
|
||||
<li>Go to <em>Settings > Technical > User Interface > Custom Field Filters</em>.</li>
|
||||
<li>Create a new record, and define following information:<ul>
|
||||
<li>The <strong>Model</strong> for which you are defining the filter. It will appear in all
|
||||
the search views of this model.</li>
|
||||
<li>The label you want to see on the search line on the <strong>Name</strong> field. This
|
||||
field allows translations for proper UI in different languages.</li>
|
||||
<li>The <strong>Expression</strong>, which is the field chain string with dot notation.
|
||||
Examples: <cite>product_id</cite>, <cite>product_id.seller_ids.name</cite>, <cite>partner_id.lang</cite>.</li>
|
||||
<li>Optionally, you can fill <strong>Position After</strong> for indicating after which
|
||||
existing field (technical name) the filter will appear. If empty or not
|
||||
found, the filter will be added at the end.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>You can reorder records for determining sorting for multiple filters for the
|
||||
same model with the arrow handle in the left part.</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
|
||||
<ol class="arabic simple">
|
||||
<li>Go to the menu entry for which you have defined the custom field filter.</li>
|
||||
<li>On the search bar, type anything.</li>
|
||||
<li>In the filter list, you will see the line for the element you have defined.</li>
|
||||
</ol>
|
||||
<p>As demo data, a custom field filter is included for sample purposes:</p>
|
||||
<img alt="https://raw.githubusercontent.com/OCA/server-ux/12.0/base_search_custom_field_filter/static/src/img/ir_ui_custom_field_filter.png" src="https://raw.githubusercontent.com/OCA/server-ux/12.0/base_search_custom_field_filter/static/src/img/ir_ui_custom_field_filter.png" />
|
||||
<p>Steps for trying this sample:</p>
|
||||
<ol class="arabic simple">
|
||||
<li>Install <cite>contacts</cite> module.</li>
|
||||
<li>Go to <em>Contacts</em>.</li>
|
||||
<li>Type “english” and you’ll find the filter “Language” at the end:</li>
|
||||
</ol>
|
||||
<img alt="https://raw.githubusercontent.com/OCA/server-ux/12.0/base_search_custom_field_filter/static/src/img/contact_search.png" src="https://raw.githubusercontent.com/OCA/server-ux/12.0/base_search_custom_field_filter/static/src/img/contact_search.png" />
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-ux/issues">GitHub Issues</a>.
|
||||
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
|
||||
<a class="reference external" href="https://github.com/OCA/server-ux/issues/new?body=module:%20base_search_custom_field_filter%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Tecnativa</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
|
||||
<li>Carlos Dauden</li>
|
||||
<li>Pedro M. Baeza</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
||||
<p><a class="reference external" href="https://github.com/pedrobaeza"><img alt="pedrobaeza" src="https://github.com/pedrobaeza.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-ux/tree/12.0/base_search_custom_field_filter">OCA/server-ux</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 183 KiB |
Before Width: | Height: | Size: 15 KiB |
|
@ -1,22 +0,0 @@
|
|||
odoo.define('base_search_custom_field_filter.search_inputs_related_field', function (require) {
|
||||
"use strict";
|
||||
|
||||
var core = require('web.core');
|
||||
var search_inputs = require('web.search_inputs');
|
||||
var ManyToOneField = core.search_widgets_registry.map.many2one;
|
||||
|
||||
search_inputs.Field.include({
|
||||
make_domain: function (name, operator, facetValue) {
|
||||
var name_n = this.attrs.custom_field_filter || name;
|
||||
return this._super(name_n, operator, facetValue);
|
||||
},
|
||||
});
|
||||
|
||||
ManyToOneField.include({
|
||||
make_domain: function (name, operator, facetValue) {
|
||||
var name_n = this.attrs.custom_field_filter || name;
|
||||
return this._super(name_n, operator, facetValue);
|
||||
},
|
||||
});
|
||||
|
||||
});
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<template id="assets_backend" inherit_id="web.assets_backend">
|
||||
<xpath expr=".">
|
||||
<script src="/base_search_custom_field_filter/static/src/js/search_input.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2020 Tecnativa - Pedro M. Baeza
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
|
||||
<record id="view_ir_ui_custom_field_filter_form" model="ir.ui.view">
|
||||
<field name="model">ir.ui.custom.field.filter</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom">
|
||||
<field name="sequence" widget="handle" />
|
||||
<field name="model_id" />
|
||||
<field name="name" />
|
||||
<field name="expression" />
|
||||
<field name="position_after" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window
|
||||
id="action_ir_ui_custom_field_filter"
|
||||
name="Custom Field Filters"
|
||||
res_model="ir.ui.custom.field.filter"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
id="menu_ir_ui_custom_field_filter"
|
||||
action="action_ir_ui_custom_field_filter"
|
||||
parent="base.next_id_2"
|
||||
sequence="6"
|
||||
/>
|
||||
|
||||
</odoo>
|
|
@ -1,35 +0,0 @@
|
|||
.. image:: https://itpp.dev/images/infinity-readme.png
|
||||
:alt: Tested and maintained by IT Projects Labs
|
||||
:target: https://itpp.dev
|
||||
|
||||
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
|
||||
:target: https://opensource.org/licenses/MIT
|
||||
:alt: License: MIT
|
||||
|
||||
=======================
|
||||
POS: show product qty
|
||||
=======================
|
||||
|
||||
Adds available quantity at products in POS
|
||||
|
||||
Module potentialy isn't compatible with modules that overrides `get_price` method in JS
|
||||
|
||||
Questions?
|
||||
==========
|
||||
|
||||
To get an assistance on this module contact us by email :arrow_right: help@itpp.dev
|
||||
|
||||
Contributors
|
||||
============
|
||||
* `Ivan Yelizariev <https://it-projects.info/team/yelizariev>`__
|
||||
|
||||
|
||||
Further information
|
||||
===================
|
||||
|
||||
Odoo Apps Store: https://apps.odoo.com/apps/modules/12.0/pos_product_available/
|
||||
|
||||
|
||||
Notifications on updates: `via Atom <https://github.com/it-projects-llc/pos_addons/commits/12.0/pos_product_available.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/pos_addons/commits/12.0/pos_product_available.atom>`_
|
||||
|
||||
Tested on `Odoo 12.0 <https://github.com/odoo/odoo/commit/53dcdd5a9e22429a9638f68674264436ce21e42b>`_
|
|
@ -1,3 +0,0 @@
|
|||
# License MIT (https://opensource.org/licenses/MIT).
|
||||
|
||||
from . import models
|
|
@ -1,30 +0,0 @@
|
|||
# Copyright 2014-2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
|
||||
# Copyright 2017 Gabbasov Dinar <https://it-projects.info/team/GabbasovDinar>
|
||||
# Copyright 2018-2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
|
||||
# Copyright 2018 Ildar Nasyrov <https://it-projects.info/team/iledarn>
|
||||
# License MIT (https://opensource.org/licenses/MIT).
|
||||
{
|
||||
"name": """POS: show product qty""",
|
||||
"summary": """Adds available quantity at products in POS""",
|
||||
"category": "Point Of Sale",
|
||||
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version={ODOO_BRANCH}",
|
||||
"images": ["images/pos_product_available.jpg"],
|
||||
"version": "12.0.1.1.1",
|
||||
"application": False,
|
||||
"author": "IT-Projects LLC, Ivan Yelizariev",
|
||||
"support": "apps@itpp.dev",
|
||||
"website": "https://apps.odoo.com/apps/modules/12.0/pos_product_available/",
|
||||
"license": "Other OSI approved licence", # MIT
|
||||
# "price": 9.00,
|
||||
# "currency": "EUR",
|
||||
"depends": ["point_of_sale", "stock"],
|
||||
"external_dependencies": {"python": [], "bin": []},
|
||||
"data": ["data.xml", "views/views.xml"],
|
||||
"qweb": ["static/src/xml/pos.xml"],
|
||||
"post_load": None,
|
||||
"pre_init_hook": None,
|
||||
"post_init_hook": None,
|
||||
"uninstall_hook": None,
|
||||
"auto_install": False,
|
||||
"installable": True,
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--Copyright 2014-2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
|
||||
Copyright 2018 Gabbasov Dinar <https://it-projects.info/team/GabbasovDinar>
|
||||
Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
|
||||
Copyright 2018 Ildar Nasyrov <https://it-projects.info/team/iledarn>
|
||||
License MIT (https://opensource.org/licenses/MIT). -->
|
||||
<odoo>
|
||||
<template id="assets_backend" name="pos assets" inherit_id="point_of_sale.assets">
|
||||
<xpath expr="." position="inside">
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/pos_product_available/static/src/js/pos.js"
|
||||
/>
|
||||
</xpath>
|
||||
<xpath expr="//link[@id='pos-stylesheet']" position="after">
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="/pos_product_available/static/src/css/pos.css"
|
||||
/>
|
||||
</xpath>
|
||||
</template>
|
||||
<template
|
||||
id="assets_backend_web"
|
||||
name="pos_product_available_backend_assets"
|
||||
inherit_id="web.assets_backend"
|
||||
>
|
||||
<xpath expr="." position="inside">
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/pos_product_available/static/src/js/test_pos_quantities.js"
|
||||
/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
|
@ -1,46 +0,0 @@
|
|||
`1.1.1`
|
||||
-------
|
||||
|
||||
- [FIX] product qty available wrong rounding and overrided 'get_price' method in pos.js
|
||||
|
||||
`1.1.0`
|
||||
-------
|
||||
|
||||
- **New:** Added option to show product quantities
|
||||
|
||||
`1.0.7`
|
||||
-------
|
||||
|
||||
- **Fix:** Non rounded long values of quantities
|
||||
|
||||
|
||||
`1.0.6`
|
||||
-------
|
||||
|
||||
- **FIX:** Added compatibility with pos_multi_session
|
||||
|
||||
`1.0.5`
|
||||
-------
|
||||
|
||||
- **FIX:** Product quantities representation according to the set location
|
||||
- **FIX:** Product quantities representation only for stockable products
|
||||
|
||||
`1.0.4`
|
||||
-------
|
||||
|
||||
- [FIX] incorrect products quantity numbers with pos_cache module.
|
||||
|
||||
`1.0.3`
|
||||
-------
|
||||
|
||||
- [FIX] compatibility with pos_cache module. Thanks to MindAndGo.
|
||||
|
||||
`1.0.2`
|
||||
-------
|
||||
|
||||
- [FIX] update product counter when sale via invoice
|
||||
|
||||
`1.0.1`
|
||||
-------
|
||||
|
||||
- Show quantity related to POS's stock location only.
|
|
@ -1,8 +0,0 @@
|
|||
=======================
|
||||
POS: show product qty
|
||||
=======================
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way
|
|
@ -1,47 +0,0 @@
|
|||
|
||||
<section class="oe_container"><div class="oe_row oe_spaced"> <div class="oe_span12">
|
||||
</div>
|
||||
|
||||
<div class="oe_span6">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="screenshot.png"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">
|
||||
Adds available quantity at order panel
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">
|
||||
Adds available quantity at products.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="oe_span6">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="screenshot-2.png"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2>Usage</h2>
|
||||
<p class="oe_mt32">
|
||||
There no any settings. Just install the module and start POS.
|
||||
</p>
|
||||
<p class="oe_mt32">
|
||||
Works in offline mode.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -1 +0,0 @@
|
|||
slogan: Let a cashier know how many products are available
|
|
@ -1,72 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * pos_product_available
|
||||
#
|
||||
# Translators:
|
||||
# Translation Bot <i18n-bot@it-projects.info>, 2017
|
||||
# Ermin Trevisan <trevi@twanda.com>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-04-27 23:49+0000\n"
|
||||
"PO-Revision-Date: 2018-04-27 23:49+0000\n"
|
||||
"Last-Translator: Ermin Trevisan <trevi@twanda.com>, 2018\n"
|
||||
"Language-Team: German (https://www.transifex.com/it-projects-llc/teams/76080/"
|
||||
"de/)\n"
|
||||
"Language: de\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/xml/pos.xml:21
|
||||
#, python-format
|
||||
msgid "(of"
|
||||
msgstr "(von "
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:13
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:72
|
||||
#, python-format
|
||||
msgid ""
|
||||
"<p>Click to start the point of sale interface. It <b>runs on tablets</b>, "
|
||||
"laptops, or industrial hardware.</p><p>Once the session launched, the system "
|
||||
"continues to run without an internet connection.</p>"
|
||||
msgstr ""
|
||||
"<p>Anklicken, um das POS-System zu starten. Es <b>läuft auf Tablets</b>, "
|
||||
"Laptops, oder industrieller Hardware.</p><p>Sobald eine Sitzung gestartet "
|
||||
"wurde, funktioniert das System auch ohne Internet-Verbindung.</p>"
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:48
|
||||
#, python-format
|
||||
msgid "Click the payment method"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:65
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:68
|
||||
#, python-format
|
||||
msgid "Close POS"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:42
|
||||
#, python-format
|
||||
msgid "Open the payment screen"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:87
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:92
|
||||
#, python-format
|
||||
msgid "Ready to launch your <b>point of sale</b>? <i>Click here</i>."
|
||||
msgstr "Bereit, Ihren <b>Point of Sale</b>zu starten? <i>Klicken Sie hier</i>."
|
|
@ -1,73 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * pos_product_available
|
||||
#
|
||||
# Translators:
|
||||
# charles paul requena palomino <rcharles84@gmail.com>, 2018
|
||||
# Alexandr Frrost <alexandr.frrost@gmail.com>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-04-27 23:49+0000\n"
|
||||
"PO-Revision-Date: 2018-04-27 23:49+0000\n"
|
||||
"Last-Translator: Alexandr Frrost <alexandr.frrost@gmail.com>, 2018\n"
|
||||
"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/"
|
||||
"teams/76080/es/)\n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/xml/pos.xml:21
|
||||
#, python-format
|
||||
msgid "(of"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:13
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:72
|
||||
#, python-format
|
||||
msgid ""
|
||||
"<p>Click to start the point of sale interface. It <b>runs on tablets</b>, "
|
||||
"laptops, or industrial hardware.</p><p>Once the session launched, the system "
|
||||
"continues to run without an internet connection.</p>"
|
||||
msgstr ""
|
||||
"<p>Haga clic para iniciar la interfaz del punto de venta. <b>Se ejecuta en "
|
||||
"tabletas</b>, computadoras portátiles o hardware industrial.</p><p> Una vez "
|
||||
"que se inicia la sesión, el sistema continúa ejecutándose sin conexión a "
|
||||
"Internet.</p>"
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:48
|
||||
#, python-format
|
||||
msgid "Click the payment method"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:65
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:68
|
||||
#, python-format
|
||||
msgid "Close POS"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:42
|
||||
#, python-format
|
||||
msgid "Open the payment screen"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_product_available
|
||||
#. openerp-web
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:87
|
||||
#: code:addons/pos_product_available/static/src/js/test_pos_quantities.js:92
|
||||
#, python-format
|
||||
msgid "Ready to launch your <b>point of sale</b>? <i>Click here</i>."
|
||||
msgstr "¿Listo para lanzar su <b>punto de venta</b>? <i>Haga clic aquí</i>."
|
Before Width: | Height: | Size: 241 KiB |
|
@ -1,2 +0,0 @@
|
|||
# License MIT (https://opensource.org/licenses/MIT).
|
||||
from . import models
|
|
@ -1,12 +0,0 @@
|
|||
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
|
||||
# License MIT (https://opensource.org/licenses/MIT).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class PosConfig(models.Model):
|
||||
_inherit = "pos.config"
|
||||
|
||||
show_qtys = fields.Boolean(
|
||||
"Show Product Qtys", help="Show Product Qtys in POS", default=True
|
||||
)
|
Before Width: | Height: | Size: 1.9 KiB |
|
@ -1,145 +0,0 @@
|
|||
|
||||
<section class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-1 col-md-8 mb64 mt64">
|
||||
<div class="">
|
||||
<h2 class="display-3">POS: show product qty</h2>
|
||||
<h4 class="text-default">Let a cashier know how many products are available</h4>
|
||||
<p class="text-default mt16">Version: v<b>12.0</b>.1.1.1</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 text-right">
|
||||
<p>
|
||||
<img src="https://itpp.dev/images/favicon.png"/>
|
||||
<br/>Tested and maintained by
|
||||
<br/><b>IT Projects Labs</b>
|
||||
<br/>Assitance: <a href="mailto:help@itpp.dev">help@itpp.dev</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section class="oe_container"><div class="oe_row oe_spaced"> <div class="oe_span12">
|
||||
</div>
|
||||
|
||||
<div class="oe_span6">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="screenshot.png"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">
|
||||
Adds available quantity at order panel
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">
|
||||
Adds available quantity at products.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="oe_span6">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="screenshot-2.png"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2>Usage</h2>
|
||||
<p class="oe_mt32">
|
||||
There no any settings. Just install the module and start POS.
|
||||
</p>
|
||||
<p class="oe_mt32">
|
||||
Works in offline mode.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section class="container text-center">
|
||||
<div class="mt-4 mb-3">
|
||||
<h2>Let our expertise work for you!</h2>
|
||||
<h4 class="d-none d-md-block">(Doors and windows below are clickable)</h4>
|
||||
<div class="mb32 d-md-none">
|
||||
<ul class="list-unstyled">
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/browse?repo_maintainer_id=59928">All modules</a></li>
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/browse?price=Free&order=Downloads&repo_maintainer_id=59928">Free Modules</a></li>
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/modules/category/Point%20of%20Sale/browse?repo_maintainer_id=59928">All POS modules</a></li>
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/modules/category/Discuss/browse?repo_maintainer_id=59928">All Mail modules</a></li>
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/modules/category/Website/browse?repo_maintainer_id=59928">All Website modules</a></li>
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/modules/category/eCommerce/browse?repo_maintainer_id=59928">All eCommerce modules</a></li>
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/modules/browse?search=sync+studio&repo_maintainer_id=59928">Sync Studio</a></li>
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/modules/14.0/openapi/">REST API</a></li>
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/modules/14.0/base_automation_webhook/">Webhooks</a></li>
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/modules/14.0/pos_product_available/">POS: show product qty</a></li>
|
||||
<li><a target="_blank" href="https://apps.odoo.com/apps/modules/14.0/web_login_background/">Web Login Background</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mb64 d-none d-xl-block">
|
||||
<img class="img img-responsive" src="https://itpp.dev/images/apps/;-)/itpp-labs-1100.jpg" usemap="#itpp-xl" />
|
||||
<map name="itpp-xl">
|
||||
<area alt="Free Modules" target="_blank" href="https://apps.odoo.com/apps/browse?price=Free&order=Downloads&repo_maintainer_id=59928" shape="rect" class="" coords="900,220,1080,625" />
|
||||
<area alt="Sync Studio" target="_blank" href="https://apps.odoo.com/apps/modules/browse?search=sync+studio&repo_maintainer_id=59928" shape="rect" class="" coords="552,186,721,274" />
|
||||
<area alt="REST API" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/openapi/" shape="rect" class="" coords="646,279,720,365" />
|
||||
<area alt="Webhooks" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/base_automation_webhook/" shape="rect" class="" coords="646,370,720,458" />
|
||||
<area alt="POS: show product qty" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/pos_product_available/" shape="rect" class="" coords="82,373,251,459" />
|
||||
<area alt="All modules" target="_blank" href="https://apps.odoo.com/apps/browse?repo_maintainer_id=59928" shape="rect" class="" coords="326,267,381,456" />
|
||||
<area alt="All POS modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/Point%20of%20Sale/browse?repo_maintainer_id=59928" shape="rect" class="" coords="82,191,154,276" />
|
||||
<area alt="All Mail modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/Discuss/browse?repo_maintainer_id=59928" shape="rect" class="" coords="82,282,155,368" />
|
||||
<area alt="All Website modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/Website/browse?repo_maintainer_id=59928" shape="rect" class="" coords="176,282,250,368" />
|
||||
<area alt="All eCommerce modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/eCommerce/browse?repo_maintainer_id=59928" shape="rect" class="" coords="175,189,250,275" />
|
||||
<area alt="Ivan Yelizariev" target="_blank" href="https://apps.odoo.com/apps/modules/browse?search=Ivan+Yelizariev&repo_maintainer_id=59928" shape="rect" class="" coords="554,280,625,456" />
|
||||
<area alt="Web Login Background" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/web_login_background/" shape="rect" class="" coords="420,267,477,456" />
|
||||
</map>
|
||||
</div>
|
||||
<div class="mb64 d-none d-lg-block d-xl-none">
|
||||
<img class="img img-responsive" src="https://itpp.dev/images/apps/;-)/itpp-labs-930.jpg" usemap="#itpp-lg" />
|
||||
<map name="itpp-lg">
|
||||
<area alt="Free Modules" target="_blank" href="https://apps.odoo.com/apps/browse?price=Free&order=Downloads&repo_maintainer_id=59928" shape="rect" class="" coords="760,186,913,528" />
|
||||
<area alt="Sync Studio" target="_blank" href="https://apps.odoo.com/apps/modules/browse?search=sync+studio&repo_maintainer_id=59928" shape="rect" class="" coords="466,157,609,231" />
|
||||
<area alt="REST API" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/openapi/" shape="rect" class="" coords="546,235,608,308" />
|
||||
<area alt="Webhooks" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/base_automation_webhook/" shape="rect" class="" coords="546,312,608,387" />
|
||||
<area alt="POS: show product qty" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/pos_product_available/" shape="rect" class="" coords="69,315,212,388" />
|
||||
<area alt="All modules" target="_blank" href="https://apps.odoo.com/apps/browse?repo_maintainer_id=59928" shape="rect" class="" coords="275,225,322,385" />
|
||||
<area alt="All POS modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/Point%20of%20Sale/browse?repo_maintainer_id=59928" shape="rect" class="" coords="69,161,130,233" />
|
||||
<area alt="All Mail modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/Discuss/browse?repo_maintainer_id=59928" shape="rect" class="" coords="69,238,131,311" />
|
||||
<area alt="All Website modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/Website/browse?repo_maintainer_id=59928" shape="rect" class="" coords="148,238,211,311" />
|
||||
<area alt="All eCommerce modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/eCommerce/browse?repo_maintainer_id=59928" shape="rect" class="" coords="147,159,211,232" />
|
||||
<area alt="Ivan Yelizariev" target="_blank" href="https://apps.odoo.com/apps/modules/browse?search=Ivan+Yelizariev&repo_maintainer_id=59928" shape="rect" class="" coords="468,236,528,385" />
|
||||
<area alt="Web Login Background" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/web_login_background/" shape="rect" class="" coords="355,225,403,385" />
|
||||
</map>
|
||||
</div>
|
||||
<div class="mb64 d-lg-none">
|
||||
<img class="img img-responsive" src="https://itpp.dev/images/apps/;-)/itpp-labs-690.jpg" usemap="#itpp-md" />
|
||||
<map name="itpp-md">
|
||||
<area alt="Free Modules" target="_blank" href="https://apps.odoo.com/apps/browse?price=Free&order=Downloads&repo_maintainer_id=59928" shape="rect" class="" coords="564,138,677,392" />
|
||||
<area alt="Sync Studio" target="_blank" href="https://apps.odoo.com/apps/modules/browse?search=sync+studio&repo_maintainer_id=59928" shape="rect" class="" coords="346,116,452,171" />
|
||||
<area alt="REST API" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/openapi/" shape="rect" class="" coords="405,175,451,228" />
|
||||
<area alt="Webhooks" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/base_automation_webhook/" shape="rect" class="" coords="405,232,451,287" />
|
||||
<area alt="POS: show product qty" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/pos_product_available/" shape="rect" class="" coords="51,233,157,287" />
|
||||
<area alt="All modules" target="_blank" href="https://apps.odoo.com/apps/browse?repo_maintainer_id=59928" shape="rect" class="" coords="204,167,238,286" />
|
||||
<area alt="All POS modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/Point%20of%20Sale/browse?repo_maintainer_id=59928" shape="rect" class="" coords="51,119,96,173" />
|
||||
<area alt="All Mail modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/Discuss/browse?repo_maintainer_id=59928" shape="rect" class="" coords="51,176,97,230" />
|
||||
<area alt="All Website modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/Website/browse?repo_maintainer_id=59928" shape="rect" class="" coords="110,176,156,230" />
|
||||
<area alt="All eCommerce modules" target="_blank" href="https://apps.odoo.com/apps/modules/category/eCommerce/browse?repo_maintainer_id=59928" shape="rect" class="" coords="109,118,156,172" />
|
||||
<area alt="Ivan Yelizariev" target="_blank" href="https://apps.odoo.com/apps/modules/browse?search=Ivan+Yelizariev&repo_maintainer_id=59928" shape="rect" class="" coords="347,175,392,286" />
|
||||
<area alt="Web Login Background" target="_blank" href="https://apps.odoo.com/apps/modules/14.0/web_login_background/" shape="rect" class="" coords="263,167,299,286" />
|
||||
</map>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 39 KiB |
|
@ -1,24 +0,0 @@
|
|||
.pos .product .qty-tag {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
vertical-align: top;
|
||||
color: white;
|
||||
line-height: 13px;
|
||||
background: #7f82ac;
|
||||
padding: 2px 5px;
|
||||
border-radius: 2px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.pos .product .qty-tag.not-available {
|
||||
background: #d882ac;
|
||||
}
|
||||
|
||||
.pos .order .orderline .qty-info {
|
||||
color: #777;
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
}
|
||||
.pos .order .orderline .qty-info.not-available {
|
||||
color: red;
|
||||
}
|
|
@ -1,233 +0,0 @@
|
|||
/* Copyright 2014-2017 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
|
||||
Copyright 2016 gaelTorrecillas <https://github.com/gaelTorrecillas>
|
||||
Copyright 2016 manawi <https://github.com/manawi>
|
||||
Copyright 2017 Ilmir Karamov <https://it-projects.info/team/ilmir-k>
|
||||
Copyright 2018,2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
|
||||
License MIT (https://opensource.org/licenses/MIT). */
|
||||
odoo.define("pos_product_available.PosModel", function(require) {
|
||||
"use strict";
|
||||
|
||||
var rpc = require("web.rpc");
|
||||
var models = require("point_of_sale.models");
|
||||
var field_utils = require("web.field_utils");
|
||||
|
||||
var PosModelSuper = models.PosModel.prototype;
|
||||
models.PosModel = models.PosModel.extend({
|
||||
load_server_data: function() {
|
||||
var self = this;
|
||||
|
||||
var loaded = PosModelSuper.load_server_data.call(this);
|
||||
|
||||
var prod_model = _.find(this.models, function(model) {
|
||||
return model.model === "product.product";
|
||||
});
|
||||
|
||||
if (prod_model) {
|
||||
prod_model.fields.push("qty_available", "type");
|
||||
var context_super = prod_model.context;
|
||||
prod_model.context = function(that) {
|
||||
var ret = context_super(that);
|
||||
ret.location = that.config.stock_location_id[0];
|
||||
return ret;
|
||||
};
|
||||
var loaded_super = prod_model.loaded;
|
||||
prod_model.loaded = function(that, products) {
|
||||
loaded_super(that, products);
|
||||
self.db.product_qtys = products;
|
||||
};
|
||||
return loaded;
|
||||
}
|
||||
|
||||
return loaded.then(function() {
|
||||
return rpc
|
||||
.query({
|
||||
model: "product.product",
|
||||
method: "search_read",
|
||||
args: [],
|
||||
fields: ["qty_available", "type"],
|
||||
domain: [
|
||||
["sale_ok", "=", true],
|
||||
["available_in_pos", "=", true],
|
||||
],
|
||||
context: {location: self.config.stock_location_id[0]},
|
||||
})
|
||||
.then(function(products) {
|
||||
self.db.product_qtys = products;
|
||||
});
|
||||
});
|
||||
},
|
||||
set_product_qty_available: function(product, qty) {
|
||||
product.qty_available = qty;
|
||||
this.refresh_qty_available(product);
|
||||
},
|
||||
update_product_qty_from_order_lines: function(order) {
|
||||
var self = this;
|
||||
order.orderlines.each(function(line) {
|
||||
var product = line.get_product();
|
||||
product.qty_available = Math.round(
|
||||
product.qty_available - line.get_quantity(),
|
||||
{digits: [69, 3]}
|
||||
);
|
||||
self.refresh_qty_available(product);
|
||||
});
|
||||
// Compatibility with pos_multi_session
|
||||
order.trigger("new_updates_to_send");
|
||||
},
|
||||
after_load_server_data: function() {
|
||||
var self = this;
|
||||
var res = PosModelSuper.after_load_server_data.apply(this, arguments);
|
||||
_.each(this.db.product_qtys, function(v) {
|
||||
_.extend(self.db.get_product_by_id(v.id), v);
|
||||
});
|
||||
return res;
|
||||
},
|
||||
refresh_qty_available: function(product) {
|
||||
var $elem = $("[data-product-id='" + product.id + "'] .qty-tag");
|
||||
$elem.html(product.rounded_qty());
|
||||
if (product.qty_available <= 0 && !$elem.hasClass("not-available")) {
|
||||
$elem.addClass("not-available");
|
||||
}
|
||||
},
|
||||
push_order: function(order, opts) {
|
||||
var pushed = PosModelSuper.push_order.call(this, order, opts);
|
||||
if (order) {
|
||||
this.update_product_qty_from_order_lines(order);
|
||||
}
|
||||
return pushed;
|
||||
},
|
||||
push_and_invoice_order: function(order) {
|
||||
var invoiced = PosModelSuper.push_and_invoice_order.call(this, order);
|
||||
|
||||
if (order && order.get_client() && order.orderlines) {
|
||||
this.update_product_qty_from_order_lines(order);
|
||||
}
|
||||
|
||||
return invoiced;
|
||||
},
|
||||
});
|
||||
|
||||
models.Product = models.Product.extend({
|
||||
get_price: function(pricelist, quantity) {
|
||||
var self = this;
|
||||
var date = moment().startOf("day");
|
||||
|
||||
// In case of nested pricelists, it is necessary that all pricelists are made available in
|
||||
// the POS. Display a basic alert to the user in this case.
|
||||
if (pricelist === undefined) {
|
||||
// eslint-disable-next-line
|
||||
alert(
|
||||
"An error occurred when loading product prices. " +
|
||||
"Make sure all pricelists are available in the POS."
|
||||
);
|
||||
}
|
||||
|
||||
var category_ids = [];
|
||||
var category = this.categ;
|
||||
while (category) {
|
||||
category_ids.push(category.id);
|
||||
category = category.parent;
|
||||
}
|
||||
|
||||
/*
|
||||
So, with pos_product_available it doesnt work correctly, cause
|
||||
'item.product_tmpl_id || item.product_tmpl_id[0] === self.product_tmpl_id'
|
||||
in this string are comparing integer with an array of two elements.
|
||||
Changed: 'self.product_tmpl_id -> self.product_tmpl_id[0]',
|
||||
where 'self.product_tmpl_id[0]' product template id.
|
||||
By the way, here's comparing products ids.
|
||||
IMPORTANT: Changed line - (!item.product_tmpl_id || item.product_tmpl_id[0] === self.product_tmpl_id[0]).
|
||||
*/
|
||||
var pricelist_items = _.filter(pricelist.items, function(item) {
|
||||
return (
|
||||
(!item.product_tmpl_id ||
|
||||
item.product_tmpl_id[0] === self.product_tmpl_id[0]) &&
|
||||
(!item.product_id || item.product_id[0] === self.id) &&
|
||||
(!item.categ_id || _.contains(category_ids, item.categ_id[0])) &&
|
||||
(!item.date_start ||
|
||||
moment(item.date_start).isSameOrBefore(date)) &&
|
||||
(!item.date_end || moment(item.date_end).isSameOrAfter(date))
|
||||
);
|
||||
});
|
||||
|
||||
var price = self.lst_price;
|
||||
_.find(pricelist_items, function(rule) {
|
||||
if (rule.min_quantity && quantity < rule.min_quantity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rule.base === "pricelist") {
|
||||
price = self.get_price(rule.base_pricelist, quantity);
|
||||
} else if (rule.base === "standard_price") {
|
||||
price = self.standard_price;
|
||||
}
|
||||
|
||||
if (rule.compute_price === "fixed") {
|
||||
price = rule.fixed_price;
|
||||
return true;
|
||||
} else if (rule.compute_price === "percentage") {
|
||||
price -= price * (rule.percent_price / 100);
|
||||
return true;
|
||||
}
|
||||
var price_limit = price;
|
||||
price -= price * (rule.price_discount / 100);
|
||||
if (rule.price_round) {
|
||||
// eslint-disable-next-line
|
||||
price = round_pr(price, rule.price_round);
|
||||
}
|
||||
if (rule.price_surcharge) {
|
||||
price += rule.price_surcharge;
|
||||
}
|
||||
if (rule.price_min_margin) {
|
||||
price = Math.max(price, price_limit + rule.price_min_margin);
|
||||
}
|
||||
if (rule.price_max_margin) {
|
||||
price = Math.min(price, price_limit + rule.price_max_margin);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
// This return value has to be rounded with round_di before
|
||||
// being used further. Note that this cannot happen here,
|
||||
// because it would cause inconsistencies with the backend for
|
||||
// pricelist that have base == 'pricelist'.
|
||||
return price;
|
||||
},
|
||||
});
|
||||
|
||||
var OrderlineSuper = models.Orderline;
|
||||
models.Orderline = models.Orderline.extend({
|
||||
export_as_JSON: function() {
|
||||
var data = OrderlineSuper.prototype.export_as_JSON.apply(this, arguments);
|
||||
data.qty_available = this.product.qty_available;
|
||||
return data;
|
||||
},
|
||||
// Compatibility with pos_multi_session
|
||||
apply_ms_data: function(data) {
|
||||
if (OrderlineSuper.prototype.apply_ms_data) {
|
||||
OrderlineSuper.prototype.apply_ms_data.apply(this, arguments);
|
||||
}
|
||||
var product = this.pos.db.get_product_by_id(data.product_id);
|
||||
if (product.qty_available !== data.qty_available) {
|
||||
this.pos.set_product_qty_available(product, data.qty_available);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
models.Product = models.Product.extend({
|
||||
format_float_value: function(val) {
|
||||
var value = parseFloat(val);
|
||||
value = field_utils.format.float(value, {digits: [69, 3]});
|
||||
return String(parseFloat(value));
|
||||
},
|
||||
/*
|
||||
Commented this code, cause it works incorrect
|
||||
Example: "this.format_float_value(2366) === 2"
|
||||
rounded_qty: function() {
|
||||
return this.format_float_value(this.qty_available);
|
||||
},
|
||||
*/
|
||||
rounded_qty: function() {
|
||||
return Math.round(this.qty_available);
|
||||
},
|
||||
});
|
||||
});
|
|
@ -1,142 +0,0 @@
|
|||
/* Copyright 2018-2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
|
||||
License MIT (https://opensource.org/licenses/MIT). */
|
||||
odoo.define("pos_product_available.tour", function(require) {
|
||||
"use strict";
|
||||
|
||||
var tour = require("web_tour.tour");
|
||||
var core = require("web.core");
|
||||
var _t = core._t;
|
||||
|
||||
function open_pos_neworder() {
|
||||
return [
|
||||
{
|
||||
trigger: ".o_pos_kanban button.oe_kanban_action_button",
|
||||
content: _t(
|
||||
"<p>Click to start the point of sale interface. It <b>runs on tablets</b>, laptops, or industrial hardware.</p><p>Once the session launched, the system continues to run without an internet connection.</p>"
|
||||
),
|
||||
position: "bottom",
|
||||
},
|
||||
{
|
||||
content: "Switch to table or make dummy action",
|
||||
trigger: ".table, .order-button.selected",
|
||||
position: "bottom",
|
||||
timeout: 30000,
|
||||
},
|
||||
{
|
||||
content: "waiting for loading to finish",
|
||||
trigger: ".order-button.neworder-button",
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
function add_product_to_order(product_name) {
|
||||
return [
|
||||
{
|
||||
content: "buy " + product_name,
|
||||
trigger: '.product-list .product-name:contains("' + product_name + '")',
|
||||
},
|
||||
{
|
||||
content: "the " + product_name + " have been added to the order",
|
||||
trigger: '.orderline:contains("' + product_name + '")',
|
||||
run: function() {
|
||||
// It's a check
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
function payment(pay_method) {
|
||||
return [
|
||||
{
|
||||
trigger: ".button.pay",
|
||||
content: _t("Open the payment screen"),
|
||||
},
|
||||
{
|
||||
content: "Choose Administrator like a cashier or make a dummy action",
|
||||
trigger:
|
||||
'.modal-dialog.cashier:not(.oe_hidden) .cashier .selection-item:contains("Mitchell Admin"), .payment-screen:not(.oe_hidden) h1:contains("Payment")',
|
||||
},
|
||||
{
|
||||
trigger: '.button.paymentmethod:contains("' + pay_method + '")',
|
||||
content: _t("Click the payment method"),
|
||||
},
|
||||
{
|
||||
trigger: '.payment-screen .input-button.number-char:contains("2")',
|
||||
content: "Set payment amount",
|
||||
},
|
||||
{
|
||||
trigger: '.button.next.highlight:contains("Validate")',
|
||||
content: "Validate payment",
|
||||
},
|
||||
{
|
||||
extra_trigger: ".pos-sale-ticket",
|
||||
trigger: '.button.next.highlight:contains("Next Order")',
|
||||
content: "Check proceeded validation",
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
function close_pos() {
|
||||
return [
|
||||
{
|
||||
trigger: '.header-button:contains("Close")',
|
||||
content: _t("Close POS"),
|
||||
},
|
||||
{
|
||||
trigger: '.header-button.confirm:contains("Confirm")',
|
||||
content: _t("Close POS"),
|
||||
},
|
||||
{
|
||||
extra_trigger: ".o_pos_kanban button.oe_kanban_action_button",
|
||||
trigger: ".breadcrumb li.active",
|
||||
content: _t(
|
||||
"<p>Click to start the point of sale interface. It <b>runs on tablets</b>, laptops, or industrial hardware.</p><p>Once the session launched, the system continues to run without an internet connection.</p>"
|
||||
),
|
||||
position: "bottom",
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
function check_quantity(qty) {
|
||||
return [
|
||||
{
|
||||
content: "check quantity",
|
||||
extra_trigger:
|
||||
'.product-list .product:contains("LED Lamp") .qty-tag:contains(' +
|
||||
String(qty) +
|
||||
"):not(.not-available)",
|
||||
trigger: ".order-button.selected",
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
var steps = [
|
||||
tour.STEPS.SHOW_APPS_MENU_ITEM,
|
||||
{
|
||||
trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"]',
|
||||
content: _t(
|
||||
"Ready to launch your <b>point of sale</b>? <i>Click here</i>."
|
||||
),
|
||||
position: "right",
|
||||
edition: "community",
|
||||
},
|
||||
{
|
||||
trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"]',
|
||||
content: _t(
|
||||
"Ready to launch your <b>point of sale</b>? <i>Click here</i>."
|
||||
),
|
||||
position: "bottom",
|
||||
edition: "enterprise",
|
||||
},
|
||||
];
|
||||
steps = steps.concat(
|
||||
open_pos_neworder(),
|
||||
add_product_to_order("LED Lamp"),
|
||||
payment("Cash (USD)"),
|
||||
close_pos(),
|
||||
open_pos_neworder(),
|
||||
check_quantity(2)
|
||||
);
|
||||
|
||||
tour.register("tour_pos_product_available", {test: true, url: "/web"}, steps);
|
||||
});
|
|
@ -1,34 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--Copyright 2014-2015 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
|
||||
Copyright 2018-2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
|
||||
License MIT (https://opensource.org/licenses/MIT). -->
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="Product">
|
||||
<t t-jquery=".product-img" t-operation="append">
|
||||
<t t-if="widget.pos.config.show_qtys && product.type == 'product'">
|
||||
<span
|
||||
t-attf-class="qty-tag #{product.qty_available lte 0 ? 'not-available':''}"
|
||||
>
|
||||
<t t-esc="product.rounded_qty()" />
|
||||
</span>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
<t t-extend="Orderline">
|
||||
<t t-jquery=".info-list>t:first-child">
|
||||
this.attr('t-if', "line.get_quantity_str() !== '1' || line.selected || line.get_product().qty_available lt line.quantity ");
|
||||
</t>
|
||||
<t t-jquery="t[t-esc='line.get_quantity_str()']" t-operation="after">
|
||||
<t
|
||||
t-if="widget.pos.config.show_qtys && line.get_product().type == 'product'"
|
||||
>
|
||||
<t t-set='qty_available' t-value='line.get_product().qty_available' />
|
||||
(of <span
|
||||
t-attf-class="qty-info #{qty_available lt line.quantity ? 'not-available':''}"
|
||||
>
|
||||
<t t-esc="line.get_product().rounded_qty()" />
|
||||
</span>)
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
|
@ -1,3 +0,0 @@
|
|||
# License MIT (https://opensource.org/licenses/MIT).
|
||||
|
||||
from . import test_quantities
|
|
@ -1,64 +0,0 @@
|
|||
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
|
||||
# Copyright 2018-2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
|
||||
# License MIT (https://opensource.org/licenses/MIT).
|
||||
|
||||
import odoo.tests
|
||||
from odoo import _, tools
|
||||
|
||||
|
||||
@odoo.tests.common.at_install(True)
|
||||
@odoo.tests.common.post_install(True)
|
||||
class TestUi(odoo.tests.HttpCase):
|
||||
def test_pos_product_available(self):
|
||||
# needed because tests are run before the module is marked as
|
||||
# installed. In js web will only load qweb coming from modules
|
||||
# that are returned by the backend in module_boot. Without
|
||||
# this you end up with js, css but no qweb.
|
||||
env = self.env
|
||||
env["ir.module.module"].search(
|
||||
[("name", "=", "pos_product_available")], limit=1
|
||||
).state = "installed"
|
||||
|
||||
product = env["product.product"].search([("name", "=", "LED Lamp")], limit=1)
|
||||
product.product_tmpl_id.write({"type": "product"})
|
||||
|
||||
# updating product qty
|
||||
new_quantity = 3
|
||||
company_user = self.env.user.company_id
|
||||
location = (
|
||||
self.env["stock.warehouse"]
|
||||
.search([("company_id", "=", company_user.id)], limit=1)
|
||||
.lot_stock_id
|
||||
)
|
||||
th_qty = product.qty_available
|
||||
inventory = self.env["stock.inventory"].create(
|
||||
{
|
||||
"name": _("INV: %s") % tools.ustr(product.display_name),
|
||||
"filter": "product",
|
||||
"product_id": product.id,
|
||||
"location_id": location.id,
|
||||
"line_ids": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"product_qty": new_quantity,
|
||||
"location_id": location.id,
|
||||
"product_id": product.id,
|
||||
"product_uom_id": product.uom_id.id,
|
||||
"theoretical_qty": th_qty,
|
||||
},
|
||||
)
|
||||
],
|
||||
}
|
||||
)
|
||||
inventory.action_validate()
|
||||
|
||||
# without a delay there might be problems caused by a not yet loaded button's action
|
||||
self.phantom_js(
|
||||
"/web",
|
||||
"odoo.__DEBUG__.services['web_tour.tour'].run('tour_pos_product_available', 500)",
|
||||
"odoo.__DEBUG__.services['web_tour.tour'].tours.tour_pos_product_available.ready",
|
||||
login="admin",
|
||||
timeout=200,
|
||||
)
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
|
||||
License MIT (https://opensource.org/licenses/MIT).-->
|
||||
<odoo>
|
||||
<record id="view_pos_product_available_negative_config_form" model="ir.ui.view">
|
||||
<field name="name">pos.pin.config.form.view</field>
|
||||
<field name="model">pos.config</field>
|
||||
<field name="inherit_id" ref="point_of_sale.pos_config_view_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='iface_big_scrollbars']/../.." position="after">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" id="show_prod_qtys">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="show_qtys" />
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="show_qtys" />
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
|
@ -1,64 +0,0 @@
|
|||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
|
||||
=================================
|
||||
Unique Product Internal Reference
|
||||
=================================
|
||||
|
||||
This module adds a constraint on the internal reference of the product
|
||||
to make it unique across the database.
|
||||
|
||||
Usage
|
||||
=====
|
||||
* Unable to save a product when a new internal reference or default_code value is
|
||||
the same with an existing record.
|
||||
* A pre_init_hook process is initiated when there exist records without an internal reference(default_code).
|
||||
A default value is generated to populate empty field as a temporary value.
|
||||
|
||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||
:alt: Try me on Runbot
|
||||
:target: https://runbot.odoo-community.org/runbot/135/11.0
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues
|
||||
<https://github.com/OCA/product-attribute/issues>`_. In case of trouble, please
|
||||
check there if your issue has already been reported. If you spotted it first,
|
||||
help us smash it by providing detailed and welcomed feedback.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Images
|
||||
------
|
||||
|
||||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
* Antonio Yamuta <ayamuta@opensourceintegrators.com>
|
||||
|
||||
Funders
|
||||
-------
|
||||
|
||||
The development of this module has been financially supported by:
|
||||
|
||||
* Open Source Integrators <http://www.opensourceintegrators.com>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
To contribute to this module, please visit https://odoo-community.org.
|
|
@ -1,5 +0,0 @@
|
|||
# Copyright (C) 2018 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import models
|
||||
from .hook import pre_init_product_code
|
|
@ -1,15 +0,0 @@
|
|||
# Copyright (C) 2018 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Unique Product Internal Reference",
|
||||
"summary": "Set Product Internal Reference as Unique",
|
||||
"version": "12.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "Open Source Integrators, Odoo Community Association (OCA)",
|
||||
"category": "Product",
|
||||
"website": "https://github.com/OCA/product-attribute",
|
||||
"depends": ["product"],
|
||||
"pre_init_hook": 'pre_init_product_code',
|
||||
"installable": True,
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
# Copyright (C) 2019 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
def pre_init_product_code(cr):
|
||||
cr.execute("""UPDATE product_product
|
||||
SET default_code = 'DEFAULT' || nextval('ir_default_id_seq')
|
||||
WHERE id in (SELECT distinct(pp.id)
|
||||
FROM product_product pp
|
||||
INNER JOIN (SELECT default_code, COUNT(*)
|
||||
FROM product_product
|
||||
GROUP BY default_code
|
||||
HAVING COUNT(*)>1
|
||||
)pp1 on pp.default_code=pp1.default_code
|
||||
or pp.default_code is NULL
|
||||
or LENGTH(pp.default_code) = 0)""")
|
||||
return True
|
|
@ -1,27 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * product_code_unique
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2021-01-26 10:44+0000\n"
|
||||
"Last-Translator: claudiagn <claudia.gargallo@qubiq.es>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: ca\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.3.2\n"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: sql_constraint:product.product:0
|
||||
msgid "Internal Reference must be unique across the database!"
|
||||
msgstr "La referència interna ha de ser única a tota la base de dades!"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: model:ir.model,name:product_code_unique.model_product_product
|
||||
msgid "Product"
|
||||
msgstr "Producte"
|
|
@ -1,27 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * product_code_unique
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2020-10-13 13:08+0000\n"
|
||||
"Last-Translator: claudiagn <claudia.gargallo@qubiq.es>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 3.10\n"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: sql_constraint:product.product:0
|
||||
msgid "Internal Reference must be unique across the database!"
|
||||
msgstr "La referencia interna debe ser única por base de datos!"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: model:ir.model,name:product_code_unique.model_product_product
|
||||
msgid "Product"
|
||||
msgstr "Producto"
|
|
@ -1,27 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * product_code_unique
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2020-02-20 14:13+0000\n"
|
||||
"Last-Translator: Lorenzo Battistini <lb@takobi.online>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 3.10\n"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: sql_constraint:product.product:0
|
||||
msgid "Internal Reference must be unique across the database!"
|
||||
msgstr "Il riferimento interno deve essere unico all'interno del database!"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: model:ir.model,name:product_code_unique.model_product_product
|
||||
msgid "Product"
|
||||
msgstr "Prodotto"
|
|
@ -1,27 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * product_code_unique
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2020-10-18 21:08+0000\n"
|
||||
"Last-Translator: Pedro Castro Silva <pedrocs@exo.pt>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: pt\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 3.10\n"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: sql_constraint:product.product:0
|
||||
msgid "Internal Reference must be unique across the database!"
|
||||
msgstr "A Referência Interna deve ser única em toda a base de dados!"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: model:ir.model,name:product_code_unique.model_product_product
|
||||
msgid "Product"
|
||||
msgstr "Produto"
|
|
@ -1,27 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * product_code_unique
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2020-06-16 13:19+0000\n"
|
||||
"Last-Translator: Maurício Liell <mauricio@liell.com.br>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: pt_BR\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 3.10\n"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: sql_constraint:product.product:0
|
||||
msgid "Internal Reference must be unique across the database!"
|
||||
msgstr "A Referência Interna deve ser única no banco de dados!"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: model:ir.model,name:product_code_unique.model_product_product
|
||||
msgid "Product"
|
||||
msgstr "Produto"
|
|
@ -1,27 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * product_code_unique
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2020-07-03 21:19+0000\n"
|
||||
"Last-Translator: Jan Prokop <jprokop@jackie.sk>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: sk\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
|
||||
"X-Generator: Weblate 3.10\n"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: sql_constraint:product.product:0
|
||||
msgid "Internal Reference must be unique across the database!"
|
||||
msgstr "Interná referencia musí byť jedinečná v celej databáze!"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: model:ir.model,name:product_code_unique.model_product_product
|
||||
msgid "Product"
|
||||
msgstr "Produkt"
|
|
@ -1,27 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * product_code_unique
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2020-07-02 14:19+0000\n"
|
||||
"Last-Translator: Jan Prokop <jprokop@jackie.sk>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: sk_SK\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
|
||||
"X-Generator: Weblate 3.10\n"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: sql_constraint:product.product:0
|
||||
msgid "Internal Reference must be unique across the database!"
|
||||
msgstr "Interná referencia musí byť jedinečná v celej databáze!"
|
||||
|
||||
#. module: product_code_unique
|
||||
#: model:ir.model,name:product_code_unique.model_product_product
|
||||
msgid "Product"
|
||||
msgstr "Produkt"
|
|
@ -1,4 +0,0 @@
|
|||
# Copyright (C) 2018 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import product
|
|
@ -1,12 +0,0 @@
|
|||
# Copyright (C) 2018 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class ProductProduct(models.Model):
|
||||
_inherit = 'product.product'
|
||||
|
||||
_sql_constraints = [
|
||||
('default_code_uniq', 'unique(default_code)',
|
||||
'Internal Reference must be unique across the database!'), ]
|
Before Width: | Height: | Size: 9.2 KiB |
|
@ -2,7 +2,7 @@
|
|||
'name': 'Product Create Stock Picking',
|
||||
'category': 'Warehouse',
|
||||
'summary': 'Add an action to create a stock picking from a selection of products.',
|
||||
'version': '12.0.0.0.1',
|
||||
'version': "16.0.1.0.0",
|
||||
'description': """
|
||||
|
||||
Add an action to create a stock picking from a selection of products.
|
||||
|
|
|
@ -11,7 +11,6 @@ from odoo import tools, models, fields, api, _
|
|||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
@api.multi
|
||||
def create_stock_picking(self):
|
||||
picking_vals = self.env['stock.picking'].default_get(self.env['stock.picking']._fields.keys())
|
||||
picking_vals.update({
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
'name': 'Product Library',
|
||||
'category': 'Product',
|
||||
'summary': 'Add library related fields to product',
|
||||
'version': '12.0.1.0.2',
|
||||
'version': "16.0.1.0.0",
|
||||
'description': """
|
||||
|
||||
Addon mejora de Odoo para librerías y tiendas de discos
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * pos_default_empty_image
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2020-10-26 11:08+0000\n"
|
||||
"Last-Translator: Daniel Martinez Vila <daniel.martinez@qubiq.es>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 3.10\n"
|
||||
|
||||
#. module: pos_default_empty_image
|
||||
#: model:ir.model.fields,field_description:pos_default_empty_image.field_pos_config__iface_fixed_font_size
|
||||
#: model_terms:ir.ui.view,arch_db:pos_default_empty_image.pos_config_view_form
|
||||
msgid "Fixed Font Size"
|
||||
msgstr "Tamaño de fuente fijo"
|
||||
|
||||
#. module: pos_default_empty_image
|
||||
#: model:ir.model.fields,help:pos_default_empty_image.field_pos_config__iface_fixed_font_size
|
||||
#: model_terms:ir.ui.view,arch_db:pos_default_empty_image.pos_config_view_form
|
||||
msgid ""
|
||||
"Font size of the product name, when it has no image. Set '0' will set "
|
||||
"adaptative font-size, depending on the length of the name."
|
||||
msgstr ""
|
||||
"Tamaño de fuente del nombre del producto, cuando no tiene imagen. Establecer "
|
||||
"'0' establecerá un tamaño de fuente adaptativo, dependiendo de la longitud "
|
||||
"del nombre."
|
||||
|
||||
#. module: pos_default_empty_image
|
||||
#: model:ir.model.fields,field_description:pos_default_empty_image.field_product_product__has_image
|
||||
msgid "Has Image"
|
||||
msgstr "Tiene imagen"
|
||||
|
||||
#. module: pos_default_empty_image
|
||||
#: model:ir.model,name:pos_default_empty_image.model_pos_config
|
||||
msgid "Point of Sale Configuration"
|
||||
msgstr "Configuración del punto de venta"
|
||||
|
||||
#. module: pos_default_empty_image
|
||||
#: model:ir.model,name:pos_default_empty_image.model_product_product
|
||||
msgid "Product"
|
||||
msgstr "Producto"
|
|
@ -1,42 +0,0 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * product_library
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \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_default_empty_image
|
||||
#: model:ir.model.fields,field_description:pos_default_empty_image.field_pos_config__iface_fixed_font_size
|
||||
#: model_terms:ir.ui.view,arch_db:pos_default_empty_image.pos_config_view_form
|
||||
msgid "Fixed Font Size"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_default_empty_image
|
||||
#: model:ir.model.fields,help:pos_default_empty_image.field_pos_config__iface_fixed_font_size
|
||||
#: model_terms:ir.ui.view,arch_db:pos_default_empty_image.pos_config_view_form
|
||||
msgid "Font size of the product name, when it has no image. Set '0' will set adaptative font-size, depending on the length of the name."
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_default_empty_image
|
||||
#: model:ir.model.fields,field_description:pos_default_empty_image.field_product_product__has_image
|
||||
msgid "Has Image"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_default_empty_image
|
||||
#: model:ir.model,name:pos_default_empty_image.model_pos_config
|
||||
msgid "Point of Sale Configuration"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_default_empty_image
|
||||
#: model:ir.model,name:pos_default_empty_image.model_product_product
|
||||
msgid "Product"
|
||||
msgstr ""
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
from . import pos_config
|
||||
from . import product_template
|
||||
from . import product_product
|
||||
#from . import product_product
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ from odoo import models, fields, api
|
|||
class ProductProduct(models.Model):
|
||||
_inherit = 'product.product'
|
||||
|
||||
@api.multi
|
||||
@api.depends('image')
|
||||
def _compute_has_image(self):
|
||||
for product in self:
|
||||
|
|
|
@ -11,16 +11,16 @@ _logger = logging.getLogger(__name__)
|
|||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
subtitle = fields.Char('Subtítulo')
|
||||
subtitle = fields.Char('Subtitulo')
|
||||
editorial = fields.Char('Editorial')
|
||||
formato = fields.Char('Formato')
|
||||
pais_edicion = fields.Char('País de Edicion')
|
||||
colacion = fields.Char('Colación')
|
||||
pais_edicion = fields.Char('Pais de edicion')
|
||||
colacion = fields.Char('Colacion')
|
||||
autor = fields.Char('Autor')
|
||||
isbn = fields.Char('ISBN')
|
||||
coleccion = fields.Char('Colección')
|
||||
subcoleccion = fields.Char('Subcolección')
|
||||
coleccion = fields.Char('Coleccion')
|
||||
subcoleccion = fields.Char('Subcoleccion')
|
||||
idioma = fields.Char('Idioma')
|
||||
fecha_entrada = fields.Char('Fecha de entrada')
|
||||
fecha_edicion = fields.Char('Fecha de edición')
|
||||
genero = fields.Char('Género')
|
||||
genero = fields.Char('Genero')
|
||||
|
|
|
@ -7,7 +7,7 @@ odoo.define('product_library.product_library', function (require) {
|
|||
//var gui = require('point_of_sale.gui');
|
||||
//var _t = core._t;
|
||||
|
||||
models.load_fields("product.product", ['has_image']);
|
||||
//models.load_fields("product.product", ['has_image']);
|
||||
|
||||
/* ********************************************************
|
||||
Overload models.PosModel
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<!-- </t> -->
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<!--
|
||||
<t t-name="ProductNoImage">
|
||||
<article class='product' t-att-data-product-id="product.id" tabindex="0" t-attf-aria-labelledby="article_product_#{product.id}">
|
||||
<t t-set="name_length" t-value="product.display_name.length" />
|
||||
|
@ -63,7 +63,7 @@
|
|||
</div>
|
||||
</article>
|
||||
</t>
|
||||
|
||||
-->
|
||||
</templates>
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<odoo>
|
||||
|
||||
<!--
|
||||
<record model="ir.ui.view" id="pos_config_view_form">
|
||||
<field name="model">pos.config</field>
|
||||
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
|
||||
|
@ -25,5 +25,5 @@
|
|||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
-->
|
||||
</odoo>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="product_library_form_config">
|
||||
<field name="name">product.template.library.form</field>
|
||||
<field name="model">product.template</field>
|
||||
|
@ -27,5 +26,4 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
</odoo>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
<!--
|
||||
<template id="assets_backend" name="product_library" inherit_id="point_of_sale.assets">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/product_library/static/src/js/models.js"></script>
|
||||
|
@ -14,7 +14,7 @@
|
|||
/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
-->
|
||||
<!--
|
||||
<template
|
||||
id="assets_backend_web"
|
||||
|
@ -27,7 +27,7 @@
|
|||
src="/product_library/static/src/js/test_pos_format.js"
|
||||
/>
|
||||
</xpath>
|
||||
</template> -->
|
||||
|
||||
</template>
|
||||
-->
|
||||
</odoo>
|
||||
|
||||
|
|