diff --git a/dev/scripts/interfaces/sst01_portal_create_company.py b/dev/scripts/interfaces/sst01_portal_create_company.py index cc03b44d..2d9510d8 100755 --- a/dev/scripts/interfaces/sst01_portal_create_company.py +++ b/dev/scripts/interfaces/sst01_portal_create_company.py @@ -30,7 +30,6 @@ values = { "line_ids": ["0000"], "opt_out": True, "lang": "de", - "is_retailer": True, } res_partner_obj = odoo.env['res.partner'] diff --git a/dev/scripts/interfaces/sst04_pg_get_orders.py b/dev/scripts/interfaces/sst04_pg_get_orders.py index 568e9834..08f42761 100755 --- a/dev/scripts/interfaces/sst04_pg_get_orders.py +++ b/dev/scripts/interfaces/sst04_pg_get_orders.py @@ -7,14 +7,15 @@ db = 'tz-austria_1' user = 'admin' pw = 'x' -host = 'erp.tzaustria.info' -port = 443 -db = 'odoo-test' -user = 'tz-admin' -pw = '12tza345' -protocol="jsonrpc+ssl" +# host = 'erp.tzaustria.info' +# port = 443 +# db = 'odoo-test' +# user = 'tz-admin' +# pw = '12tza345' +# protocol="jsonrpc+ssl" -odoo = odoorpc.ODOO(host, protocol=protocol, port=port) +odoo = odoorpc.ODOO(host, port=port) +# odoo = odoorpc.ODOO(host, protocol=protocol, port=port) odoo.login(db, user, pw) sale_order_obj = odoo.env['sale.order'] diff --git a/dev/scripts/interfaces/sst10_create_product.py b/dev/scripts/interfaces/sst10_create_product.py index 7ec89e8f..2fbe5859 100755 --- a/dev/scripts/interfaces/sst10_create_product.py +++ b/dev/scripts/interfaces/sst10_create_product.py @@ -7,14 +7,15 @@ db = 'tz-austria_1' user = 'tz-admin' pw = 'x' -host = 'erp.tzaustria.info' -port = 443 -db = 'odoo-test' -user = 'tz-admin' -pw = '12tza345' -protocol="jsonrpc+ssl" +# host = 'erp.tzaustria.info' +# port = 443 +# db = 'odoo-test' +# user = 'tz-admin' +# pw = '12tza345' +# protocol="jsonrpc+ssl" -odoo = odoorpc.ODOO(host, protocol=protocol, port=port) +odoo = odoorpc.ODOO(host, port=port) +# odoo = odoorpc.ODOO(host, protocol=protocol, port=port) odoo.login(db, user, pw) values = { @@ -28,16 +29,17 @@ values = { "weight": 80.45, "active": True, "is_internal": True, - "xcat_id": "Kategorie 1", + "xcat_id": "XCategory Name", "notes": "notes", - "material_type_id": "Holz", - "categ_id": "all", + "material_type_id": "Roh Material", + "categ_id": "__connector", "intrastat_id": "34052000", "sale_ok": True, "assembly_line_ids": ["0000"], "list_price": 50.00, "can_be_sold_unconfigured": True, - 'image': "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", + "image": "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", + "tax": "20% MwSt.",# oder "10% MwSt.", "0% MwSt." } product_obj = odoo.env['product.template'] diff --git a/dev/scripts/interfaces/sst11_pg_create_company.py b/dev/scripts/interfaces/sst11_pg_create_company.py index ed3a1782..6d13302c 100755 --- a/dev/scripts/interfaces/sst11_pg_create_company.py +++ b/dev/scripts/interfaces/sst11_pg_create_company.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import odoorpc -from urllib.parse import urlparse host = 'localhost' port = 8080 @@ -32,7 +31,7 @@ values = { "vat": False, "lang": "de", "line_ids": ["0000"], - "property_payment_term_id": "15 Tage", + "property_payment_term_id": "7", "property_product_pricelist": "EUR", "date_vat_check": "2017-08-04", "active": True, diff --git a/ext/custom-addons/dp_custom/models/__init__.py b/ext/custom-addons/dp_custom/models/__init__.py index 165b0fc5..27b85503 100644 --- a/ext/custom-addons/dp_custom/models/__init__.py +++ b/ext/custom-addons/dp_custom/models/__init__.py @@ -31,3 +31,4 @@ from . import product from . import ir_attachment from . import account from . import commission_account +from . import res_users diff --git a/ext/custom-addons/dp_custom/models/dp_custom.py b/ext/custom-addons/dp_custom/models/dp_custom.py index 7720f3bf..3c3c7cf2 100644 --- a/ext/custom-addons/dp_custom/models/dp_custom.py +++ b/ext/custom-addons/dp_custom/models/dp_custom.py @@ -27,14 +27,12 @@ class AbstractHelper(models.AbstractModel): _description = 'Abstract Helper' @api.model - def remove_not_specified_fields(self, vals): + def check_not_specified_fields(self, vals): specified_fields = self._get_specified_fields() - remove_fields = [] for key in list(vals.keys()): if key not in specified_fields: - remove_fields.append(key) - for key in remove_fields: - del vals[key] + raise ValidationError( + _('Es befinden sich unerlaubte Felder in Ihrem Aufruf. Bitte entfernen Sie diese.')) return vals @api.model diff --git a/ext/custom-addons/dp_custom/models/product.py b/ext/custom-addons/dp_custom/models/product.py index f65bba12..3f10d981 100644 --- a/ext/custom-addons/dp_custom/models/product.py +++ b/ext/custom-addons/dp_custom/models/product.py @@ -18,11 +18,11 @@ # along with this program. If not, see . # ############################################################################## +from odoo.addons.component.core import Component + from odoo import fields, models, api, _ from odoo.exceptions import ValidationError -from odoo.addons.component.core import Component - class ProductXCategory(models.Model): _name = 'product.xcategory' @@ -66,7 +66,7 @@ class ProductTemplate(models.Model): :param vals: :return: """ - vals = self.remove_not_specified_fields(vals) + self.check_not_specified_fields(vals) vals = self.correct_values(vals) product_template = self.with_context(active_test=False).search([('default_code', '=', vals['default_code'])]) if product_template: @@ -120,13 +120,23 @@ class ProductTemplate(models.Model): _("Produktionslinie \'%s\' kann nicht zugeordnet werden") % assembly_line_code) vals['assembly_line_ids'] = [(6, 0, assembly_line_ids)] + if vals.get('tax', False): + if vals['tax'] not in ["20% MwSt.", "10% MwSt.", "0% MwSt."]: + raise ValidationError(_("Die Steuer \'%s\' ist nicht gültig.") % vals['tax']) + + tax = self.env['account.tax'].search([('name', '=', vals['tax'])]) + if tax: + vals['taxes_id'] = [(6, 0, [tax.id])] + else: + raise ValidationError(_("Die Steuer \'%s\' kann nicht zugeordnet werden") % vals['tax']) + return vals @api.model def _get_specified_fields(self): return ['default_code', 'name', 'length', 'width', 'thickness', 'surface', 'active', 'weight', 'is_internal', 'xcat_id', 'notes', 'material_type_id', 'intrastat_id', 'sale_ok', 'assembly_line_ids', 'list_price', - 'height', 'categ_id', 'can_be_sold_unconfigured', 'image'] + 'height', 'categ_id', 'can_be_sold_unconfigured', 'image', 'tax'] class ProductCategory(models.Model): @@ -142,21 +152,30 @@ class ProductPricelistItemEventListener(Component): @api.model def on_record_write(self, record, fields=None): - partners = self.env['res.partner'].search([('property_product_pricelist', '=', record.id)]) + partners = self.env['res.partner'].search([('property_product_pricelist', '=', record.pricelist_id.id)]) for partner in partners: - if partner.portal_id and partner.active: + if partner.portal_id and partner.company_type == 'company': partner.portal_export_pending = True @api.model def on_record_create(self, record, fields=None): - partners = self.env['res.partner'].search([('property_product_pricelist', '=', record.id)]) + partners = self.env['res.partner'].search([('property_product_pricelist', '=', record.pricelist_id.id)]) for partner in partners: - if partner.portal_id: + if partner.portal_id and partner.company_type == 'company': partner.portal_export_pending = True @api.model def on_record_unlink(self, record): - partners = self.env['res.partner'].search([('property_product_pricelist', '=', record.id)]) + partners = self.env['res.partner'].search([('property_product_pricelist', '=', record.pricelist_id.id)]) for partner in partners: - if partner.portal_id: + if partner.portal_id and partner.company_type == 'company': partner.portal_export_pending = True + + +class ProductPricelistItem(models.Model): + _inherit = 'product.pricelist.item' + + applied_on = fields.Selection(selection=[ + ('3_global', 'Global'), + ('2_product_category', ' Product Category'), + ('0_product_variant', 'Product Variant')]) diff --git a/ext/custom-addons/dp_custom/models/res_partner.py b/ext/custom-addons/dp_custom/models/res_partner.py index 4462539e..a3b53bf7 100644 --- a/ext/custom-addons/dp_custom/models/res_partner.py +++ b/ext/custom-addons/dp_custom/models/res_partner.py @@ -34,17 +34,13 @@ class PartnerEventListener(Component): _apply_on = ['res.partner'] def on_record_write(self, record, fields=None): - if record.active and record.portal_id: - if 'company_type' in fields: - if record.company_type == 'company' and record.type != 'delivery': - self.env['res.partner'].with_delay().job_export_portal_price(record) - if 'property_product_pricelist' in fields: - for contact in record.child_ids: - if contact.type != 'delivery': - self.env['res.partner'].with_delay().job_export_portal_price(contact) - if 'parent_id' in fields: - if record.type != 'delivery': - self.env['res.partner'].with_delay().job_export_portal_price(record) + if record.active and record.portal_id and record.company_type == 'company': + if 'company_type' in fields or 'property_product_pricelist' in fields: + self.env['res.partner'].with_delay().job_export_portal_price(record) + + def on_record_create(self, record, fields=None): + if record.active and record.portal_id and record.company_type == 'company': + self.env['res.partner'].with_delay().job_export_portal_price(record) class Partner(models.Model): @@ -97,7 +93,7 @@ class Partner(models.Model): :param vals: :return: """ - vals = self.with_context(sst_1=True).remove_not_specified_fields(vals) + self.with_context(sst_1=True).check_not_specified_fields(vals) vals = self.correct_values(vals) if not vals.get('active', False): vals['active'] = False @@ -113,7 +109,7 @@ class Partner(models.Model): :param vals: :return: """ - vals = self.with_context(sst_14=True).remove_not_specified_fields(vals) + self.with_context(sst_14=True).check_not_specified_fields(vals) vals = self.correct_values(vals) return self.create(vals).id @@ -124,7 +120,7 @@ class Partner(models.Model): :param vals: :return: """ - vals = self.with_context(sst_11=True).remove_not_specified_fields(vals) + self.with_context(sst_11=True).check_not_specified_fields(vals) vals = self.correct_values(vals) partner = self.with_context(active_test=False).search([('ref', '=', vals['ref'])]) if partner: @@ -283,8 +279,7 @@ class Partner(models.Model): def cron_export_portal_prices(self): partners = self.search([('portal_export_pending', '=', True), ('company_id', '=', self.env.user.company_id.id)]) for partner in partners: - if partner.type != 'delivery': - self.with_delay().job_export_portal_price(partner) + self.with_delay().job_export_portal_price(partner) partner.portal_export_pending = False @api.multi @@ -296,14 +291,14 @@ class Partner(models.Model): data = [] for item in pricelist.item_ids: if item.compute_price == 'percentage' and item.applied_on in ['3_global', '2_product_category', - '1_product']: + '0_product_variant']: code = False if item.applied_on == '2_product_category': code = item.categ_id.code - if item.applied_on == '1_product': + if item.applied_on == '0_product_variant': code = item.product_tmpl_id.default_code data.append({ - 'customer_id': partner_id.portal_id, + 'customer_id': partner_id.commercial_partner_id.portal_id, 'code': code, 'discount': 1 - (item.percent_price / 100) }) diff --git a/ext/custom-addons/dp_custom/models/res_users.py b/ext/custom-addons/dp_custom/models/res_users.py new file mode 100644 index 00000000..6c1445b8 --- /dev/null +++ b/ext/custom-addons/dp_custom/models/res_users.py @@ -0,0 +1,14 @@ +# 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 + + +class Users(models.Model): + _inherit = 'res.users' + + @api.model + def create(self, vals): + vals['customer'] = False + + return super(Users, self).create(vals) diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index c9bfd46e..df114fa9 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -202,7 +202,7 @@ class SaleOrder(models.Model): if key.startswith('delivery_'): delivery_vals[key.replace('delivery_', '')] = vals[key] - delivery_vals = delivery_partner.with_context(delivery_partner=True).remove_not_specified_fields(delivery_vals) + delivery_partner.with_context(delivery_partner=True).check_not_specified_fields(delivery_vals) delivery_vals = delivery_partner.correct_values(delivery_vals) delivery_vals['parent_id'] = partner.id @@ -219,7 +219,7 @@ class SaleOrder(models.Model): attachment_vals = vals.get('attachment_ids', False) order_line_vals = vals.get('order_lines', False) - vals = self.remove_not_specified_fields(vals) + self.check_not_specified_fields(vals) vals = self.correct_values(vals) payment_term = partner.property_payment_term_id if partner.retail_partner_id: diff --git a/ext/custom-addons/dp_custom/views/product_views.xml b/ext/custom-addons/dp_custom/views/product_views.xml index f532d46e..9d7438e4 100644 --- a/ext/custom-addons/dp_custom/views/product_views.xml +++ b/ext/custom-addons/dp_custom/views/product_views.xml @@ -62,6 +62,17 @@ + + dp_product_pricelist_item_form_view + product.pricelist.item + + + + {'invisible':[('applied_on', '=', '1_product')]} + + + + product_xcategory_form_view product.xcategory diff --git a/ext/custom-addons/dp_custom/wizards/portal_assign_company.py b/ext/custom-addons/dp_custom/wizards/portal_assign_company.py index a87ed3ab..7c8ea910 100644 --- a/ext/custom-addons/dp_custom/wizards/portal_assign_company.py +++ b/ext/custom-addons/dp_custom/wizards/portal_assign_company.py @@ -64,7 +64,7 @@ class PortalAssignCompany(models.TransientModel): # Wichtig hier ist, dass dieser Call vor dem ersten Write stattfindet, da das Portal # parallel einen Call absetzt, dann dann blockieren würde. - self.send_to_portal(partner.portal_id, partner.id) + # self.send_to_portal(partner.portal_id, partner.id) partner.write({'portal_pending': False, 'active': True}) return True diff --git a/ext/custom-addons/dp_reports/reports/report_templates.xml b/ext/custom-addons/dp_reports/reports/report_templates.xml index 706af52d..dc13c7ae 100644 --- a/ext/custom-addons/dp_reports/reports/report_templates.xml +++ b/ext/custom-addons/dp_reports/reports/report_templates.xml @@ -4,7 +4,6 @@ @@ -89,7 +88,7 @@ · · - + @@ -98,7 +97,7 @@ IBAN: - AT46 3250 1000 0200 9306 + AT 46 3250 1000 0200 9306 · BIC: @@ -121,7 +120,7 @@
- Die AGBs sind auf der Homepage verfügbar. + Die AGBs finden Sie auf unserer Website.
@@ -167,7 +166,7 @@
- +
diff --git a/ext/custom-addons/dp_reports_account/reports/invoice.xml b/ext/custom-addons/dp_reports_account/reports/invoice.xml index 173f8b80..817e3c68 100644 --- a/ext/custom-addons/dp_reports_account/reports/invoice.xml +++ b/ext/custom-addons/dp_reports_account/reports/invoice.xml @@ -106,9 +106,15 @@ - - - - + + + - + + + + - + + - diff --git a/ext/custom-addons/dp_style/static/src/less/variables.less b/ext/custom-addons/dp_style/static/src/less/variables.less index d0e22148..b685142d 100644 --- a/ext/custom-addons/dp_style/static/src/less/variables.less +++ b/ext/custom-addons/dp_style/static/src/less/variables.less @@ -2,6 +2,7 @@ @odoo-brand-optional: #a72523; @navbar-default-color: #a72523; @brand-primary: #a72523; +@font-family-sans-serif: Raleway, "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; @navbar-default-bg: #ffffff; @odoo-control-panel-background-color: #ffffff; diff --git a/ext/custom-addons/dp_style/static/src/less/web_variables.less b/ext/custom-addons/dp_style/static/src/less/web_variables.less new file mode 100644 index 00000000..a35acca2 --- /dev/null +++ b/ext/custom-addons/dp_style/static/src/less/web_variables.less @@ -0,0 +1,3 @@ +body { + font-family: Raleway, "Helvetica Neue", Helvetica, Arial, sans-serif; +} diff --git a/ext/custom-addons/dp_style/views/assets.xml b/ext/custom-addons/dp_style/views/assets.xml index 67c1a1e3..8812db5d 100644 --- a/ext/custom-addons/dp_style/views/assets.xml +++ b/ext/custom-addons/dp_style/views/assets.xml @@ -1,10 +1,16 @@ -