#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:
parent
6debf13f25
commit
bc5f2ab42a
17 changed files with 390 additions and 1 deletions
1
pos_picking_load_selected_partner/__init__.py
Normal file
1
pos_picking_load_selected_partner/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from . import models
|
||||
21
pos_picking_load_selected_partner/__manifest__.py
Normal file
21
pos_picking_load_selected_partner/__manifest__.py
Normal 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': [
|
||||
],
|
||||
}
|
||||
1
pos_picking_load_selected_partner/models/__init__.py
Normal file
1
pos_picking_load_selected_partner/models/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from . import stock_picking
|
||||
15
pos_picking_load_selected_partner/models/stock_picking.py
Normal file
15
pos_picking_load_selected_partner/models/stock_picking.py
Normal 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'
|
||||
|
||||
20
pos_picking_load_selected_partner/static/src/js/widget.js
Normal file
20
pos_picking_load_selected_partner/static/src/js/widget.js
Normal 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;
|
||||
});
|
||||
11
pos_picking_load_selected_partner/views/assets.xml
Normal file
11
pos_picking_load_selected_partner/views/assets.xml
Normal 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue