mirror of https://github.com/OCA/web.git
[MIG] web_widget_one2many_product_picker_sale_stock: Migration to 13.0
parent
6e94d0a7d2
commit
e6d21552a9
|
@ -4,14 +4,14 @@
|
|||
{
|
||||
"name": "Web Widget One2Many Product Picker Sale Stock",
|
||||
"summary": "Adds support for stock in the one2many product picker widget",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "13.0.1.0.0",
|
||||
"category": "Website",
|
||||
"author": "Tecnativa, " "Odoo Community Association (OCA)",
|
||||
"website": "https://www.tecnativa.com",
|
||||
"website": "https://github.com/OCA/web",
|
||||
"license": "AGPL-3",
|
||||
"depends": ["web_widget_one2many_product_picker", "sale_stock_info_popup",],
|
||||
"data": ["templates/assets.xml",],
|
||||
"qweb": ["static/src/xml/one2many_product_picker.xml",],
|
||||
"depends": ["web_widget_one2many_product_picker", "sale_stock"],
|
||||
"data": ["templates/assets.xml"],
|
||||
"qweb": ["static/src/xml/one2many_product_picker.xml"],
|
||||
"installable": True,
|
||||
"auto_install": False,
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ odoo.define(
|
|||
function(require) {
|
||||
"use strict";
|
||||
|
||||
var One2ManyProductPickerRecord = require("web_widget_one2many_product_picker.One2ManyProductPickerRecord");
|
||||
const One2ManyProductPickerRecord = require("web_widget_one2many_product_picker.One2ManyProductPickerRecord");
|
||||
|
||||
One2ManyProductPickerRecord.include({
|
||||
/**
|
||||
|
|
|
@ -5,13 +5,13 @@ odoo.define(
|
|||
function(require) {
|
||||
"use strict";
|
||||
|
||||
var One2ManyProductPickerRenderer = require("web_widget_one2many_product_picker.One2ManyProductPickerRenderer");
|
||||
const One2ManyProductPickerRenderer = require("web_widget_one2many_product_picker.One2ManyProductPickerRenderer");
|
||||
|
||||
One2ManyProductPickerRenderer.include({
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
_getRecordOptions: function(search_record) {
|
||||
_getRecordOptions: function() {
|
||||
var options = this._super.apply(this, arguments);
|
||||
options.showSaleStock = this.options.show_sale_stock;
|
||||
return options;
|
||||
|
|
|
@ -5,7 +5,7 @@ odoo.define("web_widget_one2many_product_picker_sale_stock.AbstractView", functi
|
|||
) {
|
||||
"use strict";
|
||||
|
||||
var AbstractView = require("web.AbstractView");
|
||||
const AbstractView = require("web.AbstractView");
|
||||
|
||||
/**
|
||||
* Helper function to create field view definitions
|
||||
|
@ -40,7 +40,7 @@ odoo.define("web_widget_one2many_product_picker_sale_stock.AbstractView", functi
|
|||
*/
|
||||
init: function(viewInfo, params) {
|
||||
if (viewInfo.model === "sale.order") {
|
||||
var widget_name = $(viewInfo.arch)
|
||||
const widget_name = $(viewInfo.arch)
|
||||
.find("field[name='order_line']")
|
||||
.attr("widget");
|
||||
if (widget_name === "one2many_product_picker") {
|
||||
|
@ -56,7 +56,7 @@ odoo.define("web_widget_one2many_product_picker_sale_stock.AbstractView", functi
|
|||
* @param {Object} viewInfo
|
||||
*/
|
||||
_injectSaleStockFields: function(viewInfo) {
|
||||
var to_inject = {
|
||||
const to_inject = {
|
||||
product_type: _constructFakeFieldDef({
|
||||
depends: ["product_id.type"],
|
||||
related: ["product_id", "type"],
|
||||
|
@ -149,9 +149,9 @@ odoo.define("web_widget_one2many_product_picker_sale_stock.AbstractView", functi
|
|||
);
|
||||
|
||||
// Add fields to arch
|
||||
var field_names = Object.keys(to_inject);
|
||||
var $arch = $(viewInfo.viewFields.order_line.views.form.arch);
|
||||
for (var index in field_names) {
|
||||
const field_names = Object.keys(to_inject);
|
||||
const $arch = $(viewInfo.viewFields.order_line.views.form.arch);
|
||||
for (const index in field_names) {
|
||||
var field_name = field_names[index];
|
||||
var $field = $arch.find("field[name='" + field_name + "']");
|
||||
if (!$field.length) {
|
||||
|
|
|
@ -5,7 +5,7 @@ odoo.define(
|
|||
function(require) {
|
||||
"use strict";
|
||||
|
||||
var FieldOne2ManyProductPicker = require("web_widget_one2many_product_picker.FieldOne2ManyProductPicker");
|
||||
const FieldOne2ManyProductPicker = require("web_widget_one2many_product_picker.FieldOne2ManyProductPicker");
|
||||
|
||||
FieldOne2ManyProductPicker.include({
|
||||
/**
|
||||
|
|
|
@ -21,20 +21,18 @@
|
|||
|
||||
.oe_flip_card_inner {
|
||||
.stock_info {
|
||||
top: 50%;
|
||||
left: 5px;
|
||||
transform: translateY(-50%);
|
||||
top: 5px;
|
||||
right: 8px;
|
||||
|
||||
> .o_widget {
|
||||
> div {
|
||||
background-color: white;
|
||||
border-radius: 50%;
|
||||
width: 2.5em;
|
||||
height: 2.5em;
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
|
||||
.fa {
|
||||
margin-top: -3px;
|
||||
font-size: 3em;
|
||||
font-size: 2.5em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<template>
|
||||
<t t-extend="One2ManyProductPicker.FlipCard">
|
||||
<t t-extend="One2ManyProductPicker.FlipCard.Front">
|
||||
<t
|
||||
t-jquery="div[t-attf-class*=oe_flip_card_front] t[t-if='state']"
|
||||
t-operation="append"
|
||||
t-jquery="t[t-call='One2ManyProductPicker.ActionButton']"
|
||||
t-operation="after"
|
||||
>
|
||||
<t t-if="state.model === 'sale.order.line'">
|
||||
<div class="position-absolute m-0 text-left stock_info">
|
||||
<t t-if="has_onchange && state.model === 'sale.order.line'">
|
||||
<div class="position-absolute m-0 stock_info">
|
||||
<widget name="qty_at_date_widget" width="0.1" />
|
||||
</div>
|
||||
</t>
|
||||
|
|
Loading…
Reference in New Issue