diff --git a/ext/custom-addons/dp_reports_sale/reports/sale.xml b/ext/custom-addons/dp_reports_sale/reports/sale.xml index 9071324e..5b3b63c2 100644 --- a/ext/custom-addons/dp_reports_sale/reports/sale.xml +++ b/ext/custom-addons/dp_reports_sale/reports/sale.xml @@ -107,6 +107,9 @@
+ +
Lieferdatum: +
diff --git a/ext/custom-addons/dp_sale_delivery_date/LICENSE b/ext/custom-addons/dp_sale_delivery_date/LICENSE new file mode 100644 index 00000000..272c64b8 --- /dev/null +++ b/ext/custom-addons/dp_sale_delivery_date/LICENSE @@ -0,0 +1,27 @@ +Odoo Proprietary License v1.0 + +This software and associated files (the "Software") may only be used (executed, +modified, executed after modifications) if you have purchased a valid license +from the authors, typically via Odoo Apps, or if you have received a written +agreement from the authors of the Software (see the COPYRIGHT file). + +You may develop Odoo modules that use the Software as a library (typically by +depending on it, importing it and using its resources), but without copying any +source code or material from the Software. You may distribute those modules +under the license of your choice, provided that this license is compatible with +the terms of the Odoo Proprietary License (For example: LGPL, MIT, +or proprietary licenses similar to this one). + +It is forbidden to publish, distribute, sublicense, or sell copies of the Software +or modified copies of the Software. + +The above copyright notice and this permission notice must be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/ext/custom-addons/dp_sale_delivery_date/__init__.py b/ext/custom-addons/dp_sale_delivery_date/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/ext/custom-addons/dp_sale_delivery_date/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/ext/custom-addons/dp_sale_delivery_date/__manifest__.py b/ext/custom-addons/dp_sale_delivery_date/__manifest__.py new file mode 100644 index 00000000..327cf980 --- /dev/null +++ b/ext/custom-addons/dp_sale_delivery_date/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2018-Today datenpol gmbh() +# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). + + +# noinspection PyStatementEffect +{ + 'name': 'Dp Sale Delivery Date', + 'summary' : 'Shows the delivery date in the sale order', + 'version': '11.0.1.0.0', + 'license': 'OPL-1', + 'author': 'datenpol gmbh', + 'support': 'office@datenpol.at', + 'website': 'https://www.datenpol.at', + 'depends': [ + 'sale_stock', + ], + 'data': [ + 'views/sale_order_line.xml', + ], + 'installable': True, + 'auto_install': False, +} diff --git a/ext/custom-addons/dp_sale_delivery_date/models/__init__.py b/ext/custom-addons/dp_sale_delivery_date/models/__init__.py new file mode 100644 index 00000000..8eb9d1d4 --- /dev/null +++ b/ext/custom-addons/dp_sale_delivery_date/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order_line diff --git a/ext/custom-addons/dp_sale_delivery_date/models/sale_order_line.py b/ext/custom-addons/dp_sale_delivery_date/models/sale_order_line.py new file mode 100644 index 00000000..3d70b805 --- /dev/null +++ b/ext/custom-addons/dp_sale_delivery_date/models/sale_order_line.py @@ -0,0 +1,20 @@ +# Copyright 2018-Today datenpol gmbh () +# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). + +from odoo import api, fields, models, _ + + +class SaleOrderLine(models.Model): + _inherit = 'sale.order.line' + + delivery_date = fields.Date('Lieferdatum', compute='_compute_delivery_date') + + @api.multi + def _compute_delivery_date(self): + for line in self: + stock_move = self.env['stock.move'] + move = stock_move.search([('sale_line_id', '=', line.id), ('state', 'not in', ['cancel'])]) + if move: + line.delivery_date = move[0].date + else: + line.delivery_date = False diff --git a/ext/custom-addons/dp_sale_delivery_date/static/description/icon.png b/ext/custom-addons/dp_sale_delivery_date/static/description/icon.png new file mode 100644 index 00000000..8387d765 Binary files /dev/null and b/ext/custom-addons/dp_sale_delivery_date/static/description/icon.png differ diff --git a/ext/custom-addons/dp_sale_delivery_date/static/src/img/favicon.ico b/ext/custom-addons/dp_sale_delivery_date/static/src/img/favicon.ico new file mode 100644 index 00000000..3c33e99b Binary files /dev/null and b/ext/custom-addons/dp_sale_delivery_date/static/src/img/favicon.ico differ diff --git a/ext/custom-addons/dp_sale_delivery_date/views/sale_order_line.xml b/ext/custom-addons/dp_sale_delivery_date/views/sale_order_line.xml new file mode 100644 index 00000000..b8be899d --- /dev/null +++ b/ext/custom-addons/dp_sale_delivery_date/views/sale_order_line.xml @@ -0,0 +1,18 @@ + + + + + + + view_sale_order_form + sale.order + + + + + + + + +