forked from avanzosc/sale-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] sale_order_type_image: In type of sale order new field "S…
…ale Type Image.
- Loading branch information
1 parent
0175ca4
commit fb36d91
Showing
14 changed files
with
282 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. 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 | ||
|
||
===================== | ||
Sale order type image | ||
===================== | ||
|
||
* In type of sale order new field "Sale Type Image. | ||
* When printing a sales order, picking, or customer invoice, if the sales order | ||
type has an image defined, that image will be printed, otherwise the company | ||
image will be printed. | ||
|
||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/avanzosc/sale-addons/issues>`_. In case of trouble, | ||
please check there if your issue has already been reported. If you spotted | ||
it first, help us smash it by providing detailed and welcomed feedback. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Ana Juaristi <[email protected]> | ||
* Alfredo de la Fuente <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2024 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Sale Order Type Image", | ||
"version": "16.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "AvanzOSC", | ||
"website": "https://github.com/avanzosc/sale-addons", | ||
"category": "Sales Management", | ||
"depends": [ | ||
"sale_order_type", | ||
], | ||
"data": [ | ||
"data/layouts.xml", | ||
"views/sale_order_type_views.xml", | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template | ||
id="external_layout_standard" | ||
inherit_id="web.external_layout_boxed" | ||
priority="100" | ||
> | ||
<img t-if="company.logo" position="replace"> | ||
<t | ||
t-if="o._name == 'account.move' and o.move_type in ('out_invoice','out_refund') and o.sale_type_id.sale_type_image" | ||
> | ||
<img | ||
t-att-src="image_data_uri(o.sale_type_id.sale_type_image)" | ||
alt="Logo" | ||
/> | ||
</t> | ||
<t | ||
t-elif="o._name == 'stock.picking' and o.picking_type_id.code == 'outgoing' and o.group_id and o.group_id.sale_id and o.group_id.sale_id.type_id and o.group_id.sale_id.type_id.sale_type_image" | ||
> | ||
<img | ||
t-att-src="image_data_uri(o.group_id.sale_id.type_id.sale_type_image)" | ||
alt="Logo" | ||
/> | ||
</t> | ||
<t t-elif="o._name == 'sale.order' and o.type_id.sale_type_image"> | ||
<img t-att-src="image_data_uri(o.type_id.sale_type_image)" alt="Logo" /> | ||
</t> | ||
<t t-else=""> | ||
<img | ||
t-if="company.logo" | ||
t-att-src="image_data_uri(company.logo)" | ||
alt="Logo" | ||
/> | ||
</t> | ||
|
||
</img> | ||
</template> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_order_type_image | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-28 06:03+0000\n" | ||
"PO-Revision-Date: 2024-10-28 06:03+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: sale_order_type_image | ||
#: model_terms:ir.ui.view,arch_db:sale_order_type_image.external_layout_standard | ||
msgid "Logo" | ||
msgstr "" | ||
|
||
#. module: sale_order_type_image | ||
#: model:ir.model.fields,field_description:sale_order_type_image.field_sale_order_type__sale_type_image | ||
msgid "Sale Type Image" | ||
msgstr "" | ||
|
||
#. module: sale_order_type_image | ||
#: model:ir.model,name:sale_order_type_image.model_sale_order_type | ||
msgid "Type of sale order" | ||
msgstr "Tipus de comanda de venda" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_order_type_image | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-28 06:04+0000\n" | ||
"PO-Revision-Date: 2024-10-28 06:04+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: sale_order_type_image | ||
#: model_terms:ir.ui.view,arch_db:sale_order_type_image.external_layout_standard | ||
msgid "Logo" | ||
msgstr "" | ||
|
||
#. module: sale_order_type_image | ||
#: model:ir.model.fields,field_description:sale_order_type_image.field_sale_order_type__sale_type_image | ||
msgid "Sale Type Image" | ||
msgstr "" | ||
|
||
#. module: sale_order_type_image | ||
#: model:ir.model,name:sale_order_type_image.model_sale_order_type | ||
msgid "Type of sale order" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_order_type_image | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-28 06:04+0000\n" | ||
"PO-Revision-Date: 2024-10-28 06:04+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: sale_order_type_image | ||
#: model_terms:ir.ui.view,arch_db:sale_order_type_image.external_layout_standard | ||
msgid "Logo" | ||
msgstr "Logo" | ||
|
||
#. module: sale_order_type_image | ||
#: model:ir.model.fields,field_description:sale_order_type_image.field_sale_order_type__sale_type_image | ||
msgid "Sale Type Image" | ||
msgstr "Imagen tipo venta" | ||
|
||
#. module: sale_order_type_image | ||
#: model:ir.model,name:sale_order_type_image.model_sale_order_type | ||
msgid "Type of sale order" | ||
msgstr "Tipo de pedido de venta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_order_type_image | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-28 06:04+0000\n" | ||
"PO-Revision-Date: 2024-10-28 06:04+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: sale_order_type_image | ||
#: model_terms:ir.ui.view,arch_db:sale_order_type_image.external_layout_standard | ||
msgid "Logo" | ||
msgstr "" | ||
|
||
#. module: sale_order_type_image | ||
#: model:ir.model.fields,field_description:sale_order_type_image.field_sale_order_type__sale_type_image | ||
msgid "Sale Type Image" | ||
msgstr "" | ||
|
||
#. module: sale_order_type_image | ||
#: model:ir.model,name:sale_order_type_image.model_sale_order_type | ||
msgid "Type of sale order" | ||
msgstr "Type de bon de commande" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_order_type_image | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-28 06:03+0000\n" | ||
"PO-Revision-Date: 2024-10-28 06:03+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: sale_order_type_image | ||
#: model_terms:ir.ui.view,arch_db:sale_order_type_image.external_layout_standard | ||
msgid "Logo" | ||
msgstr "" | ||
|
||
#. module: sale_order_type_image | ||
#: model:ir.model.fields,field_description:sale_order_type_image.field_sale_order_type__sale_type_image | ||
msgid "Sale Type Image" | ||
msgstr "" | ||
|
||
#. module: sale_order_type_image | ||
#: model:ir.model,name:sale_order_type_image.model_sale_order_type | ||
msgid "Type of sale order" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import sale_order_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright 2024 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo import fields, models | ||
|
||
|
||
class SaleOrderType(models.Model): | ||
_inherit = "sale.order.type" | ||
|
||
sale_type_image = fields.Binary(copy=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record id="sot_sale_order_type_form_view" model="ir.ui.view"> | ||
<field name="model">sale.order.type</field> | ||
<field name="inherit_id" ref="sale_order_type.sot_sale_order_type_form_view" /> | ||
<field name="arch" type="xml"> | ||
<field name="description" position="before"> | ||
<group> | ||
<group> | ||
<field | ||
name="sale_type_image" | ||
widget="image" | ||
class="oe_avatar" | ||
/> | ||
</group> | ||
<group /> | ||
</group> | ||
</field> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../sale_order_type_image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |