diff --git a/laundary_mgt/__init__.py b/laundary_mgt/__init__.py new file mode 100644 index 0000000..dc5e6b6 --- /dev/null +++ b/laundary_mgt/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import models diff --git a/laundary_mgt/__manifest__.py b/laundary_mgt/__manifest__.py new file mode 100644 index 0000000..da96006 --- /dev/null +++ b/laundary_mgt/__manifest__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +{ + 'name': 'Laundary Management', + 'version': '1.1', + 'category': 'Sales/Sales', + 'summary': 'Laundary Management', + 'description': """ +This module contains all the common features of Laundary Management. + """, + 'depends': ['sale'], + 'data': [ + 'security/ir.model.access.csv', + 'data/ir_sequence_data.xml', + 'views/sale_views.xml', + ], + 'demo': [ + ], + 'qweb': [ + + ], + 'installable': True, + 'auto_install': False +} diff --git a/laundary_mgt/__pycache__/__init__.cpython-36.pyc b/laundary_mgt/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..e813b57 Binary files /dev/null and b/laundary_mgt/__pycache__/__init__.cpython-36.pyc differ diff --git a/laundary_mgt/data/ir_sequence_data.xml b/laundary_mgt/data/ir_sequence_data.xml new file mode 100644 index 0000000..451160e --- /dev/null +++ b/laundary_mgt/data/ir_sequence_data.xml @@ -0,0 +1,15 @@ + + + + + + + Sales Order Line + sale.order.line + Trac + 3 + + + + + diff --git a/laundary_mgt/models/__init__.py b/laundary_mgt/models/__init__.py new file mode 100644 index 0000000..2168351 --- /dev/null +++ b/laundary_mgt/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import sale diff --git a/laundary_mgt/models/__pycache__/__init__.cpython-36.pyc b/laundary_mgt/models/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..7a239a6 Binary files /dev/null and b/laundary_mgt/models/__pycache__/__init__.cpython-36.pyc differ diff --git a/laundary_mgt/models/__pycache__/sale.cpython-36.pyc b/laundary_mgt/models/__pycache__/sale.cpython-36.pyc new file mode 100644 index 0000000..a461ce3 Binary files /dev/null and b/laundary_mgt/models/__pycache__/sale.cpython-36.pyc differ diff --git a/laundary_mgt/models/sale.py b/laundary_mgt/models/sale.py new file mode 100644 index 0000000..304d3c8 --- /dev/null +++ b/laundary_mgt/models/sale.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from datetime import datetime, timedelta +from functools import partial +from itertools import groupby + +from odoo import api, fields, models, SUPERUSER_ID, _ +from odoo.exceptions import AccessError, UserError, ValidationError +from odoo.tools.misc import formatLang, get_lang +from odoo.osv import expression +from odoo.tools import float_is_zero, float_compare + + + +from werkzeug.urls import url_encode + +class SaleOrder(models.Model): + _inherit = 'sale.order' + + check_trackcode = fields.Boolean(string='Check Track code', readonly=True, default=False, copy=False) + + def action_generate_tracking_code(self): + for order in self: + order.check_trackcode = True + company_id = default=lambda self: self.env.company + seq_date = fields.Datetime.now() + for line in order.order_line: + line.tracking_code = self.env['ir.sequence'].next_by_code('sale.order.line', sequence_date=seq_date) or _('New') + + +class SaleOrderLine(models.Model): + _inherit = 'sale.order.line' + _description = 'Sales Order Line' + + wash_type = fields.Many2one('wash.type', string='Wash Type') + cloth_name = fields.Char(string='Cloth Name',copy=False) + tracking_code = fields.Char(string='Tracking Code',copy=False,readonly="1") + remark = fields.Text('Remark',copy=False) + upload_image = fields.Image("Upload Image") + + + + +class WashType(models.Model): + _name = 'wash.type' + _description = 'Wash Type' + + name = fields.Char(string='Name') \ No newline at end of file diff --git a/laundary_mgt/security/ir.model.access.csv b/laundary_mgt/security/ir.model.access.csv new file mode 100644 index 0000000..643a646 --- /dev/null +++ b/laundary_mgt/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_wash_type,wash.type,model_wash_type,sales_team.group_sale_salesman,1,1,1,1 diff --git a/laundary_mgt/views/sale_views.xml b/laundary_mgt/views/sale_views.xml new file mode 100644 index 0000000..239402a --- /dev/null +++ b/laundary_mgt/views/sale_views.xml @@ -0,0 +1,22 @@ + + + + sale.order.form.inherit + sale.order + + + +