Browse Source

[FIX] Bug Fixed

pull/298/head
Ajmal Cybro 4 years ago
parent
commit
60059190dc
  1. 2
      pos_discount_manager/__manifest__.py
  2. 5
      pos_discount_manager/doc/RELEASE_NOTES.md
  3. 5
      pos_discount_manager/models/hr_employee_inherit.py
  4. 31
      pos_discount_manager/static/src/js/ValidateManager.js
  5. 5
      purchase_order_delivery_status/__init__.py
  6. 16
      purchase_order_delivery_status/__manifest__.py
  7. 5
      purchase_order_delivery_status/models/__init__.py
  8. 6
      purchase_order_delivery_status/models/purchase_order.py
  9. 9
      purchase_order_delivery_status/static/description/index.html

2
pos_discount_manager/__manifest__.py

@ -21,7 +21,7 @@
#############################################################################
{
'name': "POS Discount Manager Approval",
'version': '14.0.1.0.0',
'version': '14.0.1.0.1',
'summary': """Discount limit for each employee in every point of sale""",
'description': """"This module helps you to set a discount limit for each employee in every point of sale.
It facilitate the manager approval when discount over the limit of employee""",

5
pos_discount_manager/doc/RELEASE_NOTES.md

@ -5,4 +5,9 @@
##### ADD
- Initial commit
#### 25.10.2021
#### Version 14.0.1.0.1
##### FIX
- Bug Fix

5
pos_discount_manager/models/hr_employee_inherit.py

@ -28,4 +28,7 @@ class DiscountRestrictCat(models.Model):
limited_discount = fields.Integer(string="Discount Limit")
def get_employee_disc_limit(self):
visible_emp_ids = self.search([('id', 'in', self.ids)])
employees_data = self.sudo().search_read([('id', 'in', visible_emp_ids.ids)], ['limited_discount'])
return employees_data

31
pos_discount_manager/static/src/js/ValidateManager.js

@ -1,6 +1,34 @@
odoo.define('pos_discount_manager.ValidateManager', function(require) {
'use strict';
var models = require('point_of_sale.models');
models.load_fields('hr.employee', ['limited_discount']);
var posmodel_super = models.PosModel.prototype;
models.PosModel = models.PosModel.extend({
load_server_data: function () {
var self = this;
return posmodel_super.load_server_data.apply(this, arguments).then(function () {
var employee_ids = _.map(self.employees, function(employee){return employee.id;});
var records = self.rpc({
model: 'hr.employee',
method: 'get_employee_disc_limit',
args: [employee_ids],
});
return records.then(function (employee_data) {
self.employees.forEach(function (employee) {
var data = _.findWhere(employee_data, {'id': employee.id});
if (data !== undefined){
employee.limited_discount = data.limited_discount;
}
});
});
});
},
});
const {
parse
} = require('web.field_utils');
@ -111,6 +139,9 @@ odoo.define('pos_discount_manager.ValidateManager', function(require) {
}
}
else {
return false;
}
}

5
purchase_order_delivery_status/__init__.py

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
@ -18,6 +19,6 @@
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
#############################################################################
from . import models

16
purchase_order_delivery_status/__manifest__.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
@ -18,23 +18,21 @@
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
#############################################################################
{
'name': "Delivery Status on Purchase Order",
'summary': """Delivery Status on Purchase Order""",
'description': "This module adds Delivery Status on Purchase Order",
'description': "This module adds delivery status on purchase order",
'author': "Cybrosys Techno Solutions",
'company': "Cybrosys Techno Solutions",
'maintainer': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'website': "http://www.cybrosys.com",
'category': 'Purchase',
'version': '14.0.1.0.0',
'version': '14.0.1.0.1',
'depends': ['purchase', 'stock', 'purchase_stock'],
'data': ['views/purchase_order.xml'],
'images': ['static/description/banner.png'],
'license': 'LGPL-3',
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'application': False,
'auto_install': False,
}

5
purchase_order_delivery_status/models/__init__.py

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
@ -18,6 +19,6 @@
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
#############################################################################
from . import purchase_order

6
purchase_order_delivery_status/models/purchase_order.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
###############################################################################
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
@ -18,7 +18,7 @@
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
#############################################################################
from odoo import models, fields, api, _
@ -39,7 +39,7 @@ class PurchaseOrder(models.Model):
pickings = self.env['stock.picking'].search([
('purchase_id', '=', rec.id)])
orderlines = rec.mapped('order_line')
if not pickings:
if not pickings and not orderlines.filtered(lambda x:x.product_id.type == 'service'):
rec.delivery_status = 'nothing'
elif all(o.qty_received == 0 for o in orderlines):
rec.delivery_status = 'to_receive'

9
purchase_order_delivery_status/static/description/index.html

@ -1,3 +1,4 @@
<div class="container" style="padding: 1rem !important; margin-bottom: 1rem !important;">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between"
@ -29,7 +30,7 @@
Delivery Status on Purchase Order</h1>
<p
style="font-family: 'Montserrat', sans-serif !important; font-weight: 300 !important; color: #FFFFFF !important; font-size: 1.4rem !important; text-align: center !important;">
Add Delivery Status on Purchase Order Tree View
A Module for adding delivery status on purchase order
</p>
<img src="./assets/screenshots/hero_1.png" class="img-responsive" width="100%" height="auto" />
</div>
@ -110,13 +111,11 @@
<div class="col-mg-12 pl-3">
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;">
The delivery status on purchase order module helps to find out the delivery status of each purchase
order. Delivery status is added in tree view and in the form view of purchase order.
The delivery status on purchase order module helps to find out the delivery status of each purchase order. Delivery status is added in tree view and in the form view of purchase order.
The different delivery status are:
(i) Nothing to Receive - If no receipt is created for a purchase order
(ii) To Receive - Receipt is still to receive
(iii) Partially Received - If More than one receipt is created for a purchase order and some of them
received and some still to receive
(iii) Partially Received - If More than one receipt is created for a purchase order and some of them received and some still to receive
(iv) Received - If all receipts are done
(v) Processing - If any receipt is in waiting state
</p>

Loading…
Cancel
Save