diff --git a/change_password/static/description/index.html b/change_password/static/description/index.html index 4df3a2f92..b84b83bbf 100644 --- a/change_password/static/description/index.html +++ b/change_password/static/description/index.html @@ -8,7 +8,7 @@
-

User Changing Password

+

Changing Password

☛ User can change password from his own account
diff --git a/change_password/static/description/index.html~ b/change_password/static/description/index.html~ new file mode 100644 index 000000000..4df3a2f92 --- /dev/null +++ b/change_password/static/description/index.html~ @@ -0,0 +1,47 @@ +

+
+

Change Password Option To Users

+

It gives an option to change their own password

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+
+ +
+
+

User Changing Password

+
+

+ ☛ User can change password from his own account
+

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/sale_product_image/README.rst b/sale_product_image/README.rst new file mode 100644 index 000000000..de996b4b5 --- /dev/null +++ b/sale_product_image/README.rst @@ -0,0 +1,11 @@ +Product Images in Sales & Reports v9 +==================================== +This module adds product images in sale order line and +sale order report. + +Features +======== +* Add your preferred image for the product. +* Edit the image of product from sale order line itself. +* Product Image is also viewable in Sale order Report. + diff --git a/sale_product_image/__init__.py b/sale_product_image/__init__.py new file mode 100644 index 000000000..bd05360e0 --- /dev/null +++ b/sale_product_image/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import models + diff --git a/sale_product_image/__openerp__.py b/sale_product_image/__openerp__.py new file mode 100644 index 000000000..a03bb546c --- /dev/null +++ b/sale_product_image/__openerp__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Product Images in Sales', + 'version': '9.0.1.0.0', + 'summary': 'Images In Sale Order Line And Reports', + 'category': 'Sales', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "http://www.cybrosys.com", + 'depends': ['base', 'sale'], + 'data': [ + 'views/image_in_orderline.xml', + 'views/image_report_template.xml', + 'views/tree_image.xml', + 'views/image_email_template.xml' + ], + 'qweb': ['static/src/xml/widget.xml', ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/sale_product_image/models/__init__.py b/sale_product_image/models/__init__.py new file mode 100644 index 000000000..6ce1313d0 --- /dev/null +++ b/sale_product_image/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +import sol_image + diff --git a/sale_product_image/models/sol_image.py b/sale_product_image/models/sol_image.py new file mode 100644 index 000000000..44e3f266c --- /dev/null +++ b/sale_product_image/models/sol_image.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +from openerp import fields, models, api + + +class OrderLineImage(models.Model): + _inherit = 'sale.order.line' + + image = fields.Binary(string="Image") + + @api.multi + @api.onchange('product_id') + def product_id_change(self): + if not self.product_id: + return {'domain': {'product_uom': []}} + + vals = {} + self.image = self.product_id.image_medium + domain = {'product_uom': [('category_id', '=', self.product_id.uom_id.category_id.id)]} + if not self.product_uom or (self.product_id.uom_id.id != self.product_uom.id): + vals['product_uom'] = self.product_id.uom_id + vals['product_uom_qty'] = 1.0 + + product = self.product_id.with_context( + lang=self.order_id.partner_id.lang, + partner=self.order_id.partner_id.id, + quantity=vals.get('product_uom_qty') or self.product_uom_qty, + date=self.order_id.date_order, + pricelist=self.order_id.pricelist_id.id, + uom=self.product_uom.id + ) + + name = product.name_get()[0][1] + if product.description_sale: + name += '\n' + product.description_sale + vals['name'] = name + + self._compute_tax_id() + + if self.order_id.pricelist_id and self.order_id.partner_id: + vals['price_unit'] = self.env['account.tax']._fix_tax_included_price(product.price, product.taxes_id, + self.tax_id) + self.update(vals) + return {'domain': domain} + + +class ReportImage(models.Model): + _inherit = 'sale.order' + + @api.multi + def print_quotation(self): + self.filtered(lambda s: s.state == 'draft').write({'state': 'sent'}) + return self.env['report'].get_action(self, 'sale_product_image.report_saleorder') + + @api.multi + def action_quotation_send(self): + self.ensure_one() + ir_model_data = self.env['ir.model.data'] + try: + template_id = ir_model_data.get_object_reference('sale_product_image', 'email_template_edi_sales')[1] + except ValueError: + template_id = False + try: + compose_form_id = ir_model_data.get_object_reference('mail', 'email_compose_message_wizard_form')[1] + except ValueError: + compose_form_id = False + ctx = dict() + ctx.update({ + 'default_model': 'sale.order', + 'default_res_id': self.ids[0], + 'default_use_template': bool(template_id), + 'default_template_id': template_id, + 'default_composition_mode': 'comment', + 'mark_so_as_sent': True + }) + return { + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'mail.compose.message', + 'views': [(compose_form_id, 'form')], + 'view_id': compose_form_id, + 'target': 'new', + 'context': ctx, + } diff --git a/sale_product_image/static/description/banner.jpg b/sale_product_image/static/description/banner.jpg new file mode 100644 index 000000000..6d64eaef8 Binary files /dev/null and b/sale_product_image/static/description/banner.jpg differ diff --git a/sale_product_image/static/description/cybro_logo.png b/sale_product_image/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/sale_product_image/static/description/cybro_logo.png differ diff --git a/sale_product_image/static/description/icon.png b/sale_product_image/static/description/icon.png new file mode 100644 index 000000000..e167dbdc2 Binary files /dev/null and b/sale_product_image/static/description/icon.png differ diff --git a/sale_product_image/static/description/index.html b/sale_product_image/static/description/index.html new file mode 100644 index 000000000..c1e356689 --- /dev/null +++ b/sale_product_image/static/description/index.html @@ -0,0 +1,68 @@ +
+
+

Product Images in Sales & Reports

+

+

Features:

+
    +
  •    Add Your Preferred Image for the Product.
  • +
  •    Edit the Image of Product From Sale Order Line Itself.
  • +
  •    Product Image is Also Viewable in Sale Order Report.
  • +
+ +
+
+ + + +
+
+
+

Product Images in Order Lines

+

Add or Edit

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

Product Image in Sale Order Report

+
+
+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
\ No newline at end of file diff --git a/sale_product_image/static/description/pdf.png b/sale_product_image/static/description/pdf.png new file mode 100644 index 000000000..09bd118c5 Binary files /dev/null and b/sale_product_image/static/description/pdf.png differ diff --git a/sale_product_image/static/description/sol.png b/sale_product_image/static/description/sol.png new file mode 100644 index 000000000..153b7c140 Binary files /dev/null and b/sale_product_image/static/description/sol.png differ diff --git a/sale_product_image/static/src/js/tree_image.js b/sale_product_image/static/src/js/tree_image.js new file mode 100644 index 000000000..588cf2691 --- /dev/null +++ b/sale_product_image/static/src/js/tree_image.js @@ -0,0 +1,51 @@ +odoo.define('sale_product_image.tree_image', function (require) { +"use strict"; + + + var core = require('web.core'); + var session = require('web.session'); + var QWeb = core.qweb; + + + var ColumnBinaryImage = core.list_widget_registry.get('field').extend({ + /** + * Return a link to the binary data as a Image + */ + _format: function (row_data, options) { + this.session = session; + + if (!row_data[this.id] || !row_data[this.id].value) { + return ''; + } + var value = row_data[this.id].value, src; + if (this.type === 'binary') { + if (value && value.substr(0, 10).indexOf(' ') === -1) { + // The media subtype (png) seems to be arbitrary + src = "data:image/png;base64," + value; + } else { + //src = instance.session.url('/web/binary/image', {model: options.model, field: this.id, id: options.id}); + var imageArgs = { + model: options.model, + field: this.id, + id: options.id + } + if (this.resize) { + imageArgs.resize = this.resize; + } + src = session.url('/web/binary/image', imageArgs); + } + } else { + if (!/\//.test(row_data[this.id].value)) { + src = '/web/static/src/img/icons/' + row_data[this.id].value + '.png'; + } else { + src = row_data[this.id].value; + } + } + + return QWeb.render('ListView.row.imagen', {widget: this, src: src}); + } + }); + + core.list_widget_registry + .add('field.image', ColumnBinaryImage); +}); diff --git a/sale_product_image/static/src/xml/widget.xml b/sale_product_image/static/src/xml/widget.xml new file mode 100644 index 000000000..9c58f5e50 --- /dev/null +++ b/sale_product_image/static/src/xml/widget.xml @@ -0,0 +1,7 @@ + + + + diff --git a/sale_product_image/views/image_email_template.xml b/sale_product_image/views/image_email_template.xml new file mode 100644 index 000000000..c4ca73cdc --- /dev/null +++ b/sale_product_image/views/image_email_template.xml @@ -0,0 +1,74 @@ + + + + + + Sales Order - Send by Email + ${(object.user_id.email and '%s <%s>' % (object.user_id.name, object.user_id.email) or '')|safe} + ${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' }) + ${object.partner_invoice_id.id} + + + + ${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''} + ${object.partner_id.lang} + + +

Hello ${object.partner_id.name},

+ +

Here is your ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} from ${object.company_id.name}:

+ +

+   REFERENCES
+   Order number: ${object.name}
+   Order total: ${object.amount_total} ${object.pricelist_id.currency_id.name}
+   Order date: ${format_tz(object.date_order, tz=user.tz, context={'lang':object.partner_id.lang})}
+ % if object.origin: +   Order reference: ${object.origin}
+ % endif + % if object.client_order_ref: +   Your reference: ${object.client_order_ref}
+ % endif + % if object.user_id: +   Your contact: ${object.user_id.name} + % endif +

+ + % if object.paypal_url: +
+

It is also possible to directly pay with Paypal:

+ + + + % endif + +
+

If you have any question, do not hesitate to contact us.

+

Thank you for choosing ${object.company_id.name or 'us'}!

+
+
+
+

+ ${object.company_id.name}

+
+
+ + ${object.company_id.partner_id.sudo().with_context(show_address=True, html_format=True).name_get()[0][1] | safe} + + % if object.company_id.phone: +
+ Phone:  ${object.company_id.phone} +
+ % endif + % if object.company_id.website: + + %endif +

+
+
+ ]]> + + diff --git a/sale_product_image/views/image_in_orderline.xml b/sale_product_image/views/image_in_orderline.xml new file mode 100644 index 000000000..d456e2cc8 --- /dev/null +++ b/sale_product_image/views/image_in_orderline.xml @@ -0,0 +1,20 @@ + + + + + + + image.sol.view + + sale.order + + + + + + + + + + + \ No newline at end of file diff --git a/sale_product_image/views/image_report_template.xml b/sale_product_image/views/image_report_template.xml new file mode 100644 index 000000000..b9677856d --- /dev/null +++ b/sale_product_image/views/image_report_template.xml @@ -0,0 +1,159 @@ + + + + + + + \ No newline at end of file diff --git a/sale_product_image/views/tree_image.xml b/sale_product_image/views/tree_image.xml new file mode 100644 index 000000000..161f4753a --- /dev/null +++ b/sale_product_image/views/tree_image.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file