diff --git a/default_product_image/README.rst b/default_product_image/README.rst new file mode 100644 index 0000000..88b6133 --- /dev/null +++ b/default_product_image/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Default product image v16 +=========================== +You my have some issue to customize the default image of your products, +this module will helpe you to add default image (your logo or custom image) to your products. + +Installation +============ +* Just install the module. + +Configuration +============= +* Go to Setting +* Choose your image in "default image" section +* Enjoy the module ! + +Company +------- +* `Imal-Tech `__ + + +Credits +------- +* Developers: + Version 16: Imal-tech team @imaltech + +Contacts +-------- +* Mail Contact : contact@imal-tech.com +* Website : https://imal-tech.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://imal-tech.com/wp-content/uploads/2021/01/imal-tech-logo-.gif + :target: https://imal-tech.com + +This module is maintained by Imal-tech. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/default_product_image/__init__.py b/default_product_image/__init__.py new file mode 100755 index 0000000..5305644 --- /dev/null +++ b/default_product_image/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import models \ No newline at end of file diff --git a/default_product_image/__manifest__.py b/default_product_image/__manifest__.py new file mode 100755 index 0000000..e894592 --- /dev/null +++ b/default_product_image/__manifest__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +{ + 'name': 'Default Product Image', + 'description': """ + This module will help you to add default image to products with no images. + """, + 'summary': 'Module to help you add default image to products', + 'author': 'Imal-Tech', + 'website': 'https://www.imal-tech.com', + 'maintainer': 'Imal-Tech', + 'category': 'Sales', + 'version': '16.0.1.0.0', + 'depends': ['base', 'sale_management'], + 'data': [ + 'views/res_config_views.xml', + ], + 'license': 'LGPL-3', + 'images': ['static/description/banner.gif'], + 'installable': True, + 'application': False, + 'auto_install': False, +} \ No newline at end of file diff --git a/default_product_image/i18n/fr.po b/default_product_image/i18n/fr.po new file mode 100644 index 0000000..b02ee91 --- /dev/null +++ b/default_product_image/i18n/fr.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * default_product_image +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-11-15 15:43+0000\n" +"PO-Revision-Date: 2022-11-15 15:43+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: default_product_image +#: model_terms:ir.ui.view,arch_db:default_product_image.res_config_settings_view_form_default_image +msgid "" +"" +msgstr "" + +#. module: default_product_image +#: model_terms:ir.ui.view,arch_db:default_product_image.res_config_settings_view_form_default_image +msgid "Add the default image to products." +msgstr "Ajoutez l'image par défaut aux produits." + +#. module: default_product_image +#: model:ir.model,name:default_product_image.model_res_config_settings +msgid "Config Settings" +msgstr "Paramètres de config" + +#. module: default_product_image +#: model:ir.model.fields,field_description:default_product_image.field_res_config_settings__product_default_image +#: model_terms:ir.ui.view,arch_db:default_product_image.res_config_settings_view_form_default_image +msgid "Default Image" +msgstr "Image par défaut" + +#. module: default_product_image +#: model_terms:ir.ui.view,arch_db:default_product_image.res_config_settings_view_form_default_image +msgid "Default image" +msgstr "Image par défaut" + +#. module: default_product_image +#: model:ir.model,name:default_product_image.model_product_template +msgid "Product" +msgstr "Article" \ No newline at end of file diff --git a/default_product_image/models/__init__.py b/default_product_image/models/__init__.py new file mode 100755 index 0000000..c54cced --- /dev/null +++ b/default_product_image/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import res_config +from . import product_template \ No newline at end of file diff --git a/default_product_image/models/product_template.py b/default_product_image/models/product_template.py new file mode 100755 index 0000000..99167ef --- /dev/null +++ b/default_product_image/models/product_template.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +from odoo import models, fields, api, tools + + +class ProductTemplate(models.Model): + """ Inherit Product Template Settings to add default image product from setting """ + _inherit = "product.template" + + @api.model_create_multi + def create(self, vals_list): + for val_list in vals_list: + if not val_list['image_1920']: + product_default_image = self.env['ir.config_parameter'].sudo().get_param( + 'res.config.settings.product_default_image') + if product_default_image: + val_list['image_1920'] = product_default_image + + return super(ProductTemplate, self).create(vals_list) diff --git a/default_product_image/models/res_config.py b/default_product_image/models/res_config.py new file mode 100755 index 0000000..e56d993 --- /dev/null +++ b/default_product_image/models/res_config.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- + +from odoo import models, fields, _, api + + +class ResConfig(models.TransientModel): + """ Inherit Res Config Settings to add default image product field """ + _inherit = 'res.config.settings' + + product_default_image = fields.Binary(string="Default Image") + + @api.model + def get_values(self): + res = super(ResConfig, self).get_values() + res.update( + product_default_image=self.env['ir.config_parameter'].sudo().get_param( + 'res.config.settings.product_default_image'), + ) + return res + + def set_values(self): + super(ResConfig, self).set_values() + param = self.env['ir.config_parameter'].sudo() + param.set_param('res.config.settings.product_default_image', self.product_default_image) diff --git a/default_product_image/security/ir.model.access.csv b/default_product_image/security/ir.model.access.csv new file mode 100755 index 0000000..97dd8b9 --- /dev/null +++ b/default_product_image/security/ir.model.access.csv @@ -0,0 +1 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink diff --git a/default_product_image/static/description/banner.gif b/default_product_image/static/description/banner.gif new file mode 100644 index 0000000..ece8362 Binary files /dev/null and b/default_product_image/static/description/banner.gif differ diff --git a/default_product_image/static/description/icon.png b/default_product_image/static/description/icon.png new file mode 100644 index 0000000..c73dd95 Binary files /dev/null and b/default_product_image/static/description/icon.png differ diff --git a/default_product_image/static/description/images/Imal-Tech_default_product_setting.png b/default_product_image/static/description/images/Imal-Tech_default_product_setting.png new file mode 100644 index 0000000..bb6e7b4 Binary files /dev/null and b/default_product_image/static/description/images/Imal-Tech_default_product_setting.png differ diff --git a/default_product_image/static/description/images/agriculture.png b/default_product_image/static/description/images/agriculture.png new file mode 100755 index 0000000..0bc1e5e Binary files /dev/null and b/default_product_image/static/description/images/agriculture.png differ diff --git a/default_product_image/static/description/images/e-commerce.png b/default_product_image/static/description/images/e-commerce.png new file mode 100755 index 0000000..f8dc7fd Binary files /dev/null and b/default_product_image/static/description/images/e-commerce.png differ diff --git a/default_product_image/static/description/images/e-learning.png b/default_product_image/static/description/images/e-learning.png new file mode 100755 index 0000000..4af617b Binary files /dev/null and b/default_product_image/static/description/images/e-learning.png differ diff --git a/default_product_image/static/description/images/hotel.png b/default_product_image/static/description/images/hotel.png new file mode 100755 index 0000000..6a7df99 Binary files /dev/null and b/default_product_image/static/description/images/hotel.png differ diff --git a/default_product_image/static/description/images/logo_imal-tech.png b/default_product_image/static/description/images/logo_imal-tech.png new file mode 100755 index 0000000..7f3cb64 Binary files /dev/null and b/default_product_image/static/description/images/logo_imal-tech.png differ diff --git a/default_product_image/static/description/images/manufacturing.png b/default_product_image/static/description/images/manufacturing.png new file mode 100755 index 0000000..e028b8e Binary files /dev/null and b/default_product_image/static/description/images/manufacturing.png differ diff --git a/default_product_image/static/description/images/odoo_customization.png b/default_product_image/static/description/images/odoo_customization.png new file mode 100755 index 0000000..5d825f6 Binary files /dev/null and b/default_product_image/static/description/images/odoo_customization.png differ diff --git a/default_product_image/static/description/images/odoo_implementation.png b/default_product_image/static/description/images/odoo_implementation.png new file mode 100755 index 0000000..4b7e61c Binary files /dev/null and b/default_product_image/static/description/images/odoo_implementation.png differ diff --git a/default_product_image/static/description/images/odoo_integration.png b/default_product_image/static/description/images/odoo_integration.png new file mode 100755 index 0000000..c805f15 Binary files /dev/null and b/default_product_image/static/description/images/odoo_integration.png differ diff --git a/default_product_image/static/description/images/odoo_support.png b/default_product_image/static/description/images/odoo_support.png new file mode 100755 index 0000000..e59e3fb Binary files /dev/null and b/default_product_image/static/description/images/odoo_support.png differ diff --git a/default_product_image/static/description/images/pos.png b/default_product_image/static/description/images/pos.png new file mode 100755 index 0000000..766b694 Binary files /dev/null and b/default_product_image/static/description/images/pos.png differ diff --git a/default_product_image/static/description/images/restaurant.png b/default_product_image/static/description/images/restaurant.png new file mode 100755 index 0000000..6bb0772 Binary files /dev/null and b/default_product_image/static/description/images/restaurant.png differ diff --git a/default_product_image/static/description/images/service_managment.png b/default_product_image/static/description/images/service_managment.png new file mode 100755 index 0000000..1f00d3a Binary files /dev/null and b/default_product_image/static/description/images/service_managment.png differ diff --git a/default_product_image/static/description/index.html b/default_product_image/static/description/index.html new file mode 100755 index 0000000..e0d3a1a --- /dev/null +++ b/default_product_image/static/description/index.html @@ -0,0 +1,432 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+ + + + + + +
+
+

Key + Overview

+
+
+
+

This module will help you to add default image to products with no images. +

+
+
+ + + +
+
+

Key + Features

+
+
+
+
+ +
+
+

+ Community & Enterprise Support

+

+ Available in Odoo 16.0 Community and Enterprise.

+
+
+
+
+ +
+
+

+ Config default product

+

+ Product images will automatically change when you change Default Product Image in the sale configuration page.

+
+
+
+ + +
+
+

Key + Screenshots

+
+
+ +
+

+ Setting

+ +
+
+ +
+

Our + Services

+
+ +
+ +
+
+

Our + Industries

+
+ +
+
+
+
+ Service Management
+
+
+

+ + Service Management

+

+ Keep track of services and invoice accordingly.

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

+ + Hotel Management

+

+ An all-inclusive hotel management application.

+
+
+
+
+
+ + Odoo Manufacturing
+
+
+

+ + Manufacturing

+

+ Plan, track and schedule your operations.

+
+
+
+
+
+ Odoo Restaurant
+
+
+

+ + Restaurant

+

+ Run your bar or restaurant methodical.

+
+
+
+
+
+ Odoo POS
+
+
+

+ + POS

+

+ Mobile friendly, awe-inspiring product pages.

+
+
+
+
+
+ + Odoo E-commerce
+
+
+

+ + E-commerce & Website

+

+ An all-inclusive hotel management application.

+
+
+
+
+
+ + Odoo Agriculture
+
+
+

+ + Agriculture management

+

+ Run efficiently your agriculture's products & farms

+
+
+
+
+
+ Odoo Education
+
+
+

+ + Education

+

+ A Collaborative platform for educational management.

+
+
+
+
+ +
+
+
+
+

Need Any + Help?

+
+

If you have anything to share with us based on your use of this module, please + let us know. We are ready to offer our support.

+
+
+
+ + + +
+
+
Visit us
+

Visit our website for more + information.

+ + www.imal-tech.com + +
+
+
Write to us
+

Do you have any queries regarding our + products & services? Let us know.

+ contact@imal-tech.com +
+ +
+
Follow Us
+

Follow us on social media for latest + updates.

+
+
+
+
+
+
+ + + + + + + + +
+
+
+ +
+
+
+ + + +
+ +
+
\ No newline at end of file diff --git a/default_product_image/views/res_config_views.xml b/default_product_image/views/res_config_views.xml new file mode 100755 index 0000000..cf92a2f --- /dev/null +++ b/default_product_image/views/res_config_views.xml @@ -0,0 +1,27 @@ + + + + + + res.config.settings.view.form.inherit.sale.frequent + res.config.settings + + + + +

Default image

+
+
+
+
+
+
+
+
+
\ No newline at end of file