#322 filtra la carga de pickings en el PDV cuando hay un cliente seleccionado. Añadido módulo con página de consulta de productos en el website

This commit is contained in:
Luis 2023-01-15 12:13:09 +01:00
parent 6debf13f25
commit bc5f2ab42a
17 changed files with 390 additions and 1 deletions

View file

@ -0,0 +1 @@
from . import models

View file

@ -0,0 +1,21 @@
# Copyright 2022 Criptomart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Pos Picking Load Selected Partner',
'description': """
If a partner is selected in the PoS Order as client, search only the pickings related to this partner.""",
'version': '12.0.1.0.0',
'license': 'AGPL-3',
'author': 'Criptomart',
'website': 'https://criptomart.net',
'depends': [
"point_of_sale",
"pos_picking_load"
],
'data': [
'views/assets.xml'
],
'demo': [
],
}

View file

@ -0,0 +1 @@
from . import stock_picking

View file

@ -0,0 +1,15 @@
# Copyright 2022 Criptomart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, _
from odoo.tools import date_utils
import json
import logging
_logger = logging.getLogger(__name__)
class StockPicking(models.Model):
_inherit = 'stock.picking'

View file

@ -0,0 +1,20 @@
odoo.define('pos_picking_load_selected_partner.picking_partner', function (require) {
"use strict";
var screens = require('point_of_sale.screens');
var gui = require('point_of_sale.gui');
var PickingPartner = gui.Gui.prototype.screen_classes.filter(function(el) {
return el.name == 'load_picking'
})[0].widget.include({
show: function () {
this._super();
var partner = this.pos.get_order().get_client();
var query = "";
if (partner){ query = partner.name; }
this.search_pickings(query);
}
});
return PickingPartner;
});

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_picking_load_selected_partner/static/src/js/widget.js"></script>
</xpath>
</template>
</odoo>