Skip to content

Commit

Permalink
[IMP] stock_barcodes_picking_batch_revision: Make toggle button bigger
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosRoca13 committed Jan 18, 2024
1 parent 2ad017b commit 1be1db0
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 3 deletions.
3 changes: 2 additions & 1 deletion stock_barcodes_picking_batch_revision/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Stock Barcodes Picking Batch Revision
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:010cc1362ea2da2e03ecb286e09fe28539b81b7c069609ca91a65737d284b097
!! source digest: sha256:93ae07fd7b54293bbb2c2c3c9f0cbca33e2a54e9feda8d71ab34b4c57c01a989
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -67,6 +67,7 @@ Contributors

* Sergio Teruel
* Carlos Dauden
* Carlos Roca

Maintainers
~~~~~~~~~~~
Expand Down
6 changes: 6 additions & 0 deletions stock_barcodes_picking_batch_revision/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@
"wizard/stock_barcodes_read_picking_batch_views.xml",
],
"installable": True,
"assets": {
"web.assets_backend": [
"stock_barcodes_picking_batch_revision/static/src/js/boolean_toggle_big.js",
"stock_barcodes_picking_batch_revision/static/src/scss/boolean_toggle_big.scss",
],
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

* Sergio Teruel
* Carlos Dauden
* Carlos Roca
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Stock Barcodes Picking Batch Revision</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:010cc1362ea2da2e03ecb286e09fe28539b81b7c069609ca91a65737d284b097
!! source digest: sha256:93ae07fd7b54293bbb2c2c3c9f0cbca33e2a54e9feda8d71ab34b4c57c01a989
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/stock-logistics-barcode/tree/15.0/stock_barcodes_picking_batch_revision"><img alt="OCA/stock-logistics-barcode" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--barcode-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-barcode-15-0/stock-logistics-barcode-15-0-stock_barcodes_picking_batch_revision"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-barcode&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends barcode reader interface to allow to review batch picking from other
Expand Down Expand Up @@ -411,6 +411,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Sergio Teruel</li>
<li>Carlos Dauden</li>
<li>Carlos Roca</li>
</ul>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Copyright 2024 Tecnativa - Carlos Roca
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */
odoo.define(
"stock_barcodes_picking_batch_revision.boolean_toggle_big",
function (require) {
"use strict";

var basic_fields = require("web.basic_fields");
var field_registry = require("web.field_registry");

var FieldBarcodeBooleanToggleBig = basic_fields.BooleanToggle.extend({
/**
* Add class o_boolean_toggle_big to be able to modify css
*
* @override
* @private
*/
_render: function () {
this._super.apply(this, arguments);
this.$el.addClass("o_boolean_toggle_big");
},
});

field_registry.add("boolean_toggle_big", FieldBarcodeBooleanToggleBig);
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* Copyright 2024 Tecnativa - Carlos Roca
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */
div.o_boolean_toggle_big.custom-control.custom-checkbox {
$line-height-computed: $line-height-base * $font-size-base;
$slider-width: $line-height-computed * 2.5;
$font-size: $font-size-base * 2;

display: inline-block;
padding-left: $slider-width + 0.25rem;

> label.custom-control-label {
> i {
color: white;
cursor: pointer;
font-size: $font-size;
position: absolute;
top: 2px;
&.fa-times-circle {
right: 24px;
}
&.fa-check-circle {
right: 7px;
}
}
&::before,
&::after {
content: "";
top: 0;
left: -($slider-width + 0.25rem);
}
&::before {
width: $slider-width;
height: 150%;
background-color: #a0a0a0 !important;
border-radius: 100px;
outline: none !important;
}
}
> input.custom-control-input:checked + label.custom-control-label {
&::before {
background-color: $o-brand-primary !important;
}
&::after {
background-image: none;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
attrs="{'invisible': [('is_pending', '=', True)]}"
class="float-right"
>
<field name="requested_review" widget="boolean_toggle" />
<field name="requested_review" widget="boolean_toggle_big" />
<label for="requested_review">
Review
</label>
Expand Down

0 comments on commit 1be1db0

Please sign in to comment.