From 43da993030fcbde5387f53fbc79f9f88f6c58aa4 Mon Sep 17 00:00:00 2001 From: Ahmed Aly Date: Mon, 26 Mar 2018 18:13:01 +0200 Subject: [PATCH] Feedback 11,12,13,14 + 10 --- ext/custom-addons/dp_custom/models/account.py | 6 + ext/custom-addons/dp_custom/models/sale.py | 2 +- .../dp_custom/views/res_partner_views.xml | 14 +- .../dp_custom/views/sale_views.xml | 22 +-- .../dp_reports_account/__manifest__.py | 6 +- .../models/account_invoice.py | 6 + .../dp_reports_account/reports/invoice.xml | 143 ++++++++++-------- .../models/sale_order.py | 3 +- setup/lib/config_tza.py | 2 +- 9 files changed, 128 insertions(+), 76 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/account.py b/ext/custom-addons/dp_custom/models/account.py index 6839bd1e..4fb42989 100644 --- a/ext/custom-addons/dp_custom/models/account.py +++ b/ext/custom-addons/dp_custom/models/account.py @@ -67,3 +67,9 @@ class AccountInvoice(models.Model): if line.uom_id == self.env.ref('product.product_uom_unit'): # wenn die Mengeneinheit Stk. ist num_items += line.quantity record.num_items = num_items + + @api.multi + def invoice_print(self): + self.ensure_one() + self.sent = True + return self.env.ref('account.account_invoices_without_payment').report_action(self) diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index 10c21999..2deb215f 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -318,7 +318,7 @@ class SaleOrder(models.Model): @api.multi def action_confirm(self): # change name on order confirmation - if self.state == 'draft' and self.name.startswith('ATOF'): + if self.name.startswith('ATOF'): new_name = re.sub(r"^ATOF", "ATOC", self.name) self.name = new_name return super(SaleOrder, self).action_confirm() diff --git a/ext/custom-addons/dp_custom/views/res_partner_views.xml b/ext/custom-addons/dp_custom/views/res_partner_views.xml index 098519b9..59533b65 100644 --- a/ext/custom-addons/dp_custom/views/res_partner_views.xml +++ b/ext/custom-addons/dp_custom/views/res_partner_views.xml @@ -74,9 +74,21 @@ tree,form + + + + diff --git a/ext/custom-addons/dp_custom/views/sale_views.xml b/ext/custom-addons/dp_custom/views/sale_views.xml index 5afb2f5b..eda38df0 100644 --- a/ext/custom-addons/dp_custom/views/sale_views.xml +++ b/ext/custom-addons/dp_custom/views/sale_views.xml @@ -67,17 +67,17 @@ - view.sales.order.filter.assembly - sale.order - - - - + view.sales.order.filter.assembly + sale.order + + + + + + + + - - - - - + diff --git a/ext/custom-addons/dp_reports_account/__manifest__.py b/ext/custom-addons/dp_reports_account/__manifest__.py index f4e7cc68..57e19c78 100644 --- a/ext/custom-addons/dp_reports_account/__manifest__.py +++ b/ext/custom-addons/dp_reports_account/__manifest__.py @@ -4,13 +4,15 @@ { 'name': 'datepol Report-Anpassungen', 'category': 'Custom', - 'version': '1.0', + 'version': '11.0.1.0.0', 'summary': """Individuelle Report Anpassungen""", 'description': """Individuelle Report Anpassungen""", 'author': 'datenpol gmbh', 'website': 'http://www.datenpol.at/', 'depends': [ - 'account_invoicing' + 'account_invoicing', + 'report_intrastat', + 'dp_reports', ], 'data': [ 'reports/invoice.xml', diff --git a/ext/custom-addons/dp_reports_account/models/account_invoice.py b/ext/custom-addons/dp_reports_account/models/account_invoice.py index 91fcacb5..75950b9c 100644 --- a/ext/custom-addons/dp_reports_account/models/account_invoice.py +++ b/ext/custom-addons/dp_reports_account/models/account_invoice.py @@ -18,4 +18,10 @@ class AccountInvoice(models.Model): uncategorized = page.pop(idx2) if uncategorized: res[idx1] = [uncategorized] + res[idx1] + for page in res: + for category in page: + price_subtotal = 0.0 + for line in category['lines']: + price_subtotal += line.price_subtotal + category['price_subtotal'] = price_subtotal return res diff --git a/ext/custom-addons/dp_reports_account/reports/invoice.xml b/ext/custom-addons/dp_reports_account/reports/invoice.xml index 0f667178..4fa6ccea 100644 --- a/ext/custom-addons/dp_reports_account/reports/invoice.xml +++ b/ext/custom-addons/dp_reports_account/reports/invoice.xml @@ -1,34 +1,36 @@ - - - - + + + + + + + Rechnungen diff --git a/ext/custom-addons/dp_sale_delivery_date/models/sale_order.py b/ext/custom-addons/dp_sale_delivery_date/models/sale_order.py index be42aa08..2603a2b8 100644 --- a/ext/custom-addons/dp_sale_delivery_date/models/sale_order.py +++ b/ext/custom-addons/dp_sale_delivery_date/models/sale_order.py @@ -12,7 +12,8 @@ class SaleOrder(models.Model): @api.multi def _compute_delivery_date(self): for order in self: - lines = order.order_line.sorted(key=lambda d: d.delivery_date) + lines = order.order_line.filtered(lambda d: d.delivery_date) + lines = lines.sorted(key=lambda d: fields.Date.from_string(d.delivery_date)) if lines: order.delivery_date = lines[0].delivery_date diff --git a/setup/lib/config_tza.py b/setup/lib/config_tza.py index 2abaed7b..13988907 100644 --- a/setup/lib/config_tza.py +++ b/setup/lib/config_tza.py @@ -23,7 +23,7 @@ class ConfigTZA(Config): 'vat': 'ATU 54619104', 'vat_check_vies': True, 'logo': '../ext/custom-addons/dp_custom/static/src/img/logo.png', - 'eori_nr': 'ATEOSI 0000 11273', + 'eori_nr': 'ATEOS 100011273', #'favicon_backend': '../ext/custom-addons/dp_custom/static/src/img/favicon.ico', #'favicon_backend_mimetype': 'image/x-icon' }