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. 7
      purchase_order_delivery_status/__init__.py
  6. 16
      purchase_order_delivery_status/__manifest__.py
  7. 7
      purchase_order_delivery_status/models/__init__.py
  8. 8
      purchase_order_delivery_status/models/purchase_order.py
  9. 25
      purchase_order_delivery_status/static/description/index.html

2
pos_discount_manager/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': "POS Discount Manager Approval", '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""", '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. '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""", 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 ##### ADD
- Initial commit - 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") 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) { odoo.define('pos_discount_manager.ValidateManager', function(require) {
'use strict'; '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 { const {
parse parse
} = require('web.field_utils'); } = require('web.field_utils');
@ -111,6 +139,9 @@ odoo.define('pos_discount_manager.ValidateManager', function(require) {
} }
} }
else {
return false;
}
} }

7
purchase_order_delivery_status/__init__.py

@ -1,10 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
###############################################################################
#############################################################################
# #
# Cybrosys Technologies Pvt. Ltd. # Cybrosys Technologies Pvt. Ltd.
# #
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) # Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) # Author: Cybrosys Techno Solutions (<https://www.cybrosys.com>)
# #
# You can modify it under the terms of the GNU LESSER # You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. # GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
@ -18,6 +19,6 @@
# (LGPL v3) along with this program. # (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################### #############################################################################
from . import models from . import models

16
purchase_order_delivery_status/__manifest__.py

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

7
purchase_order_delivery_status/models/__init__.py

@ -1,10 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
###############################################################################
#############################################################################
# #
# Cybrosys Technologies Pvt. Ltd. # Cybrosys Technologies Pvt. Ltd.
# #
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) # Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) # Author: Cybrosys Techno Solutions (<https://www.cybrosys.com>)
# #
# You can modify it under the terms of the GNU LESSER # You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. # GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
@ -18,6 +19,6 @@
# (LGPL v3) along with this program. # (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################### #############################################################################
from . import purchase_order from . import purchase_order

8
purchase_order_delivery_status/models/purchase_order.py

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################### #############################################################################
# #
# Cybrosys Technologies Pvt. Ltd. # Cybrosys Technologies Pvt. Ltd.
# #
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) # Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) # Author: Cybrosys Techno Solutions (<https://www.cybrosys.com>)
# #
# You can modify it under the terms of the GNU LESSER # You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. # GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
@ -18,7 +18,7 @@
# (LGPL v3) along with this program. # (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################### #############################################################################
from odoo import models, fields, api, _ from odoo import models, fields, api, _
@ -39,7 +39,7 @@ class PurchaseOrder(models.Model):
pickings = self.env['stock.picking'].search([ pickings = self.env['stock.picking'].search([
('purchase_id', '=', rec.id)]) ('purchase_id', '=', rec.id)])
orderlines = rec.mapped('order_line') 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' rec.delivery_status = 'nothing'
elif all(o.qty_received == 0 for o in orderlines): elif all(o.qty_received == 0 for o in orderlines):
rec.delivery_status = 'to_receive' rec.delivery_status = 'to_receive'

25
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="container" style="padding: 1rem !important; margin-bottom: 1rem !important;">
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between" <div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between"
@ -29,9 +30,9 @@
Delivery Status on Purchase Order</h1> Delivery Status on Purchase Order</h1>
<p <p
style="font-family: 'Montserrat', sans-serif !important; font-weight: 300 !important; color: #FFFFFF !important; font-size: 1.4rem !important; text-align: center !important;"> 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> </p>
<img src="./assets/screenshots/hero_1.png" class="img-responsive" width="100%" height="auto"/> <img src="./assets/screenshots/hero_1.png" class="img-responsive" width="100%" height="auto" />
</div> </div>
</div> </div>
@ -110,13 +111,11 @@
<div class="col-mg-12 pl-3"> <div class="col-mg-12 pl-3">
<p <p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;"> 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 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.
order. Delivery status is added in tree view and in the form view of purchase order.
The different delivery status are: The different delivery status are:
(i) Nothing to Receive - If no receipt is created for a purchase order (i) Nothing to Receive - If no receipt is created for a purchase order
(ii) To Receive - Receipt is still to receive (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 (iii) Partially Received - If More than one receipt is created for a purchase order and some of them received and some still to receive
received and some still to receive
(iv) Received - If all receipts are done (iv) Received - If all receipts are done
(v) Processing - If any receipt is in waiting state (v) Processing - If any receipt is in waiting state
</p> </p>
@ -191,7 +190,7 @@
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Delivery Status on purchase order tree view</p> Delivery Status on purchase order tree view</p>
<img src="assets/screenshots/tree.png" class="img-responsive img-thumbnail border" <img src="assets/screenshots/tree.png" class="img-responsive img-thumbnail border"
width="100%" height="auto"/> width="100%" height="auto" />
</div> </div>
<div class="col-lg-12 my-3"> <div class="col-lg-12 my-3">
@ -203,7 +202,7 @@
Delivery Status on Purchase order form view Delivery Status on Purchase order form view
</p> </p>
<img src="assets/screenshots/form.png" class="img-responsive img-thumbnail border" <img src="assets/screenshots/form.png" class="img-responsive img-thumbnail border"
width="100%" height="auto"/> width="100%" height="auto" />
</div> </div>
</div> </div>
@ -214,7 +213,7 @@
style="text-align: center; padding: 2.5rem 1rem !important;"> style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="color: #212529 !important;">Suggested Products</h2> <h2 style="color: #212529 !important;">Suggested Products</h2>
<hr <hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/> style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;" />
<div id="demo1" class="row carousel slide" data-ride="carousel"> <div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow --> <!-- The slideshow -->
@ -299,7 +298,7 @@
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center"> <div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Services</h2> <h2 style="color: #212529 !important;">Our Services</h2>
<hr <hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/> style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;" />
</div> </div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
@ -404,7 +403,7 @@
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center"> <div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Industries</h2> <h2 style="color: #212529 !important;">Our Industries</h2>
<hr <hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/> style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;" />
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
@ -538,7 +537,7 @@
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center"> <div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Need Help?</h2> <h2 style="color: #212529 !important;">Need Help?</h2>
<hr <hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/> style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;" />
</div> </div>
</div> </div>
@ -571,7 +570,7 @@
<div class="row" style="max-width:1540px; margin: 0 auto; margin-right: 3rem; "> <div class="row" style="max-width:1540px; margin: 0 auto; margin-right: 3rem; ">
<!-- Logo --> <!-- Logo -->
<div class="col-lg-12 d-flex justify-content-center align-items-center" style="margin-top: 3rem;"> <div class="col-lg-12 d-flex justify-content-center align-items-center" style="margin-top: 3rem;">
<img src="https://www.cybrosys.com/images/logo.png" width="200px" height="auto"/> <img src="https://www.cybrosys.com/images/logo.png" width="200px" height="auto" />
</div> </div>
<!-- End of Logo --> <!-- End of Logo -->
<div class="col-lg-12"> <div class="col-lg-12">

Loading…
Cancel
Save