diff --git "a/MKS_Tradex_Backend_2/\\" "b/MKS_Tradex_Backend_2/\\"
new file mode 100644
index 0000000..e87708b
--- /dev/null
+++ "b/MKS_Tradex_Backend_2/\\"
@@ -0,0 +1,42 @@
+
+
+
+
+
+ view.purchase.requisition.inherit.form
+ purchase.requisition
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MKS_Tradex_Backend_2/__manifest__.py b/MKS_Tradex_Backend_2/__manifest__.py
index 59710e6..4c63720 100755
--- a/MKS_Tradex_Backend_2/__manifest__.py
+++ b/MKS_Tradex_Backend_2/__manifest__.py
@@ -1,7 +1,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'MKS Tradex Backend',
- 'version': '13.0.1.0',
+ 'version': '13.0.1.4',
'category': 'Operations/Purchase',
'description': """
This module allows you to manage your Purchase Agreements flow.
@@ -11,7 +11,7 @@ This module allows you to manage your Purchase Agreements flow.
Purchase Codinator Create RFQ after Approve purchase agreement by purchase manager
""",
- 'depends': ['purchase','purchase_requisition','sale_management'],
+ 'depends': ['purchase','purchase_requisition','sale_management','sale_renting'],
'data': [
'edi/mail_template.xml',
'edi/purchase_mail_template.xml',
diff --git a/MKS_Tradex_Backend_2/__pycache__/__init__.cpython-36.pyc b/MKS_Tradex_Backend_2/__pycache__/__init__.cpython-36.pyc
new file mode 100644
index 0000000..5ba21de
Binary files /dev/null and b/MKS_Tradex_Backend_2/__pycache__/__init__.cpython-36.pyc differ
diff --git a/MKS_Tradex_Backend_2/models/__pycache__/__init__.cpython-36.pyc b/MKS_Tradex_Backend_2/models/__pycache__/__init__.cpython-36.pyc
new file mode 100644
index 0000000..0f86c9c
Binary files /dev/null and b/MKS_Tradex_Backend_2/models/__pycache__/__init__.cpython-36.pyc differ
diff --git a/MKS_Tradex_Backend_2/models/__pycache__/account_invoice.cpython-36.pyc b/MKS_Tradex_Backend_2/models/__pycache__/account_invoice.cpython-36.pyc
new file mode 100644
index 0000000..a66384d
Binary files /dev/null and b/MKS_Tradex_Backend_2/models/__pycache__/account_invoice.cpython-36.pyc differ
diff --git a/MKS_Tradex_Backend_2/models/__pycache__/purchase_order.cpython-36.pyc b/MKS_Tradex_Backend_2/models/__pycache__/purchase_order.cpython-36.pyc
new file mode 100644
index 0000000..f913f53
Binary files /dev/null and b/MKS_Tradex_Backend_2/models/__pycache__/purchase_order.cpython-36.pyc differ
diff --git a/MKS_Tradex_Backend_2/models/__pycache__/purchase_requisition.cpython-36.pyc b/MKS_Tradex_Backend_2/models/__pycache__/purchase_requisition.cpython-36.pyc
new file mode 100644
index 0000000..50e4ab7
Binary files /dev/null and b/MKS_Tradex_Backend_2/models/__pycache__/purchase_requisition.cpython-36.pyc differ
diff --git a/MKS_Tradex_Backend_2/models/__pycache__/sale_order.cpython-36.pyc b/MKS_Tradex_Backend_2/models/__pycache__/sale_order.cpython-36.pyc
new file mode 100644
index 0000000..b00fd44
Binary files /dev/null and b/MKS_Tradex_Backend_2/models/__pycache__/sale_order.cpython-36.pyc differ
diff --git a/MKS_Tradex_Backend_2/models/__pycache__/stock_picking.cpython-36.pyc b/MKS_Tradex_Backend_2/models/__pycache__/stock_picking.cpython-36.pyc
new file mode 100644
index 0000000..84bdef9
Binary files /dev/null and b/MKS_Tradex_Backend_2/models/__pycache__/stock_picking.cpython-36.pyc differ
diff --git a/MKS_Tradex_Backend_2/models/purchase_order.py b/MKS_Tradex_Backend_2/models/purchase_order.py
index cc369c8..faf7e51 100755
--- a/MKS_Tradex_Backend_2/models/purchase_order.py
+++ b/MKS_Tradex_Backend_2/models/purchase_order.py
@@ -9,8 +9,8 @@ class purchase_order(models.Model):
state = fields.Selection([
('draft', 'RFQ'),
('sent', 'RFQ Sent'),
- ('approved', 'RFQ Approved'),
- ('po_approval', 'PO Approval'),
+ ('approved', 'RFQ Submitted To MGT'),
+ ('po_approval', 'Approved By MGT'),
('to approve', 'To Approve'),
('purchase', 'Purchase Order'),
('done', 'Locked'),
diff --git a/MKS_Tradex_Backend_2/models/purchase_requisition.py b/MKS_Tradex_Backend_2/models/purchase_requisition.py
index f5b2250..baadb98 100755
--- a/MKS_Tradex_Backend_2/models/purchase_requisition.py
+++ b/MKS_Tradex_Backend_2/models/purchase_requisition.py
@@ -5,12 +5,13 @@ from odoo import api, fields, models, SUPERUSER_ID, _
PURCHASE_REQUISITION_STATES = [
- ('draft', 'Draft'),
- ('approval', 'Approval'),
- ('manager_approval','Manager Approval'),
- ('approved','Approved'),
+ ('draft', 'New'),
+ ('approval', 'Pending PC Validation'),
+ ('validate_by_pc','Validated By PC'),
+ ('manager_approval','Submitted To MGT'),
+ ('approved','Approved By MGT'),
('ongoing', 'Ongoing'),
- ('in_progress', 'Confirmed'),
+ ('in_progress', 'Approved By MGT'),
('open', 'Bid Selection'),
('done', 'Closed'),
('cancel', 'Cancelled'),
@@ -105,6 +106,20 @@ class purchase_requisition(models.Model):
self.state = 'approval'
def action_coordinator_approval(self):
+ group_id = self.env['ir.model.data'].get_object_reference('MKS_Tradex_Backend_2', 'group_purchase_coordinator')[1]
+ if group_id:
+ browse_group = self.env['res.groups'].browse(group_id)
+ for user in browse_group.users:
+ manager_mail = user.partner_id.email
+ mtp =self.env['mail.template']
+ ir_model_data = self.env['ir.model.data']
+ template_id = ir_model_data.get_object_reference('MKS_Tradex_Backend_2', 'purchase_coordinator_template')
+ mail_tem=mtp.browse(template_id[1])
+ mail_tem.send_mail(self.id,True)
+ mail_tem.write({'email_to': manager_mail})
+ self.state = 'validate_by_pc'
+
+ def action_submitted_to_mgt(self):
group_id = self.env['ir.model.data'].get_object_reference('purchase', 'group_purchase_manager')[1]
if group_id:
browse_group = self.env['res.groups'].browse(group_id)
@@ -117,7 +132,8 @@ class purchase_requisition(models.Model):
mail_tem.send_mail(self.id,True)
mail_tem.write({'email_to': manager_mail})
self.state = 'manager_approval'
+
def action_manager_approval(self):
- self.state = 'approved'
+ self.state = 'manager_approval'
diff --git a/MKS_Tradex_Backend_2/models/sale_order.py b/MKS_Tradex_Backend_2/models/sale_order.py
index 0c50a66..447c7dc 100755
--- a/MKS_Tradex_Backend_2/models/sale_order.py
+++ b/MKS_Tradex_Backend_2/models/sale_order.py
@@ -10,15 +10,16 @@ class sale_order(models.Model):
# credit_controller_id = fields.Many2one('res.users',string="Credit Controller")
state = fields.Selection([
- ('draft', 'Quotation'),
- ('approval', 'RFQ approval'),
- ('approved', 'RFQ Approved'),
- ('logistics_approval', 'Logistics Approval'),
- ('logistics_approved', 'Logistics Approved'),
- ('credit_approval', 'Credit Approval'),
+ ('draft', 'new'),
+ ('approval', 'Submmited To MGT'),
+ ('approved', 'Approved By MGT'),
+ ('logistics_approval', 'Validated By Logistic'),
+ ('logistics_approved', 'validated by logistic'),
+ ('credit_approval', 'Validated By CC'),
('sent', 'Quotation Sent'),
('sale', 'Sales Order'),
('done', 'Locked'),
+ ('reject','Rejected By MGT'),
('cancel', 'Cancelled'),
], string='Status', readonly=True, copy=False, index=True, tracking=3, default='draft')
@@ -61,6 +62,15 @@ class sale_order(models.Model):
mail_tem.write({'email_from': manager,'email_to': user_email})
self.state = 'approved'
return True
+
+ def action_managment_reject(self):
+ self.state = 'reject'
+ return True
+
+ def reset(self):
+ self.state = 'approved'
+ return True
+
def action_logistics_approval(self):
group_id = self.env['ir.model.data'].get_object_reference('MKS_Tradex_Backend_2', 'group_sale_logistics')[1]
@@ -97,6 +107,7 @@ class sale_order(models.Model):
def action_credit_approval(self):
self.state = 'credit_approval'
return True
+
diff --git a/MKS_Tradex_Backend_2/models/stock_picking.py b/MKS_Tradex_Backend_2/models/stock_picking.py
index 7f886d3..a16ce70 100755
--- a/MKS_Tradex_Backend_2/models/stock_picking.py
+++ b/MKS_Tradex_Backend_2/models/stock_picking.py
@@ -6,7 +6,7 @@ from odoo import api, fields, models, SUPERUSER_ID, _
class stock_picking(models.Model):
_inherit = "stock.picking"
- state = fields.Selection(selection_add=[('qa_approval', 'QA approval')],
+ state = fields.Selection(selection_add=[('qa_approval', 'QA Validation')],
)
def button_validate_qa_approval(self):
diff --git a/MKS_Tradex_Backend_2/security/account_security.xml b/MKS_Tradex_Backend_2/security/account_security.xml
index c6e3b03..3e4055c 100755
--- a/MKS_Tradex_Backend_2/security/account_security.xml
+++ b/MKS_Tradex_Backend_2/security/account_security.xml
@@ -1,11 +1,11 @@
-
+
Finance Manager
diff --git a/MKS_Tradex_Backend_2/security/purchase_security.xml b/MKS_Tradex_Backend_2/security/purchase_security.xml
old mode 100644
new mode 100755
index c771245..704cda4
--- a/MKS_Tradex_Backend_2/security/purchase_security.xml
+++ b/MKS_Tradex_Backend_2/security/purchase_security.xml
@@ -27,8 +27,12 @@
Logistics and Warehouse Coordinator
-
-
+
+
+ Sales Co ordinator
+
+
+
Credit Controller
diff --git a/MKS_Tradex_Backend_2/views/account_move_views.xml b/MKS_Tradex_Backend_2/views/account_move_views.xml
old mode 100644
new mode 100755
diff --git a/MKS_Tradex_Backend_2/views/purchase_order_views.xml b/MKS_Tradex_Backend_2/views/purchase_order_views.xml
index 299ce53..560970d 100644
--- a/MKS_Tradex_Backend_2/views/purchase_order_views.xml
+++ b/MKS_Tradex_Backend_2/views/purchase_order_views.xml
@@ -1,10 +1,20 @@
+
+
+
view.purchase.order.inherit.form
purchase.order
-
+
@@ -12,21 +22,21 @@
-
+
-
+
-
+
-
+
diff --git a/MKS_Tradex_Backend_2/views/purchase_requisition_views.xml b/MKS_Tradex_Backend_2/views/purchase_requisition_views.xml
old mode 100644
new mode 100755
index 4e2e6f4..1235feb
--- a/MKS_Tradex_Backend_2/views/purchase_requisition_views.xml
+++ b/MKS_Tradex_Backend_2/views/purchase_requisition_views.xml
@@ -1,5 +1,11 @@
+
+
view.purchase.requisition.inherit.form
purchase.requisition
@@ -7,27 +13,34 @@
-
+
-
+ -->
-
-
+
+
-
+
-
+
+
-
+
-
-
+
+
+ Requisition Type
+
+
+ Requisition Deadline
+
+
diff --git a/MKS_Tradex_Backend_2/views/sale_order_view.xml b/MKS_Tradex_Backend_2/views/sale_order_view.xml
old mode 100644
new mode 100755
index af26804..ace5464
--- a/MKS_Tradex_Backend_2/views/sale_order_view.xml
+++ b/MKS_Tradex_Backend_2/views/sale_order_view.xml
@@ -5,30 +5,36 @@
sale.order
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
-
+
-
-
-
-
+
diff --git a/MKS_Tradex_Backend_2/views/stock_picking.xml b/MKS_Tradex_Backend_2/views/stock_picking.xml
old mode 100644
new mode 100755
index e373903..643ac8d
--- a/MKS_Tradex_Backend_2/views/stock_picking.xml
+++ b/MKS_Tradex_Backend_2/views/stock_picking.xml
@@ -12,7 +12,7 @@
-
+