From 7b0e135f9afdce175bdb502991822aff5040606a Mon Sep 17 00:00:00 2001 From: Andreas Wabro Date: Tue, 11 Sep 2018 16:17:34 +0200 Subject: [PATCH 1/8] =?UTF-8?q?F=C3=BCgt=20neues=20Environment=20f=C3=BCr?= =?UTF-8?q?=20Instanz=20allinonept=20hinzu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/connect-allinonept.sh | 5 ++ setup/lib/config_allinonept.py | 88 +++++++++++++++++++ setup/lib/environments.py | 3 + setup/odoo-playboook/hosts | 4 +- setup/odoo-playboook/playbook-allinonept.yml | 36 ++++++++ .../roles/odoo/tasks/install.yml | 15 +--- 6 files changed, 136 insertions(+), 15 deletions(-) create mode 100755 setup/connect-allinonept.sh create mode 100644 setup/lib/config_allinonept.py create mode 100644 setup/odoo-playboook/playbook-allinonept.yml diff --git a/setup/connect-allinonept.sh b/setup/connect-allinonept.sh new file mode 100755 index 00000000..01fa5837 --- /dev/null +++ b/setup/connect-allinonept.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +PORT=9002 +echo "Zugriff: http://localhost:$PORT" +ssh -p 3336 odoo-prod@5.9.67.35 -L $PORT:localhost:8069 diff --git a/setup/lib/config_allinonept.py b/setup/lib/config_allinonept.py new file mode 100644 index 00000000..27902e31 --- /dev/null +++ b/setup/lib/config_allinonept.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- + +from .config import Config + + +class ConfigAllInOnePT(Config): + def __init__(self): + super(ConfigAllInOnePT, self).__init__() + + self.company_xmlid = 'dp_custom.glaser_and_co_company' + + self.company_data = { + 'name': 'TZ Technik Solution GesmbH', + 'street': 'Althöflein 9/2', + 'street2': False, + 'city': 'Großkrut', + 'zip': '2143', + 'phone': False, + 'email': False, + 'website': False, + 'company_registry': False, + 'country_id': 'at', # 'de' für Deutschland + 'vat': False, + 'vat_check_vies': True, + 'logo': '../ext/custom-addons/dp_custom/static/src/img/logo.png', + #'favicon_backend': '../ext/custom-addons/dp_custom/static/src/img/favicon.ico', + #'favicon_backend_mimetype': 'image/x-icon' + } + + # Nur für Lager + # Wenn nicht gesetzt, dann wird der Firmenname genommen + self.warehouse_name = 'TZ Technik' + self.warehouse_code = 'TZ Technik' + + self.tax_settings = { + 'default_sale_tax_id': self.default_sales_tax + } + + self.sequences = { + 'sale.order': { + # 'number_next_actual': 1, + 'prefix': 'ATOF%(range_y)s-', + 'padding': 6, + 'use_date_range': True, + 'monthly_date_range': False + }, + 'account.invoice': { + # 'number_next_actual': 0001, + 'prefix': '%(range_year)s-', + 'padding': 6, + 'use_date_range': True, + }, + # Wenn 'account.invoice_refund' auskommentiert ist, dann wird + # für die Gutschrift der selbe Nummernkreis verwendet + # 'account.invoice_refund': { + # # 'number_next_actual': 0001, + # 'name': 'Gutschriften', + # 'implementation': 'no_gap', + # 'prefix': 'GL%(y)s', + # 'padding': 4, + # 'use_date_range': True, + # 'monthly_date_range': False + # }, + # 'picking.out': { + # # 'number_next_actual': 1, + # 'prefix': 'LS-', + # 'padding': 5, + # }, + # 'picking.in': { + # #'number_next_actual': 1, + # 'prefix': 'LS/IN/', + # 'padding': 4, + # }, + # 'picking.int': { + # #'number_next_actual': 1, + # 'prefix': 'LS/INT/', + # 'padding': 4, + # }, + # 'purchase.order': { + # 'number_next_actual': 1, + # 'prefix': 'B-', + # 'padding': 5, + # }, + } + + self.multi_company_settings = { + 'chart_template_id': ('xmlid', 'l10n_at.austria_chart_template') + } diff --git a/setup/lib/environments.py b/setup/lib/environments.py index 177f0f3f..86f641a0 100644 --- a/setup/lib/environments.py +++ b/setup/lib/environments.py @@ -2,6 +2,7 @@ from .config_tza import ConfigTZA from .config_glaser import ConfigGlaser +from .config_allinonept import ConfigAllInOnePT class Environment(): def __init__(self, host, port, dbname, username, pwd=None, super_admin_pw=None, demo=False, config=False): @@ -66,4 +67,6 @@ ENVIRONMENTS = { 'prod': Environment('http://localhost', '9002', 'odoo-prod', 'admin', config = ConfigTZA()), 'prod-glaser': Environment('http://localhost', '9002', 'odoo-prod', 'glaser-admin', config = ConfigGlaser()), + + 'allinonept': Environment('http://localhost', '9002', 'allinonept', 'admin', config=ConfigAllInOnePT()), } diff --git a/setup/odoo-playboook/hosts b/setup/odoo-playboook/hosts index a8b00ee4..e7c1e755 100644 --- a/setup/odoo-playboook/hosts +++ b/setup/odoo-playboook/hosts @@ -1,5 +1,5 @@ [local] localhost ansible_connection=local -[tzaustria] -5.9.67.35:3333 ansible_connection=ssh ansible_user=datenpol \ No newline at end of file +[tzaustria_allinonept] +5.9.67.35:3336 ansible_connection=ssh ansible_user=datenpol diff --git a/setup/odoo-playboook/playbook-allinonept.yml b/setup/odoo-playboook/playbook-allinonept.yml new file mode 100644 index 00000000..734f5142 --- /dev/null +++ b/setup/odoo-playboook/playbook-allinonept.yml @@ -0,0 +1,36 @@ +--- +# This playbook deploys the whole application stack in this site. + +- name: Odoo Prod + hosts: tzaustria_allinonept + become: yes + # deactivate gather_facts when python is not installed on server + # gather_facts: false + # pre_tasks: + # - raw: which python || apt-get update + # - raw: (which python && which aptitude) || apt-get install -y python python-apt aptitude + # - setup: # aka gather_facts + roles: + - role: odoo + odoo_repo_rev: master + odoo_user: odoo-prod + odoo_service: odoo-prod + odoo_version: 11.0 + odoo_config_http_port: 8069 + odoo_config_admin_passwd: ainbeyos + odoo_config_db_passwd: aroneyna + odoo_general_user_passwd: elewcaph + odoo_instance: "prod" + odoo_config_dbfilter: "^{{ odoo_instance }}_.*" + # remove the following paramters to install odoo from github + odoo_repo_url: "ssh://git@gitlab.datenpol.at:122/odoo/tz-austria.git" + odoo_config_addons_path: + - "/data/{{ odoo_user }}/odoo/ext/odoo/odoo/addons" + - "/data/{{ odoo_user }}/odoo/ext/odoo/addons" + - "/data/{{ odoo_user }}/odoo/ext/custom-addons" + - "/data/{{ odoo_user }}/odoo/ext/3rd-party-addons" + odoo_workdir: "/data/{{ odoo_user }}/odoo" + odoo_rootdir: "/data/{{ odoo_user }}/odoo" + odoo_coredir: "/data/{{ odoo_user }}/odoo/ext/odoo" + odoo_config_file: "/data/{{ odoo_user }}/{{ odoo_service }}.conf" + odoo_config_data_dir: "/data/{{ odoo_user }}/.local/share/Odoo" diff --git a/setup/odoo-playboook/roles/odoo/tasks/install.yml b/setup/odoo-playboook/roles/odoo/tasks/install.yml index 1e0c4f19..c7dc994e 100644 --- a/setup/odoo-playboook/roles/odoo/tasks/install.yml +++ b/setup/odoo-playboook/roles/odoo/tasks/install.yml @@ -19,23 +19,12 @@ tags: - odoo_user -- name: Add general odoo user - user: name=odoo shell=/bin/bash - password={{ odoo_general_user_passwd }} update_password=on_create - move_home=yes - home=/data/odoo - - become: yes - become_method: "sudo" - tags: - - odoo_user - -- name: Allow general odoo user to have passwordless sudo +- name: Allow odoo user to have passwordless sudo for restart lineinfile: dest: /etc/sudoers state: present regexp: '^odoo$' - line: 'odoo ALL=(ALL:ALL) NOPASSWD: ALL' + line: '{{ odoo_instance }} ALL=(root) NOPASSWD: /etc/init.d/{{ odoo_instance }}' validate: visudo -cf %s - name: Create log directory From 85bfc5dc0ceb5331c01c8fccad2375bff6e5ea00 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Fri, 14 Sep 2018 11:33:27 +0200 Subject: [PATCH 2/8] allow entry of intrastat_id even if there is no lot --- ext/custom-addons/dp_custom/models/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/account.py b/ext/custom-addons/dp_custom/models/account.py index 661410bf..5167c948 100644 --- a/ext/custom-addons/dp_custom/models/account.py +++ b/ext/custom-addons/dp_custom/models/account.py @@ -62,8 +62,8 @@ class AccountInvoiceLine(models.Model): self.env['stock.production.lot'].browse([lot_id.id]).write({ 'intrastat_id': vals.get('intrastat_id') }) - elif vals.get('intrastat_id', False) and not lot_id: - raise UserError(_('Der Intrastrat Code kann nur gesetzt werden wenn ein Lot angegeben wurde.')) + # elif vals.get('intrastat_id', False) and not lot_id: + # raise UserError(_('Der Intrastrat Code kann nur gesetzt werden wenn ein Lot angegeben wurde.')) return res From 8dd72576acef22b4df16fa4d1bfd77677f88d8d2 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Fri, 14 Sep 2018 11:34:26 +0200 Subject: [PATCH 3/8] print serial_no on invoice if a product has serial_no_tracking --- .../models/account_invoice.py | 46 ++++++++++++++++++- .../dp_reports_account/reports/invoice.xml | 8 ++++ 2 files changed, 53 insertions(+), 1 deletion(-) 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 6afef74e..d354d342 100644 --- a/ext/custom-addons/dp_reports_account/models/account_invoice.py +++ b/ext/custom-addons/dp_reports_account/models/account_invoice.py @@ -1,7 +1,7 @@ # 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, models +from odoo import api, fields, models class AccountInvoice(models.Model): @@ -28,3 +28,47 @@ class AccountInvoice(models.Model): if sale_order: category['order_id'] = sale_order return res + +class AccountInvoiceLine(models.Model): + _inherit = "account.invoice.line" + + order_line_ids = fields.Many2many( + comodel_name='sale.order.line', + relation='sale_order_line_invoice_rel', + column1='invoice_line_id', + column2='order_line_id', + string='Order Lines', + readonly=True, + ) + + prod_lot_ids = fields.Many2many( + comodel_name='stock.production.lot', + compute='_compute_prod_lots', + string="Production Lots", + ) + + lot_formatted_note = fields.Html( + string='Formatted Note', + compute='_compute_line_lots', + ) + + @api.multi + def _compute_prod_lots(self): + for line in self: + if not line.order_line_ids: + return + line.prod_lot_ids = self.mapped( + 'order_line_ids.move_ids.move_line_ids.lot_id') + print('End') + + @api.multi + def _compute_line_lots(self): + for line in self: + if line.prod_lot_ids: + note = u'
    ' + note += u' '.join([ + u'
  • S/N {0}
  • '.format(lot.name) + for lot in line.prod_lot_ids + ]) + note += u'
' + line.lot_formatted_note = note diff --git a/ext/custom-addons/dp_reports_account/reports/invoice.xml b/ext/custom-addons/dp_reports_account/reports/invoice.xml index 30ce88ad..6bf5d1b5 100644 --- a/ext/custom-addons/dp_reports_account/reports/invoice.xml +++ b/ext/custom-addons/dp_reports_account/reports/invoice.xml @@ -85,6 +85,8 @@ + @@ -182,6 +184,12 @@
+ + Serien Nr.: + + + +

From 96b4126d591095fff79397419102463bab8752be Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Fri, 14 Sep 2018 11:54:10 +0200 Subject: [PATCH 4/8] change order of printout (serial_no after description) --- ext/custom-addons/dp_reports_account/reports/invoice.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/custom-addons/dp_reports_account/reports/invoice.xml b/ext/custom-addons/dp_reports_account/reports/invoice.xml index 6bf5d1b5..e2d37de2 100644 --- a/ext/custom-addons/dp_reports_account/reports/invoice.xml +++ b/ext/custom-addons/dp_reports_account/reports/invoice.xml @@ -184,13 +184,14 @@
+ +
Serien Nr.:
-

From f546f09ef96de6743e1ed59a57f3d759d429a6cf Mon Sep 17 00:00:00 2001 From: Ahmed Aly Date: Tue, 25 Sep 2018 10:41:06 +0200 Subject: [PATCH 5/8] Fix in 3rd-party Addon, when saving the res.settings --- ext/3rd-party-addons/wk_debrand_odoo/models/res_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/3rd-party-addons/wk_debrand_odoo/models/res_config.py b/ext/3rd-party-addons/wk_debrand_odoo/models/res_config.py index a561511d..96417107 100644 --- a/ext/3rd-party-addons/wk_debrand_odoo/models/res_config.py +++ b/ext/3rd-party-addons/wk_debrand_odoo/models/res_config.py @@ -46,7 +46,7 @@ class ResConfigSettings(models.TransientModel): def set_values(self): super(ResConfigSettings, self).set_values() IrDefault = self.env['ir.default'].sudo() - IrDefault.set('res.config.settings', "wk_favicon", self.wk_favicon.decode("utf-8")) + IrDefault.set('res.config.settings', "wk_favicon", self.wk_favicon.decode("utf-8") if self.wk_favicon else False) IrDefault.set('res.config.settings', "title_brand", self.title_brand) IrDefault.set('res.config.settings', "odoo_text_replacement", self.odoo_text_replacement) @@ -62,4 +62,4 @@ class ResConfigSettings(models.TransientModel): title_brand = title_brand, odoo_text_replacement = odoo_text_replacement, ) - return res \ No newline at end of file + return res From 60665a2738031be75b10a65f459943f3d458f47f Mon Sep 17 00:00:00 2001 From: Ahmed Aly Date: Tue, 25 Sep 2018 10:42:46 +0200 Subject: [PATCH 6/8] Updated setup_website script --- setup/lib/config_allinonept.py | 12 +++- setup/lib/config_tza.py | 13 ++++ setup/lib/functions.py | 120 +++++++++++++-------------------- 3 files changed, 71 insertions(+), 74 deletions(-) diff --git a/setup/lib/config_allinonept.py b/setup/lib/config_allinonept.py index 27902e31..e76a3f62 100644 --- a/setup/lib/config_allinonept.py +++ b/setup/lib/config_allinonept.py @@ -23,8 +23,8 @@ class ConfigAllInOnePT(Config): 'vat': False, 'vat_check_vies': True, 'logo': '../ext/custom-addons/dp_custom/static/src/img/logo.png', - #'favicon_backend': '../ext/custom-addons/dp_custom/static/src/img/favicon.ico', - #'favicon_backend_mimetype': 'image/x-icon' + # 'favicon_backend': '../ext/custom-addons/dp_custom/static/src/img/favicon.ico', + # 'favicon_backend_mimetype': 'image/x-icon' } # Nur für Lager @@ -86,3 +86,11 @@ class ConfigAllInOnePT(Config): self.multi_company_settings = { 'chart_template_id': ('xmlid', 'l10n_at.austria_chart_template') } + + self.websites = [ + { + 'name': 'Prosolutions Online', + 'domain': 'www.prosolutions.online', + 'company_xml_id': 'base.main_company' + }, + ] diff --git a/setup/lib/config_tza.py b/setup/lib/config_tza.py index 4f114228..344a3673 100644 --- a/setup/lib/config_tza.py +++ b/setup/lib/config_tza.py @@ -89,3 +89,16 @@ class ConfigTZA(Config): # 'padding': 5, # }, } + + self.websites = [ + { + 'name': 'IR Heizpaneele', + 'domain': 'www.irheizpaneele.at', + 'company_xml_id': 'base.main_company' + }, + { + 'name': 'Heizpaneele', + 'domain': 'www.heizpaneele.at', + 'company_xml_id': 'base.main_company' + }, + ] diff --git a/setup/lib/functions.py b/setup/lib/functions.py index 52970c7d..964b6fb0 100644 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -264,79 +264,48 @@ class DatenpolFunctions(object): ir_model_obj = self.odoo.env['ir.model.data'] crm_team_obj = self.odoo.env['crm.team'] - # if not ir_model_obj.search([('module', '=', 'website_multi_theme'), ('name', '=', 'clarico_multi')]): - # # Create Theme - # clarico_theme = self.odoo.env['website.theme'].create({ - # 'name': 'Multiwebsite Clarico Theme', - # 'converted_theme_addon': 'theme_clarico' - # }) - # - # vals = { - # 'model': 'website.theme', - # 'module': 'website_multi_theme', - # 'name': 'clarico_multi', - # 'res_id': str(clarico_theme), - # 'noupdate': False, - # } - # ir_model_obj.create(vals) - # - # clarico_theme = self.odoo.env.ref('website_multi_theme.clarico_multi') + websites = self.config.websites - # self.odoo.env.ref('website.default_website').multi_theme_reload() + # create salesteam + for idx, website in enumerate(websites): + cr_team = crm_team_obj.search([('name', '=', website['name'])]) + if not cr_team: + crm_team_vals = { + 'name': website['name'], + 'team_type': 'website', + 'company_id': self.odoo.env.ref(website['company_xml_id']).id, + } + cr_team = crm_team_obj.browse([crm_team_obj.create(crm_team_vals)]) + else: + cr_team = crm_team_obj.browse(cr_team) - # create Salesteam for all websites - cr_team_ir_heizpaneel = crm_team_obj.search([('name', '=', 'IR Heizpaneele')]) - if not cr_team_ir_heizpaneel: - crm_team_vals = { - 'name': 'IR Heizpaneele', - 'team_type': 'website', - 'company_id': self.odoo.env.ref('base.main_company').id, + website_vals = { + 'name': website['name'], + 'domain': website['domain'], + 'company_id': self.odoo.env.ref(website['company_xml_id']).id, + 'salesteam_id': cr_team.id, + 'multi_theme_id': self.odoo.env.ref('website_multi_theme.theme_default').id } - cr_team_ir_heizpaneel = crm_team_obj.browse([crm_team_obj.create(crm_team_vals)]) - else: - cr_team_ir_heizpaneel = crm_team_obj.browse(cr_team_ir_heizpaneel) - cr_team_heizpaneel = crm_team_obj.search([('name', '=', 'Heizpaneele')]) - if not cr_team_heizpaneel: - crm_team_vals = { - 'name': 'Heizpaneele', - 'team_type': 'website', - 'company_id': self.odoo.env.ref('base.main_company').id, - } - cr_team_heizpaneel = crm_team_obj.browse([crm_team_obj.create(crm_team_vals)]) - else: - cr_team_heizpaneel = crm_team_obj.browse(cr_team_heizpaneel) - - # Create and configure Websites - default_website = self.odoo.env.ref('website.default_website') - default_website.write({ - 'name': 'IR Heizpaneele', - 'domain': 'www.irheizpaneele.at', - 'company_id': self.odoo.env.ref('base.main_company').id, - 'salesteam_id': cr_team_ir_heizpaneel.id, - 'multi_theme_id': self.odoo.env.ref('website_multi_theme.theme_default').id - }) - - heizpaneele_vals = { - 'name': 'Heizpaneele', - 'domain': 'www.heizpaneele.at', - 'company_id': self.odoo.env.ref('base.main_company').id, - 'salesteam_id': cr_team_heizpaneel.id, - 'multi_theme_id': self.odoo.env.ref('website_multi_theme.theme_default').id - } - if not ir_model_obj.search([('module', '=', 'dp_website'), ('name', '=', 'tz_heizpaneele')]): - heizpaneele = self.odoo.env['website'].create(heizpaneele_vals) - vals = { - 'model': 'website', - 'module': 'dp_website', - 'name': 'tz_heizpaneele', - 'res_id': str(heizpaneele), - 'noupdate': True, - } - ir_model_obj.create(vals) - else: - heizpaneele = self.odoo.env.ref('dp_website.tz_heizpaneele') - heizpaneele.write(heizpaneele_vals) + # Create and configure Websites + if idx == 0: + default_website = self.odoo.env.ref('website.default_website') + default_website.write(website_vals) + else: + website_id = website['name'].lower().replace('-', '_').replace(' ', '_').replace('.', '_') + if not ir_model_obj.search([('module', '=', 'dp_website'), ('name', '=', website_id)]): + created_website = self.odoo.env['website'].create(website_vals) + vals = { + 'model': 'website', + 'module': 'dp_website', + 'name': website_id, + 'res_id': str(created_website), + 'noupdate': True, + } + ir_model_obj.create(vals) + else: + created_website = self.odoo.env.ref('dp_website.'+website_id) + created_website.write(website_vals) res_settings = self.odoo.env['res.config.settings'] vals = res_settings.default_get([]) @@ -349,7 +318,7 @@ class DatenpolFunctions(object): wizard_id = res_settings.create(vals) res_settings.execute(wizard_id) - # + # Make all pricelists not selectable self.odoo.env['product.pricelist'].browse(self.odoo.env['product.pricelist'].search([])).write({ 'selectable': False }) @@ -375,9 +344,16 @@ class DatenpolFunctions(object): def configure_payment_providers(self): """Zahlungsmethoden konfigurieren""" + websites = self.config.websites + website_ids = [] + for idx, website in enumerate(websites): + if idx == 0: + website_ids.append(self.odoo.env.ref('website.default_website').id) + else: + website_xml_id = website['name'].lower().replace('-', '_').replace(' ', '_').replace('.', '_') + website_ids.append(self.odoo.env.ref('dp_website.'+website_xml_id).id) vals = { - 'website_ids': [(6, 0, [self.odoo.env.ref('dp_website.tz_heizpaneele').id, - self.odoo.env.ref('website.default_website').id])] + 'website_ids': [(6, 0, website_ids)] } paypal = self.odoo.env.ref('payment.payment_acquirer_paypal') From 408c64df44bc03b3215a72e84874c965cb684ed0 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Wed, 3 Oct 2018 11:16:13 +0200 Subject: [PATCH 7/8] change behaviour of global dicount (allow use for draft & sent) Display weight in order_view correct misspelling --- .../global_discount/models/sale.py | 8 +++--- .../global_discount/views/sale_view.xml | 12 ++++----- ext/custom-addons/dp_custom/models/product.py | 2 +- ext/custom-addons/dp_custom/models/sale.py | 27 +++++++++++++++++++ .../dp_custom/views/res_partner_views.xml | 1 + .../dp_custom/views/sale_views.xml | 6 ++++- 6 files changed, 44 insertions(+), 12 deletions(-) diff --git a/ext/3rd-party-addons/global_discount/models/sale.py b/ext/3rd-party-addons/global_discount/models/sale.py index 250b25fa..25b3d9f9 100755 --- a/ext/3rd-party-addons/global_discount/models/sale.py +++ b/ext/3rd-party-addons/global_discount/models/sale.py @@ -6,11 +6,11 @@ from odoo.exceptions import UserError class SaleOrder(models.Model): _inherit = "sale.order" - global_discount = fields.Boolean("Add Global Discount", readonly=True, states={'draft': [('readonly', False)]},) + global_discount = fields.Boolean("Add Global Discount", readonly=True, states={'draft': [('readonly', False),],'sent': [('readonly', False)]},) discount_type = fields.Selection([('fixed','Fixed'),('percentage','Percentage')], - "Discount Type", readonly=True, states={'draft': [('readonly', False)]}, default='fixed') - discount_amount = fields.Float("Discount Amount", readonly=True, states={'draft': [('readonly', False)]},) - discount_percentage = fields.Float("Discount Percentage", readonly=True, states={'draft': [('readonly', False)]},) + "Discount Type", readonly=True, states={'draft': [('readonly', False)],'sent': [('readonly', False)]}, default='percentage') + discount_amount = fields.Float("Discount Amount", readonly=True, states={'draft': [('readonly', False)],'sent': [('readonly', False)]},) + discount_percentage = fields.Float("Discount Percentage", readonly=True, states={'draft': [('readonly', False)],'sent': [('readonly', False)]},) @api.multi def _discount_unset(self): diff --git a/ext/3rd-party-addons/global_discount/views/sale_view.xml b/ext/3rd-party-addons/global_discount/views/sale_view.xml index 05c41ae7..aade8ac0 100755 --- a/ext/3rd-party-addons/global_discount/views/sale_view.xml +++ b/ext/3rd-party-addons/global_discount/views/sale_view.xml @@ -9,14 +9,14 @@ - diff --git a/ext/custom-addons/dp_custom/models/product.py b/ext/custom-addons/dp_custom/models/product.py index e2e95aee..1f8f4e1b 100644 --- a/ext/custom-addons/dp_custom/models/product.py +++ b/ext/custom-addons/dp_custom/models/product.py @@ -29,7 +29,7 @@ class ProductXCategory(models.Model): _description = 'X-Kategorie' _order = 'name' - name = fields.Char(string='Bezaichnung', required=True) + name = fields.Char(string='Bezeichnung', required=True) _sql_constraints = [ ('name_uniq', 'unique(name)', 'Die Bezeichnung muss eindeutig sein') diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index dab56ebf..d8932ca1 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -66,6 +66,14 @@ class SaleOrder(models.Model): pg9_call_D = fields.Char(string='PG9-Auftrag_D', compute='_pg9_call', store=False) pg9_call_T = fields.Char(string='PG9-Auftrag_T', compute='_pg9_call', store=False) + @api.multi + def _reset_sequence(self): + for rec in self: + current_sequence = 1 + for line in rec.order_line: + line.sequence = current_sequence + current_sequence += 1 + @api.multi def _pg9_call(self): for record in self: @@ -347,6 +355,8 @@ class SaleOrder(models.Model): if vals.get('message_post',False): self.message_post(body=vals.get('message_post')) + self._reset_sequence() + return res @api.multi @@ -493,6 +503,23 @@ class SaleOrderLine(models.Model): product_id = fields.Many2one(domain=_get_product_id_domain) weight = fields.Float(string='Gewicht', compute='_compute_weight') intrastat_id = fields.Many2one(comodel_name='report.intrastat.code', string='Intrastat Code') + sequence = fields.Integer(string='Sequence', default=9999) + + @api.multi + @api.onchange('product_id') + def product_id_change(self): + result = super(SaleOrderLine,self).product_id_change() + product = self.product_id.with_context( + lang=self.order_id.partner_id.lang, + partner=self.order_id.partner_id.id + ) + + name = product.name + if product.description_sale: + name = product.description_sale + self.name = name + + return result @api.model def create(self, vals): 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 0282dc15..971457b9 100644 --- a/ext/custom-addons/dp_custom/views/res_partner_views.xml +++ b/ext/custom-addons/dp_custom/views/res_partner_views.xml @@ -74,6 +74,7 @@ + diff --git a/ext/custom-addons/dp_custom/views/sale_views.xml b/ext/custom-addons/dp_custom/views/sale_views.xml index f4c2c919..006131c6 100644 --- a/ext/custom-addons/dp_custom/views/sale_views.xml +++ b/ext/custom-addons/dp_custom/views/sale_views.xml @@ -29,8 +29,12 @@ + + + +
+ - From 0d68232293b4986ccef6237e530803e9c7f4f7a1 Mon Sep 17 00:00:00 2001 From: Ahmed Aly Date: Fri, 5 Oct 2018 16:55:40 +0200 Subject: [PATCH 8/8] Fall 771: allinonept Umgebung aufsetzen --- ext/custom-addons/dp_custom/__manifest__.py | 2 - ext/custom-addons/dp_custom/data/cron_job.xml | 13 ----- .../data/tz_austria_company_data.xml | 6 --- .../dp_glaser_company/__init__.py | 20 +++++++ .../dp_glaser_company/__manifest__.py | 46 ++++++++++++++++ .../dp_glaser_company/data/cron_job.xml | 17 ++++++ .../data/glaser_company_data.xml | 30 ++++++----- .../data/glaser_tax_data.xml | 36 ++++++------- .../static/description/icon.png | Bin 0 -> 2225 bytes .../static/src/img/glaser_favicon.png | Bin 0 -> 329 bytes .../static/src/img/logo_glaser.png | Bin 0 -> 18982 bytes setup/lib/cli.py | 1 + setup/lib/config.py | 5 +- setup/lib/config_allinonept.py | 50 ++++++++++++++++-- setup/lib/environments.py | 1 + setup/lib/functions.py | 31 ++++++++++- 16 files changed, 199 insertions(+), 59 deletions(-) create mode 100644 ext/custom-addons/dp_glaser_company/__init__.py create mode 100644 ext/custom-addons/dp_glaser_company/__manifest__.py create mode 100644 ext/custom-addons/dp_glaser_company/data/cron_job.xml rename ext/custom-addons/{dp_custom => dp_glaser_company}/data/glaser_company_data.xml (59%) rename ext/custom-addons/{dp_custom => dp_glaser_company}/data/glaser_tax_data.xml (58%) create mode 100644 ext/custom-addons/dp_glaser_company/static/description/icon.png create mode 100644 ext/custom-addons/dp_glaser_company/static/src/img/glaser_favicon.png create mode 100644 ext/custom-addons/dp_glaser_company/static/src/img/logo_glaser.png diff --git a/ext/custom-addons/dp_custom/__manifest__.py b/ext/custom-addons/dp_custom/__manifest__.py index 00ce1b1c..dfe1a2f9 100644 --- a/ext/custom-addons/dp_custom/__manifest__.py +++ b/ext/custom-addons/dp_custom/__manifest__.py @@ -49,11 +49,9 @@ 'wizards/wizard_confirm_print_invoice.xml', 'security/security.xml', 'data/dp_custom_data.xml', - 'data/glaser_company_data.xml', 'data/tz_austria_company_data.xml', 'data/product_data.xml', 'data/tz_tax_data.xml', - 'data/glaser_tax_data.xml', 'data/cron_job.xml', 'views/dp_custom_views.xml', 'views/res_line_views.xml', diff --git a/ext/custom-addons/dp_custom/data/cron_job.xml b/ext/custom-addons/dp_custom/data/cron_job.xml index 9b39351e..aa324976 100644 --- a/ext/custom-addons/dp_custom/data/cron_job.xml +++ b/ext/custom-addons/dp_custom/data/cron_job.xml @@ -14,17 +14,4 @@ - - Export Portal Prices Glaser - - - - 1 - days - -1 - - code - model.cron_export_portal_prices() - - diff --git a/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml b/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml index 4da4b591..b1f1adcb 100644 --- a/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml +++ b/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml @@ -18,12 +18,6 @@ (4,ref('dp_custom.group_allow_delete_so_attachments'))]"/> - - - - 70.00 - - diff --git a/ext/custom-addons/dp_glaser_company/__init__.py b/ext/custom-addons/dp_glaser_company/__init__.py new file mode 100644 index 00000000..aa7ed683 --- /dev/null +++ b/ext/custom-addons/dp_glaser_company/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# datenpol gmbh +# Copyright (C) 2013-TODAY datenpol gmbh () +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## diff --git a/ext/custom-addons/dp_glaser_company/__manifest__.py b/ext/custom-addons/dp_glaser_company/__manifest__.py new file mode 100644 index 00000000..43cbc71e --- /dev/null +++ b/ext/custom-addons/dp_glaser_company/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# datenpol gmbh +# Copyright (C) 2013-TODAY datenpol gmbh () +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +# noinspection PyStatementEffect +{ + 'name': 'Unternehmen Glaser Daten', + 'category': 'Custom', + 'version': '11.0.1.0.0', + 'description': """Fügt alle Daten für das Unternehmen Glaser & Co hinzu""", + 'author': 'datenpol gmbh', + 'website': 'http://www.datenpol.at/', + 'depends': [ + 'base', + 'account', + 'sale_stock', + 'queue_job', + 'website', + 'dp_custom' + ], + 'data': [ + 'data/glaser_company_data.xml', + 'data/glaser_tax_data.xml', + 'data/cron_job.xml', + ], + 'installable': True, + 'auto_install': False, +} diff --git a/ext/custom-addons/dp_glaser_company/data/cron_job.xml b/ext/custom-addons/dp_glaser_company/data/cron_job.xml new file mode 100644 index 00000000..c1cadd2b --- /dev/null +++ b/ext/custom-addons/dp_glaser_company/data/cron_job.xml @@ -0,0 +1,17 @@ + + + + + Export Portal Prices Glaser + + + + 1 + days + -1 + + code + model.cron_export_portal_prices() + + + diff --git a/ext/custom-addons/dp_custom/data/glaser_company_data.xml b/ext/custom-addons/dp_glaser_company/data/glaser_company_data.xml similarity index 59% rename from ext/custom-addons/dp_custom/data/glaser_company_data.xml rename to ext/custom-addons/dp_glaser_company/data/glaser_company_data.xml index b5d12075..48d8bb3c 100644 --- a/ext/custom-addons/dp_custom/data/glaser_company_data.xml +++ b/ext/custom-addons/dp_glaser_company/data/glaser_company_data.xml @@ -1,6 +1,6 @@ - + Glaser & Co. Neugasse 36 Spannberg @@ -15,21 +15,21 @@ - - + + -
Pos.