Fall 5585: Anpassung aller Schnittstellen
parent
61e212d56e
commit
efbbce0945
|
|
@ -30,7 +30,6 @@ values = {
|
|||
"line_ids": ["0000"],
|
||||
"opt_out": True,
|
||||
"lang": "de",
|
||||
"is_retailer": True,
|
||||
}
|
||||
|
||||
res_partner_obj = odoo.env['res.partner']
|
||||
|
|
|
|||
|
|
@ -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']
|
||||
|
|
|
|||
|
|
@ -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,10 +29,10 @@ 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"],
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -93,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
|
||||
|
|
@ -109,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
|
||||
|
||||
|
|
@ -120,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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue