diff --git a/employee_vehicle_request/README.rst b/employee_vehicle_request/README.rst new file mode 100644 index 000000000..377b3f5df --- /dev/null +++ b/employee_vehicle_request/README.rst @@ -0,0 +1,39 @@ +Employee Vehicle Request +======================== +This module is used for manage vehicle requests from employee. +This module also checking the vehicle availability at the requested time slot + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Nilmar Shereef @ Cybrosys, odoo@cybrosys.com + Niyas Raphy @cybrosys, odoo@cybrosys.com + Yadhukrishna K @cybrosys, odoo@cybrosys.com +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/employee_vehicle_request/__init__.py b/employee_vehicle_request/__init__.py new file mode 100644 index 000000000..48441876a --- /dev/null +++ b/employee_vehicle_request/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef @ Cybrosys, (odoo@cybrosys.com) +# Niyas Raphy @ Cybrosys, (odoo@cybrosys.com) +# Yadhukrishna @ Cybrosys, (odoo@cybrosys.com) +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/employee_vehicle_request/__manifest__.py b/employee_vehicle_request/__manifest__.py new file mode 100644 index 000000000..07e7b356e --- /dev/null +++ b/employee_vehicle_request/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef @ Cybrosys, (odoo@cybrosys.com) +# Niyas Raphy @ Cybrosys, (odoo@cybrosys.com) +# Yadhukrishna @ Cybrosys, (odoo@cybrosys.com) +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Employee Vehicle Request', + 'version': '12.0.1.0.0', + 'summary': """Manage Vehicle Requests From Employee""", + 'description': """This module is used for manage vehicle requests from employee. + This module also checking the vehicle availability at the requested time slot.""", + 'category': "Generic Modules/Human Resources", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'hr', 'fleet'], + 'data': [ + 'data/data.xml', + 'security/security.xml', + 'security/ir.model.access.csv', + 'views/employee_fleet_view.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'demo': [], + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/employee_vehicle_request/data/data.xml b/employee_vehicle_request/data/data.xml new file mode 100644 index 000000000..1a6b2294d --- /dev/null +++ b/employee_vehicle_request/data/data.xml @@ -0,0 +1,17 @@ + + + + + + User can only see his/her vehicle + + + + + + + [] + + + + \ No newline at end of file diff --git a/employee_vehicle_request/doc/RELEASE_NOTES.md b/employee_vehicle_request/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..8c3760416 --- /dev/null +++ b/employee_vehicle_request/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module + +#### 12.11.2019 +#### Version 13.0.1.0.0 +#### ADD diff --git a/employee_vehicle_request/models/__init__.py b/employee_vehicle_request/models/__init__.py new file mode 100644 index 000000000..3f50c1a7d --- /dev/null +++ b/employee_vehicle_request/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef @ Cybrosys, (odoo@cybrosys.com) +# Niyas Raphy @ Cybrosys, (odoo@cybrosys.com) +# Yadhukrishna @ Cybrosys, (odoo@cybrosys.com) +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +# -*- coding: utf-8 -*- + +from . import employee_fleet diff --git a/employee_vehicle_request/models/employee_fleet.py b/employee_vehicle_request/models/employee_fleet.py new file mode 100644 index 000000000..887083812 --- /dev/null +++ b/employee_vehicle_request/models/employee_fleet.py @@ -0,0 +1,181 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef @ Cybrosys, (odoo@cybrosys.com) +# Niyas Raphy @ Cybrosys, (odoo@cybrosys.com) +# Yadhukrishna @ Cybrosys, (odoo@cybrosys.com) +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +# -*- coding: utf-8 -*- + +from datetime import datetime +from odoo import models, fields, api, _ +from odoo.exceptions import Warning + + +class FleetReservedTime(models.Model): + _name = "fleet.reserved" + _description = "Reserved Time" + + employee = fields.Many2one('hr.employee', string='Employee') + date_from = fields.Datetime(string='Reserved Date From') + date_to = fields.Datetime(string='Reserved Date To') + reserved_obj = fields.Many2one('fleet.vehicle') + + +class FleetVehicleInherit(models.Model): + _inherit = 'fleet.vehicle' + + check_availability = fields.Boolean(default=True, copy=False) + reserved_time = fields.One2many('fleet.reserved', 'reserved_obj', String='Reserved Time', readonly=1, + ondelete='cascade') + + +class EmployeeFleet(models.Model): + _name = 'employee.fleet' + _description = 'Employee Vehicle Request' + _inherit = 'mail.thread' + + @api.model + def create(self, vals): + vals['name'] = self.env['ir.sequence'].next_by_code('employee.fleet') + return super(EmployeeFleet, self).create(vals) + + # @api.multi + def send(self): + if self.date_from and self.date_to: + fleet_obj = self.env['fleet.vehicle'].search([]) + check_availability = 0 + for i in fleet_obj: + for each in i.reserved_time: + if each.date_from <= self.date_from <= each.date_to: + check_availability = 1 + elif self.date_from < each.date_from: + if each.date_from <= self.date_to <= each.date_to: + check_availability = 1 + elif self.date_to > each.date_to: + check_availability = 1 + else: + check_availability = 0 + else: + check_availability = 0 + if check_availability == 0: + reserved_id = self.fleet.reserved_time.create({'employee': self.employee.id, + 'date_from': self.date_from, + 'date_to': self.date_to, + 'reserved_obj': self.fleet.id, + }) + self.write({'reserved_fleet_id': reserved_id.id}) + self.state = 'waiting' + else: + raise Warning('Sorry This vehicle is already requested by another employee') + + # @api.multi + def approve(self): + self.fleet.fleet_status = True + self.state = 'confirm' + mail_content = _('Hi %s,
Your vehicle request for the reference %s is approved.') % \ + (self.employee.name, self.name) + main_content = { + 'subject': _('%s: Approved') % self.name, + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': self.employee.work_email, + } + mail_id = self.env['mail.mail'].create(main_content) + mail_id.mail_message_id.body = mail_content + mail_id.send() + if self.employee.user_id: + mail_id.mail_message_id.write({'needaction_partner_ids': [(4, self.employee.user_id.partner_id.id)]}) + mail_id.mail_message_id.write({'partner_ids': [(4, self.employee.user_id.partner_id.id)]}) + + # @api.multi + def reject(self): + self.reserved_fleet_id.unlink() + self.state = 'reject' + mail_content = _('Hi %s,
Sorry, Your vehicle request for the reference %s is Rejected.') % \ + (self.employee.name, self.name) + + main_content = { + 'subject': _('%s: Approved') % self.name, + 'author_id': self.env.user.partner_id.id, + 'body_html': mail_content, + 'email_to': self.employee.work_email, + } + mail_id = self.env['mail.mail'].create(main_content) + mail_id.mail_message_id.body = mail_content + mail_id.send() + if self.employee.user_id: + mail_id.mail_message_id.write({'needaction_partner_ids': [(4, self.employee.user_id.partner_id.id)]}) + mail_id.mail_message_id.write({'partner_ids': [(4, self.employee.user_id.partner_id.id)]}) + + # @api.multi + def cancel(self): + if self.reserved_fleet_id: + self.reserved_fleet_id.unlink() + self.state = 'cancel' + + # @api.multi + def returned(self): + self.reserved_fleet_id.unlink() + self.returned_date = fields.datetime.now() + self.state = 'return' + + @api.constrains('date_rom', 'date_to') + def onchange_date_to(self): + for each in self: + if each.date_from > each.date_to: + raise Warning('Date To must be greater than Date From') + + @api.onchange('date_from', 'date_to') + def check_availability(self): + if self.date_from and self.date_to: + self.fleet = '' + fleet_obj = self.env['fleet.vehicle'].search([]) + for i in fleet_obj: + for each in i.reserved_time: + if each.date_from <= self.date_from <= each.date_to: + i.write({'check_availability': False}) + elif self.date_from < each.date_from: + if each.date_from <= self.date_to <= each.date_to: + i.write({'check_availability': False}) + elif self.date_to > each.date_to: + i.write({'check_availability': False}) + else: + i.write({'check_availability': True}) + else: + i.write({'check_availability': True}) + + reserved_fleet_id = fields.Many2one('fleet.reserved', invisible=1, copy=False) + name = fields.Char(string='Request Number', copy=False) + employee = fields.Many2one('hr.employee', string='Employee', required=1, readonly=True, + states={'draft': [('readonly', False)]}) + req_date = fields.Date(string='Requested Date', default=fields.Date.context_today, required=1, readonly=True, + states={'draft': [('readonly', False)]}, help="Requested Date") + fleet = fields.Many2one('fleet.vehicle', string='Vehicle', required=1, readonly=True, + states={'draft': [('readonly', False)]}) + date_from = fields.Datetime(string='From', required=1, readonly=True, + states={'draft': [('readonly', False)]}) + date_to = fields.Datetime(string='To', required=1, readonly=True, + states={'draft': [('readonly', False)]}) + returned_date = fields.Datetime(string='Returned Date', readonly=1) + purpose = fields.Text(string='Purpose', required=1, readonly=True, + states={'draft': [('readonly', False)]}, help="Purpose") + state = fields.Selection([('draft', 'Draft'), ('waiting', 'Waiting for Approval'), ('cancel', 'Cancel'), + ('confirm', 'Approved'), ('reject', 'Rejected'), ('return', 'Returned')], + string="State", default="draft") + diff --git a/employee_vehicle_request/security/ir.model.access.csv b/employee_vehicle_request/security/ir.model.access.csv new file mode 100644 index 000000000..6401ebdc3 --- /dev/null +++ b/employee_vehicle_request/security/ir.model.access.csv @@ -0,0 +1,7 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_fleet_reserved_employee,access.fleet.reserved.employee,model_fleet_reserved,base.group_user,1,1,1,0 +access_fleet_reserved_hr,access.fleet.reserved.hr,model_fleet_reserved,hr.group_hr_manager,1,1,1,1 +access_fleet_reserved_hr_user,access.fleet.reserved.hr.user,model_fleet_reserved,hr.group_hr_user,1,1,1,0 +access_employee_fleet_employee,access.employee.fleet.employee,model_employee_fleet,base.group_user,1,1,1,0 +access_employee_fleet_hr,access.employee.fleet.hr,model_employee_fleet,hr.group_hr_manager,1,1,1,1 +access_employee_fleet_hr_user,access.employee.fleet.hr.user,model_employee_fleet,hr.group_hr_user,1,1,1,0 diff --git a/employee_vehicle_request/security/security.xml b/employee_vehicle_request/security/security.xml new file mode 100644 index 000000000..cc4ef8001 --- /dev/null +++ b/employee_vehicle_request/security/security.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/employee_vehicle_request/static/description/banner.jpg b/employee_vehicle_request/static/description/banner.jpg new file mode 100644 index 000000000..47f8fbf0b Binary files /dev/null and b/employee_vehicle_request/static/description/banner.jpg differ diff --git a/employee_vehicle_request/static/description/cybro_logo.png b/employee_vehicle_request/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/employee_vehicle_request/static/description/cybro_logo.png differ diff --git a/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-1.png b/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-1.png new file mode 100644 index 000000000..0536a6a78 Binary files /dev/null and b/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-1.png differ diff --git a/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-2.png b/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-2.png new file mode 100644 index 000000000..8d67e18bb Binary files /dev/null and b/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-2.png differ diff --git a/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-3.png b/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-3.png new file mode 100644 index 000000000..96376d003 Binary files /dev/null and b/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-3.png differ diff --git a/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-4.png b/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-4.png new file mode 100644 index 000000000..50d4d4d5a Binary files /dev/null and b/employee_vehicle_request/static/description/employee_vehicle_request-cybrosys-4.png differ diff --git a/employee_vehicle_request/static/description/icon.png b/employee_vehicle_request/static/description/icon.png new file mode 100644 index 000000000..24f9b6b08 Binary files /dev/null and b/employee_vehicle_request/static/description/icon.png differ diff --git a/employee_vehicle_request/static/description/index.html b/employee_vehicle_request/static/description/index.html new file mode 100644 index 000000000..ea99902cd --- /dev/null +++ b/employee_vehicle_request/static/description/index.html @@ -0,0 +1,399 @@ + +
+
+

+ Employee Vehicle Request +

+

+ This Module Helps You To Manage Vehicle Requests From Employee +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ + +
+
+

+ Overview +

+

+ Employee can request available vehicle for a time period. + He should mention the time period and purpose. Then he can send this request to hr manager. Here also + module checking the availability of vehicles +

+
+
+ + +
+
+

+ Features +

+

+ + Employee can request for any vehicle +

+

+ + Checking availability of vehicles +

+

+ + Validation for send request +

+

+ + Validation for requested dates +

+

+ + Advanced search view +

+ +
+
+ + + + +
+
+

+ Screenshots +

+

+
+ + Here any employee can request available vehicle for a time period. + He should mention the time period and purpose. Then he can send this request to hr manager. Here also + module checking the availability of vehicle +
+

+
+ +
+

+ +
+ + Here Hr Manager can approve the vehicle request. Or she can refuse the request. Also Employee + can cancel this request from this stage before approval or rejection. +
+ +

+
+ +
+ + +

+
+ Validation Messages + +
+

+
+ +
+ + + +

+
+ Requested Period Validation +
+

+
+ +
+ +
+
+ + + + + + + + + + + + +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

+
+ + + +
+ +
+ + + +
+

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + diff --git a/employee_vehicle_request/static/description/vehicle-request-cybrosys-1.png b/employee_vehicle_request/static/description/vehicle-request-cybrosys-1.png new file mode 100644 index 000000000..61b9669f7 Binary files /dev/null and b/employee_vehicle_request/static/description/vehicle-request-cybrosys-1.png differ diff --git a/employee_vehicle_request/static/description/vehicle-request-cybrosys-2.png b/employee_vehicle_request/static/description/vehicle-request-cybrosys-2.png new file mode 100644 index 000000000..d3c1e14bb Binary files /dev/null and b/employee_vehicle_request/static/description/vehicle-request-cybrosys-2.png differ diff --git a/employee_vehicle_request/static/description/vehicle-request-cybrosys-3.png b/employee_vehicle_request/static/description/vehicle-request-cybrosys-3.png new file mode 100644 index 000000000..2b8815982 Binary files /dev/null and b/employee_vehicle_request/static/description/vehicle-request-cybrosys-3.png differ diff --git a/employee_vehicle_request/static/description/vehicle-request-cybrosys-4.png b/employee_vehicle_request/static/description/vehicle-request-cybrosys-4.png new file mode 100644 index 000000000..62622c158 Binary files /dev/null and b/employee_vehicle_request/static/description/vehicle-request-cybrosys-4.png differ diff --git a/employee_vehicle_request/views/employee_fleet_view.xml b/employee_vehicle_request/views/employee_fleet_view.xml new file mode 100644 index 000000000..09fe8a169 --- /dev/null +++ b/employee_vehicle_request/views/employee_fleet_view.xml @@ -0,0 +1,122 @@ + + + + Vehicle Request Code + employee.fleet + + VR + + + + fleet.vehicle.form.inherit.view + fleet.vehicle + + + + + + + + + + + employee.fleet.form + employee.fleet + +
+
+
+ +

+ +

+ + + + + + + + + + + + + +
+
+ + +
+
+
+
+ + + employee.fleet.tree + employee.fleet + + + + + + + + + + + + + + employee.fleet.search + employee.fleet + + + + + + + + + + + + + + + + + + + + Vehicle Request + employee.fleet + tree,form + + +

+ Click to create a New Vehicle Request. +

+
+
+ + + +
\ No newline at end of file diff --git a/invoice_stock_move/README.rst b/invoice_stock_move/README.rst new file mode 100644 index 000000000..501dc1c08 --- /dev/null +++ b/invoice_stock_move/README.rst @@ -0,0 +1,37 @@ +Stock Picking From Invoice +========================== +This Module Enables To Create Stocks Picking From Customer/Supplier Invoice + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Saritha Sahadevan @cybrosys, odoo@cybrosys.com + Yadhukrishna K V13 @cybrosys, odoo@cybrosys.com +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/invoice_stock_move/__init__.py b/invoice_stock_move/__init__.py new file mode 100644 index 000000000..48fd56964 --- /dev/null +++ b/invoice_stock_move/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/invoice_stock_move/__manifest__.py b/invoice_stock_move/__manifest__.py new file mode 100644 index 000000000..ed7785e17 --- /dev/null +++ b/invoice_stock_move/__manifest__.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Stock Picking From Invoice", + 'version': '13.0.1.0.0', + 'summary': """Stock Picking From Customer/Supplier Invoice""", + 'description': """This Module Enables To Create Stocks Picking From Customer/Supplier Invoice""", + 'author': "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Accounting', + 'depends': ['base', 'account', 'stock'], + 'data': ['views/invoice_stock_move_view.xml'], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/invoice_stock_move/doc/RELEASE_NOTES.md b/invoice_stock_move/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..39878fa46 --- /dev/null +++ b/invoice_stock_move/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 11.11.2019 +#### Version 13.0.1.0.0 +#### ADD + +Initial Commit diff --git a/invoice_stock_move/models/__init__.py b/invoice_stock_move/models/__init__.py new file mode 100644 index 000000000..c762ff19a --- /dev/null +++ b/invoice_stock_move/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import invoice_stock diff --git a/invoice_stock_move/models/invoice_stock.py b/invoice_stock_move/models/invoice_stock.py new file mode 100644 index 000000000..632592c8c --- /dev/null +++ b/invoice_stock_move/models/invoice_stock.py @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo.exceptions import UserError +from odoo import models, fields, api, _ + + +class InvoiceStockMove(models.Model): + _inherit = 'account.move' + + @api.model + def _default_picking_receive(self): + type_obj = self.env['stock.picking.type'] + company_id = self.env.context.get('company_id') or self.env.user.company_id.id + types = type_obj.search([('code', '=', 'incoming'), ('warehouse_id.company_id', '=', company_id)], limit=1) + if not types: + types = type_obj.search([('code', '=', 'incoming'), ('warehouse_id', '=', False)]) + return types[:1] + + @api.model + def _default_picking_transfer(self): + type_obj = self.env['stock.picking.type'] + company_id = self.env.context.get('company_id') or self.env.user.company_id.id + types = type_obj.search([('code', '=', 'outgoing'), ('warehouse_id.company_id', '=', company_id)], limit=1) + if not types: + types = type_obj.search([('code', '=', 'outgoing'), ('warehouse_id', '=', False)]) + return types[:4] + + picking_count = fields.Integer(string="Count") + invoice_picking_id = fields.Many2one('stock.picking', string="Picking Id") + picking_type_id = fields.Many2one('stock.picking.type', 'Picking Type', required=True, + default=_default_picking_receive, + help="This will determine picking type of incoming shipment") + picking_transfer_id = fields.Many2one('stock.picking.type', 'Deliver To', required=True, + default=_default_picking_transfer, + help="This will determine picking type of outgoing shipment") + state = fields.Selection([ + ('draft', 'Draft'), + ('proforma', 'Pro-forma'), + ('proforma2', 'Pro-forma'), + ('posted', 'Posted'), + ('post', 'Post'), + ('cancel', 'Cancelled'), + ('done', 'Received'), + ], string='Status', index=True, readonly=True, default='draft', + track_visibility='onchange', copy=False) + + def action_stock_move(self): + for order in self: + if not self.invoice_picking_id: + pick = { + 'picking_type_id': self.picking_type_id.id, + 'partner_id': self.partner_id.id, + 'origin': self.name, + 'location_dest_id': self.picking_type_id.default_location_dest_id.id, + 'location_id': self.partner_id.property_stock_supplier.id + } + picking = self.env['stock.picking'].create(pick) + self.invoice_picking_id = picking.id + self.picking_count = len(picking) + moves = order.invoice_line_ids.filtered(lambda r: r.product_id.type in ['product', 'consu'])._create_stock_moves(picking) + move_ids = moves._action_confirm() + move_ids._action_assign() + + def action_view_picking(self): + action = self.env.ref('stock.action_picking_tree_ready') + result = action.read()[0] + result.pop('id', None) + result['context'] = {} + result['domain'] = [('id', '=', self.invoice_picking_id.id)] + pick_ids = sum([self.invoice_picking_id.id]) + if pick_ids: + res = self.env.ref('stock.view_picking_form', False) + result['views'] = [(res and res.id or False, 'form')] + result['res_id'] = pick_ids or False + return result + + +class SupplierInvoiceLine(models.Model): + _inherit = 'account.move.line' + + def _create_stock_moves(self, picking): + moves = self.env['stock.move'] + done = self.env['stock.move'].browse() + for line in self: + price_unit = line.price_unit + template = { + 'name': line.name or '', + 'product_id': line.product_id.id, + 'product_uom': line.product_uom_id.id, + 'location_id': line.move_id.partner_id.property_stock_supplier.id, + 'location_dest_id': picking.picking_type_id.default_location_dest_id.id, + 'picking_id': picking.id, + # 'move_dest_id': False, + 'state': 'draft', + 'company_id': line.move_id.company_id.id, + 'price_unit': price_unit, + 'picking_type_id': picking.picking_type_id.id, + # 'procurement_id': False, + 'route_ids': 1 and [ + (6, 0, [x.id for x in self.env['stock.location.route'].search([('id', 'in', (2, 3))])])] or [], + 'warehouse_id': picking.picking_type_id.warehouse_id.id, + } + print(template['route_ids'], "two") + diff_quantity = line.quantity + tmp = template.copy() + tmp.update({ + 'product_uom_qty': diff_quantity, + }) + template['product_uom_qty'] = diff_quantity + done += moves.create(template) + return done diff --git a/invoice_stock_move/static/description/banner.jpg b/invoice_stock_move/static/description/banner.jpg new file mode 100644 index 000000000..5da168516 Binary files /dev/null and b/invoice_stock_move/static/description/banner.jpg differ diff --git a/invoice_stock_move/static/description/cust_warehouse.png b/invoice_stock_move/static/description/cust_warehouse.png new file mode 100644 index 000000000..c66556fb4 Binary files /dev/null and b/invoice_stock_move/static/description/cust_warehouse.png differ diff --git a/invoice_stock_move/static/description/cybro_logo.png b/invoice_stock_move/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/invoice_stock_move/static/description/cybro_logo.png differ diff --git a/invoice_stock_move/static/description/icon.png b/invoice_stock_move/static/description/icon.png new file mode 100644 index 000000000..31df27645 Binary files /dev/null and b/invoice_stock_move/static/description/icon.png differ diff --git a/invoice_stock_move/static/description/index.html b/invoice_stock_move/static/description/index.html new file mode 100644 index 000000000..a4a91701f --- /dev/null +++ b/invoice_stock_move/static/description/index.html @@ -0,0 +1,350 @@ + +
+
+

+ Stock Picking From Invoice +

+

+ This Module Enables To Stock Pickings From Customer/Supplier Invoice. +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+
+
+

+ Overview +

+

+ Currently in Odoo , We cannot transfer stocks directly from customer/supplier invoice. + We need to depend sales module or purchase module to transfer or receive goods. + This module enable to transfer stocks from invoices without depending sales and purchase module. +

+
+ +
+
+
+

+ Features +

+

+ + Stock Picking From Customer Invoice. +

+

+ + Stock Picking From Supplier Invoice. +

+ +
+
+
+
+

+ Screenshots +

+

+ + Transfer Button in Customer invoice +

+
+ +
+

+ + On clicking Transfer Button, Stock Is Moved To Customer Inventory. +

+
+ +
+

+ + Receive Button in Vendor Bill. +

+
+ +
+

+ + >On clicking Receive Button, Stock Is Moved To Our Inventory. +

+
+ +
+ +
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

+
+ + + +
+ +
+ + + +
+

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/invoice_stock_move/static/description/stock-picking-cybrosys-1.png b/invoice_stock_move/static/description/stock-picking-cybrosys-1.png new file mode 100644 index 000000000..9118c5dd5 Binary files /dev/null and b/invoice_stock_move/static/description/stock-picking-cybrosys-1.png differ diff --git a/invoice_stock_move/static/description/stock-picking-cybrosys-2.png b/invoice_stock_move/static/description/stock-picking-cybrosys-2.png new file mode 100644 index 000000000..ec28fc57d Binary files /dev/null and b/invoice_stock_move/static/description/stock-picking-cybrosys-2.png differ diff --git a/invoice_stock_move/static/description/stock-picking-cybrosys-3.png b/invoice_stock_move/static/description/stock-picking-cybrosys-3.png new file mode 100644 index 000000000..3a27e73a3 Binary files /dev/null and b/invoice_stock_move/static/description/stock-picking-cybrosys-3.png differ diff --git a/invoice_stock_move/views/invoice_stock_move_view.xml b/invoice_stock_move/views/invoice_stock_move_view.xml new file mode 100644 index 000000000..3beea0ebd --- /dev/null +++ b/invoice_stock_move/views/invoice_stock_move_view.xml @@ -0,0 +1,30 @@ + + + + + Move Name + account.move + + + + + + + + + + \ No newline at end of file