Schnittstelen SST-01, SST-02, SST-03, SST-10, SST-11, SST-04 abgeschlossen
module fuer rest to rpc hinzugefuegt module dp_dmi hinzugefuegt scripts mit odoorpc calls hinzugefuegtdevelop
							parent
							
								
									1f28a8f8f7
								
							
						
					
					
						commit
						011b5e89bd
					
				|  | @ -0,0 +1,35 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | import odoorpc | ||||||
|  | 
 | ||||||
|  | host = 'localhost' | ||||||
|  | port = 8080 | ||||||
|  | db = 'tz-austria_1' | ||||||
|  | user = 'admin' | ||||||
|  | pw = 'x' | ||||||
|  | 
 | ||||||
|  | odoo = odoorpc.ODOO(host, port=port) | ||||||
|  | odoo.login(db, user, pw) | ||||||
|  | 
 | ||||||
|  | values = { | ||||||
|  |     "default_code": "02", | ||||||
|  |     "name": "Produktname", | ||||||
|  |     "length": 45.01, | ||||||
|  |     "width": 13.45, | ||||||
|  |     "thickness": 33.44, | ||||||
|  |     "surface": "m", | ||||||
|  |     "weight": 80.45, | ||||||
|  |     "is_interneal": True, | ||||||
|  |     "xcat_id": "xcat_1", | ||||||
|  |     "notes": "notes", | ||||||
|  |     "material_type_id": "material_1", | ||||||
|  |     "intrastat_id": "Code", | ||||||
|  |     "sale_ok": True, | ||||||
|  |     "assembly_line_ids": ["L1", "L2"], | ||||||
|  |     "list_price": 50.00 | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | product_obj = odoo.env['product.template'] | ||||||
|  | 
 | ||||||
|  | result = product_obj.create_product(values) | ||||||
|  | 
 | ||||||
|  | print(result) | ||||||
|  | @ -0,0 +1,37 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | import odoorpc | ||||||
|  | 
 | ||||||
|  | host = 'localhost' | ||||||
|  | port = 8080 | ||||||
|  | db = 'tz-austria_1' | ||||||
|  | user = 'admin' | ||||||
|  | pw = 'x' | ||||||
|  | 
 | ||||||
|  | odoo = odoorpc.ODOO(host, port=port) | ||||||
|  | odoo.login(db, user, pw) | ||||||
|  | 
 | ||||||
|  | values = { | ||||||
|  |     "name": "Company", | ||||||
|  |     "street": "Elterleinplatz 11", | ||||||
|  |     "zip": 1170, | ||||||
|  |     "city": "Wien", | ||||||
|  |     "country_id": "AT", | ||||||
|  |     "fax": "+43 55567051", | ||||||
|  |     "phone": "+43 5556705", | ||||||
|  |     "endkunde": True, | ||||||
|  |     "portal_id": "111111", | ||||||
|  |     "email": "company@test.at", | ||||||
|  |     "opt_out": True, | ||||||
|  |     "ref": "A144S3", | ||||||
|  |     "partner_sector_id": "Test", | ||||||
|  |     "comment": "comment", | ||||||
|  |     "vat": False, | ||||||
|  |     "lang": "de", | ||||||
|  |     "line_ids": ["L1", "L2"] | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | res_partner_obj = odoo.env['res.partner'] | ||||||
|  | 
 | ||||||
|  | result = res_partner_obj.pg_create_company(values) | ||||||
|  | 
 | ||||||
|  | print(result) | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -0,0 +1,23 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | import odoorpc | ||||||
|  | 
 | ||||||
|  | host = 'localhost' | ||||||
|  | port = 8080 | ||||||
|  | db = 'tz-austria_1' | ||||||
|  | user = 'admin' | ||||||
|  | pw = 'x' | ||||||
|  | 
 | ||||||
|  | odoo = odoorpc.ODOO(host, port=port) | ||||||
|  | odoo.login(db, user, pw) | ||||||
|  | 
 | ||||||
|  | values = { | ||||||
|  |     "line": "L1", | ||||||
|  |     "state": "approved", | ||||||
|  |     "limit": 8 | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | sale_order_obj = odoo.env['sale.order'] | ||||||
|  | 
 | ||||||
|  | result = sale_order_obj.pg_get_orders("L1", "approved", 8) | ||||||
|  | 
 | ||||||
|  | print(result) | ||||||
|  | @ -0,0 +1,37 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | import odoorpc | ||||||
|  | 
 | ||||||
|  | host = 'localhost' | ||||||
|  | port = 8080 | ||||||
|  | db = 'tz-austria_1' | ||||||
|  | user = 'admin' | ||||||
|  | pw = 'x' | ||||||
|  | 
 | ||||||
|  | odoo = odoorpc.ODOO(host, port=port) | ||||||
|  | odoo.login(db, user, pw) | ||||||
|  | 
 | ||||||
|  | values = { | ||||||
|  |     "name": "Max Musterman", | ||||||
|  |     "street": "Strasse 11", | ||||||
|  |     "zip": "1145", | ||||||
|  |     "city": "Wien", | ||||||
|  |     "country_id": "AT", | ||||||
|  |     "fax": "+43 456546", | ||||||
|  |     "phone": "+43 564564", | ||||||
|  |     "endkunde": True, | ||||||
|  |     "portal_id": "111111", | ||||||
|  |     "email": "max@musterman.at", | ||||||
|  |     "opt_out": True, | ||||||
|  |     "ref": "A88S", | ||||||
|  |     "partner_sector_id": "Test", | ||||||
|  |     "comment": "comment", | ||||||
|  |     "vat": False, | ||||||
|  |     "lang": "de" | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | res_partner_obj = odoo.env['res.partner'] | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | result = res_partner_obj.portal_create_partner(values) | ||||||
|  | 
 | ||||||
|  | print(result) | ||||||
|  | @ -6,8 +6,7 @@ odoo.define('dp_changelog.UserMenu', function (require) { | ||||||
| 
 | 
 | ||||||
|     UserMenu.include({ |     UserMenu.include({ | ||||||
|         /** |         /** | ||||||
|          * calls the action of the changlog if the menu changelog is clicked |          * @private | ||||||
|          * @return {undefined} |  | ||||||
|          */ |          */ | ||||||
|         _onMenuChangelogs: function () { |         _onMenuChangelogs: function () { | ||||||
|             var self = this; |             var self = this; | ||||||
|  |  | ||||||
|  | @ -39,6 +39,12 @@ | ||||||
|         'data/glaser_company_data.xml', |         'data/glaser_company_data.xml', | ||||||
|         'data/tz_austria_company_data.xml', |         'data/tz_austria_company_data.xml', | ||||||
|         'views/dp_custom_views.xml', |         'views/dp_custom_views.xml', | ||||||
|  |         'views/res_line_views.xml', | ||||||
|  |         'views/res_partner_views.xml', | ||||||
|  |         'views/stock_views.xml', | ||||||
|  |         'views/sale_views.xml', | ||||||
|  |         'views/material_type_views.xml', | ||||||
|  |         'views/product_views.xml', | ||||||
|         'security/ir.model.access.csv', |         'security/ir.model.access.csv', | ||||||
|     ], |     ], | ||||||
|     'installable': True, |     'installable': True, | ||||||
|  |  | ||||||
|  | @ -24,4 +24,3 @@ msgstr "" | ||||||
| #: model:ir.model.fields,field_description:partner_second_lastname.field_res_users_lastname2 | #: model:ir.model.fields,field_description:partner_second_lastname.field_res_users_lastname2 | ||||||
| msgid "Midname" | msgid "Midname" | ||||||
| msgstr "Midname" | msgstr "Midname" | ||||||
| 
 |  | ||||||
|  |  | ||||||
|  | @ -19,6 +19,12 @@ | ||||||
| # | # | ||||||
| ############################################################################## | ############################################################################## | ||||||
| 
 | 
 | ||||||
|  | from . import dp_custom | ||||||
| from . import ir_ui_menu | from . import ir_ui_menu | ||||||
| from . import res_partner | from . import res_partner | ||||||
| from . import res_company | from . import res_company | ||||||
|  | from . import res_line | ||||||
|  | from . import stock | ||||||
|  | from . import sale | ||||||
|  | from . import material_type | ||||||
|  | from . import product | ||||||
|  |  | ||||||
|  | @ -0,0 +1,47 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | ############################################################################## | ||||||
|  | # | ||||||
|  | #    datenpol gmbh | ||||||
|  | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
|  | # | ||||||
|  | #    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 <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | ############################################################################## | ||||||
|  | from odoo import models, api, _ | ||||||
|  | from odoo.exceptions import ValidationError | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class AbstractHelper(models.AbstractModel): | ||||||
|  |     _name = 'dp_custom.helper' | ||||||
|  |     _description = 'Abstract Helper' | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def remove_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] | ||||||
|  |         return vals | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def correct_values(self, vals): | ||||||
|  |         return vals | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def _get_specified_fields(self): | ||||||
|  |         raise ValidationError( | ||||||
|  |             _('Method \'%s\' isn\'t Implemented in model \'%s\'', (self._get_specified_fields.__name__, self._name))) | ||||||
|  | @ -0,0 +1,34 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | ############################################################################## | ||||||
|  | # | ||||||
|  | #    datenpol gmbh | ||||||
|  | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
|  | # | ||||||
|  | #    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 <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | ############################################################################## | ||||||
|  | from odoo import fields, models | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class MaterialType(models.Model): | ||||||
|  |     _name = 'material.type' | ||||||
|  |     _description = 'Materialtyp' | ||||||
|  |     _order = 'name' | ||||||
|  | 
 | ||||||
|  |     name = fields.Char(string='Bezeichnung', required=True) | ||||||
|  |     print_default_code = fields.Boolean(string='Drucke Artikelnummer', required=True, help='Definiert, ob die Artikelnummer gedruckt wird') | ||||||
|  | 
 | ||||||
|  |     _sql_constraints = [ | ||||||
|  |         ('name_uniq', 'unique(name)', 'Die Bezeichnung muss eindeutig sein') | ||||||
|  |     ] | ||||||
|  | @ -0,0 +1,108 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | ############################################################################## | ||||||
|  | # | ||||||
|  | #    datenpol gmbh | ||||||
|  | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
|  | # | ||||||
|  | #    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 <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | ############################################################################## | ||||||
|  | from odoo import fields, models, api, _ | ||||||
|  | from odoo.exceptions import ValidationError | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class ProductXCategory(models.Model): | ||||||
|  |     _name = 'product.xcategory' | ||||||
|  |     _description = 'X-Kategorie' | ||||||
|  |     _order = 'name' | ||||||
|  | 
 | ||||||
|  |     name = fields.Char(string='Bezaichnung', required=True) | ||||||
|  | 
 | ||||||
|  |     _sql_constraints = [ | ||||||
|  |         ('name_uniq', 'unique(name)', 'Die Bezeichnung muss eindeutig sein') | ||||||
|  |     ] | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class ProductTemplate(models.Model): | ||||||
|  |     _name = 'product.template' | ||||||
|  |     _inherit = ['product.template', 'dp_custom.helper'] | ||||||
|  | 
 | ||||||
|  |     SURFACE_OPTIONS = [ | ||||||
|  |         ('m', 'Maserrichtung'), | ||||||
|  |         ('u', 'Einfärbig') | ||||||
|  |     ] | ||||||
|  | 
 | ||||||
|  |     length = fields.Float(string='Länge in mm') | ||||||
|  |     width = fields.Float(string='Breite in mm') | ||||||
|  |     thickness = fields.Float(string='Ficke in mm', help='Echte Dicke in mm') | ||||||
|  |     surface = fields.Selection(SURFACE_OPTIONS, string='Oberfläche') | ||||||
|  |     is_internal = fields.Boolean() | ||||||
|  |     xcat_id = fields.Many2one(comodel_name='product.xcategory', string='X-Kategorie') | ||||||
|  |     material_type_id = fields.Many2one(comodel_name='material.type', string='Materialtyp') | ||||||
|  |     assembly_line_ids = fields.Many2many(comodel_name='res.line', string='Produktionslinien') | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def create_product(self, vals): | ||||||
|  |         vals = self.remove_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: | ||||||
|  |             product_template.write(vals) | ||||||
|  |         else: | ||||||
|  |             self.create(vals) | ||||||
|  |         return True | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def correct_values(self, vals): | ||||||
|  |         if vals.get('xcat_id', False): | ||||||
|  |             xcat = self.env['product.xcategory'].search([('name', '=', vals['xcat_id'])]) | ||||||
|  |             if xcat: | ||||||
|  |                 vals['xcat_id'] = xcat.id | ||||||
|  |             else: | ||||||
|  |                 raise ValidationError( | ||||||
|  |                     _("X-Kategorie \'%s\' kann nicht zugeordnet werden" % vals['xcat_id'])) | ||||||
|  | 
 | ||||||
|  |         if vals.get('material_type_id', False): | ||||||
|  |             material_type = self.env['material.type'].search([('name', '=', vals['material_type_id'])]) | ||||||
|  |             if material_type: | ||||||
|  |                 vals['material_type_id'] = material_type.id | ||||||
|  |             else: | ||||||
|  |                 raise ValidationError( | ||||||
|  |                     _("Materialtyp \'%s\' kann nicht zugeordnet werden" % vals['material_type_id'])) | ||||||
|  | 
 | ||||||
|  |         if vals.get('intrastat_id', False): | ||||||
|  |             intrastat = self.env['report.intrastat.code'].search([('name', '=', vals['intrastat_id'])]) | ||||||
|  |             if intrastat: | ||||||
|  |                 vals['intrastat_id'] = intrastat.id | ||||||
|  |             else: | ||||||
|  |                 raise ValidationError( | ||||||
|  |                     _("Intrastat-Code \'%s\' kann nicht zugeordnet werden" % vals['intrastat_id'])) | ||||||
|  | 
 | ||||||
|  |         if vals.get('assembly_line_ids', False): | ||||||
|  |             assembly_line_ids = [] | ||||||
|  |             for assembly_line_code in vals['assembly_line_ids']: | ||||||
|  |                 assembly_line = self.env['res.line'].search([('name', '=', assembly_line_code)]) | ||||||
|  |                 if assembly_line: | ||||||
|  |                     assembly_line_ids.append(assembly_line.id) | ||||||
|  |                 else: | ||||||
|  |                     raise ValidationError( | ||||||
|  |                         _("Produktionslinie \'%s\' kann nicht zugeordnet werden" % assembly_line_code)) | ||||||
|  |             vals['assembly_line_ids'] = [(6, 0, assembly_line_ids)] | ||||||
|  | 
 | ||||||
|  |         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'] | ||||||
|  | @ -21,7 +21,7 @@ | ||||||
| import os | import os | ||||||
| import base64 | import base64 | ||||||
| 
 | 
 | ||||||
| from odoo import fields, models, api | from odoo import models, api | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class Company(models.Model): | class Company(models.Model): | ||||||
|  |  | ||||||
|  | @ -0,0 +1,34 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | ############################################################################## | ||||||
|  | # | ||||||
|  | #    datenpol gmbh | ||||||
|  | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
|  | # | ||||||
|  | #    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 <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | ############################################################################## | ||||||
|  | from odoo import fields, models | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class ResLine(models.Model): | ||||||
|  |     _name = 'res.line' | ||||||
|  |     _description = 'Produktionslinie' | ||||||
|  |     _order = 'name' | ||||||
|  | 
 | ||||||
|  |     name = fields.Char(string='Code', required=True) | ||||||
|  |     description = fields.Char(string="Beschreibung", required=True) | ||||||
|  | 
 | ||||||
|  |     _sql_constraints = [ | ||||||
|  |         ('name_uniq', 'unique(name)', 'Der Code muss eindeutig sein') | ||||||
|  |     ] | ||||||
|  | @ -19,10 +19,108 @@ | ||||||
| # | # | ||||||
| ############################################################################## | ############################################################################## | ||||||
| 
 | 
 | ||||||
| from odoo import fields, models | from odoo import api, fields, models, _ | ||||||
|  | from odoo.exceptions import ValidationError | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class Partner(models.Model): | class Partner(models.Model): | ||||||
|     _inherit = 'res.partner' |     _name = 'res.partner' | ||||||
|  |     _inherit = ['res.partner', 'dp_custom.helper'] | ||||||
| 
 | 
 | ||||||
|     lastname2 = fields.Char(string='Midname') |     lastname2 = fields.Char(string='Midname') | ||||||
|  |     company = fields.Char(string='Unternehmen') | ||||||
|  |     info_kundennr = fields.Char(string='Info-Kundennr.') | ||||||
|  |     info_uid = fields.Char(string='Info-UID') | ||||||
|  |     endkunde = fields.Boolean(string='Endkunde', help='Beschreibt, ob es ein Endkunde ist') | ||||||
|  |     line_ids = fields.Many2many(comodel_name='res.line', string='Produktionslinien') | ||||||
|  |     portal_id = fields.Char(string='Portal-ID') | ||||||
|  |     partner_sector_id = fields.Many2one(comodel_name='res.partner.sector', string='Branche') | ||||||
|  |     dat_vat_check = fields.Date(string='Datum letzte UID-Prüfung') | ||||||
|  |     active = fields.Boolean(track_visibility='onchange') | ||||||
|  | 
 | ||||||
|  |     _sql_constraints = [ | ||||||
|  |         ('ref_uniq', 'unique(ref)', 'Die Interne Referenz muss eindeutig sein') | ||||||
|  |     ] | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def portal_create_partner(self, vals): | ||||||
|  |         vals = self.remove_not_specified_fields(vals) | ||||||
|  |         vals = self.correct_values(vals) | ||||||
|  |         if not vals.get('active', False): | ||||||
|  |             vals['active'] = False | ||||||
|  |         return self.create(vals) | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def pg_create_company(self, vals): | ||||||
|  |         vals = self.remove_not_specified_fields(vals) | ||||||
|  |         vals = self.correct_values(vals) | ||||||
|  |         partner = self.with_context(active_test=False).search([('ref', '=', vals['ref'])]) | ||||||
|  |         if partner: | ||||||
|  |             if not partner.is_company: | ||||||
|  |                 raise ValidationError(_("Der Partner mit der Internen Referenz '%s' ist kein Unternehmen" % vals['ref'])) | ||||||
|  |             partner = self.write(vals) | ||||||
|  |         else: | ||||||
|  |             if not vals.get('is_company', False): | ||||||
|  |                 vals['is_company'] = True | ||||||
|  |             partner = self.create(vals) | ||||||
|  |             partner.property_account_fiscal_position = self.env['account.fiscal.position'].get_fiscal_position( | ||||||
|  |                 partner.id) | ||||||
|  |         return partner | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def correct_values(self, vals): | ||||||
|  |         if vals.get('country_id', False): | ||||||
|  |             country = self.env['res.country'].search([('code', '=', vals['country_id'])]) | ||||||
|  |             if country: | ||||||
|  |                 vals['country_id'] = country.id | ||||||
|  |             else: | ||||||
|  |                 raise ValidationError( | ||||||
|  |                     _("Das Land mit dem ISO-Code \'%s\' kann nicht zugeordnet werden" % vals['country_id'])) | ||||||
|  | 
 | ||||||
|  |         if vals.get('line_ids', False): | ||||||
|  |             line_ids = self.env['res.line'].search([('name', 'in', vals['line_ids'])]) | ||||||
|  |             if line_ids: | ||||||
|  |                 vals['line_ids'] = [(6, 0, line_ids.ids)] | ||||||
|  |             else: | ||||||
|  |                 raise ValidationError( | ||||||
|  |                     _("Die Produktionslinie mit dem Code \'%s\' kann nicht zugeordnet werden", vals['line_ids'])) | ||||||
|  | 
 | ||||||
|  |         if vals.get('lang', False): | ||||||
|  |             temp = vals['lang'] | ||||||
|  |             vals['lang'] = False | ||||||
|  |             for selection in self.fields_get('lang')['lang']['selection']: | ||||||
|  |                 if selection[0].startswith(temp): | ||||||
|  |                     vals['lang'] = selection[0] | ||||||
|  |                     break | ||||||
|  |             if not vals['lang']: | ||||||
|  |                 raise ValidationError(_("Die Sprache mit dem Code \'%s\' kann nicht zugeordnet werden" % temp)) | ||||||
|  | 
 | ||||||
|  |         if vals.get('partner_sector_id', False): | ||||||
|  |             branche = self.env['res.partner.sector'].search( | ||||||
|  |                 [('name', '=', vals['partner_sector_id'])]) | ||||||
|  |             if branche: | ||||||
|  |                 vals['partner_sector_id'] = branche.id | ||||||
|  |             else: | ||||||
|  |                 raise ValidationError(_("Die Branche \'%s\' kann nicht zugeordnet werden" % vals['partner_sector_id'])) | ||||||
|  | 
 | ||||||
|  |         return vals | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def _get_specified_fields(self): | ||||||
|  |         return ['name', 'firstname', 'lastname', 'street', 'street2', 'zip', 'city', 'country_id', 'tax', 'phone', 'mobile', | ||||||
|  |                 'endkunde', 'line_ids', 'lang', 'portal_id', 'email', 'opt_out', 'ref', | ||||||
|  |                 'partner_sector_id', 'comment', 'vat', 'property_payment_term_id', | ||||||
|  |                 'property_pricelist_id', 'date_vat_check', 'active'] | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class PartnerSector(models.Model): | ||||||
|  |     _name = 'res.partner.sector' | ||||||
|  |     _description = 'Branche' | ||||||
|  |     _order = 'id,name' | ||||||
|  | 
 | ||||||
|  |     name = fields.Char(string='Beteichnung', required=True) | ||||||
|  |     sequence = fields.Integer(string='Sequenz') | ||||||
|  | 
 | ||||||
|  |     _sql_constraints = [ | ||||||
|  |         ('name_uniq', 'unique(name)', 'Die Bezeichnung muss eindeutig sein') | ||||||
|  |     ] | ||||||
|  |  | ||||||
|  | @ -0,0 +1,192 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | ############################################################################## | ||||||
|  | # | ||||||
|  | #    datenpol gmbh | ||||||
|  | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
|  | # | ||||||
|  | #    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 <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | ############################################################################## | ||||||
|  | from odoo import api, fields, models, _ | ||||||
|  | from odoo.exceptions import ValidationError | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class SaleOrder(models.Model): | ||||||
|  |     _name = 'sale.order' | ||||||
|  |     _inherit = ['sale.order', 'dp_custom.helper'] | ||||||
|  | 
 | ||||||
|  |     ASSEMBLY_STATES = [('approved', 'Produktionsfreigabe'), | ||||||
|  |                        ('started', 'Produktion begonnen'), | ||||||
|  |                        ('done', 'Produktions fertig'), | ||||||
|  |                        ('packed', 'Verpackt'), | ||||||
|  |                        ('delivered', 'Geliefert')] | ||||||
|  | 
 | ||||||
|  |     assembled = fields.Boolean(string='Zusammengebaut') | ||||||
|  |     line_id = fields.Many2one(comodel_name='res.line', string='Produktionslinie') | ||||||
|  |     assembly_state = fields.Selection(ASSEMBLY_STATES, string="Status PG") | ||||||
|  |     internal_notes = fields.Text() | ||||||
|  |     assembly_notes = fields.Text() | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def pg_get_orders(self, line, state, limit): | ||||||
|  |         line_id = self.env['res.line'].search([('name', '=', line)]) | ||||||
|  |         orders = self.search([('line_id', '=', line_id.id), ('assembly_state', '=', state)], order='id ASC', | ||||||
|  |                              limit=limit) | ||||||
|  |         order_list = [] | ||||||
|  |         for order in orders: | ||||||
|  |             attachmets = self.env['ir.attachment'].search([('res_model', '=', 'sale.order'), ('res_id', '=', order.id)]) | ||||||
|  |             attachment_list = [] | ||||||
|  |             for attachment in attachmets: | ||||||
|  |                 attachment_list.append({ | ||||||
|  |                     'filename': attachment.name, | ||||||
|  |                     'binary': attachment.datas.decode() | ||||||
|  |                 }) | ||||||
|  |             order_list.append({ | ||||||
|  |                 'id': order.id, | ||||||
|  |                 'name': order.name, | ||||||
|  |                 'attachments': attachment_list, | ||||||
|  |                 'internal_notes': order.internal_notes, | ||||||
|  |                 'assembly_notes': order.assembly_notes | ||||||
|  |             }) | ||||||
|  |         return order_list | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def pg_create_quotation(self, vals): | ||||||
|  |         if not vals.get('portal_id', False): | ||||||
|  |             raise ValidationError( | ||||||
|  |                 _("Der Kunde mit der Portal-ID \'%s\' kann nicht zugeordnet werden" % vals['portal_id'])) | ||||||
|  |         partner = self.env['res.partner'].search([('portal_id', '=', vals['portal_id'])]) | ||||||
|  |         if not partner: | ||||||
|  |             raise ValidationError( | ||||||
|  |                 _("Der Kunde mit der Portal-ID \'%s\' kann nicht zugeordnet werden" % vals['portal_id'])) | ||||||
|  |         delivery_partner = self.env['res.partner'] | ||||||
|  |         delivery_vals = {} | ||||||
|  |         if vals.get('portal_delivery_id', False): | ||||||
|  |             delivery_partner = self.env['res.partner'].search([('portal_id', '=', vals['portal_delivery_id'])]) | ||||||
|  |             delivery_vals['portal_id'] = vals['portal_delivery_id'] | ||||||
|  |         for key in list(vals.keys()): | ||||||
|  |             if key.startswith('delivery_'): | ||||||
|  |                 delivery_vals[key.replace('delivery_', '')] = vals[key] | ||||||
|  | 
 | ||||||
|  |         delivery_vals = delivery_partner.remove_not_specified_fields(delivery_vals) | ||||||
|  |         delivery_vals = delivery_partner.correct_values(delivery_vals) | ||||||
|  |         delivery_vals['parent_id'] = partner.id | ||||||
|  | 
 | ||||||
|  |         if delivery_partner: | ||||||
|  |             delivery_partner.write(delivery_vals) | ||||||
|  |         else: | ||||||
|  |             if not delivery_vals.get('type', False): | ||||||
|  |                 delivery_vals['type'] = 'delivery' | ||||||
|  |             delivery_partner = delivery_partner.create(delivery_vals) | ||||||
|  | 
 | ||||||
|  |         attachment_vals = vals.get('attachment_ids', False) | ||||||
|  |         order_line_vals = vals.get('order_lines', False) | ||||||
|  |         vals = self.remove_not_specified_fields(vals) | ||||||
|  |         vals = self.correct_values(vals) | ||||||
|  |         vals.update({ | ||||||
|  |             'partner_id': partner.id, | ||||||
|  |             'fiscal_position_id': partner.property_account_position_id.id, | ||||||
|  |             'user_id': partner.user_id.id, | ||||||
|  |             'payment_term_id': partner.property_payment_term_id.id, | ||||||
|  |             'partner_shipping_id': delivery_partner.id, | ||||||
|  |             'partner_invoice_id': partner.id | ||||||
|  |         }) | ||||||
|  |         order_id = self.create(vals) | ||||||
|  |         if attachment_vals: | ||||||
|  |             order_id.pg_create_sale_order_attachments(attachment_vals) | ||||||
|  |         if attachment_vals: | ||||||
|  |             order_id.pg_create_order_lines(order_line_vals) | ||||||
|  |         return {'id': order_id.id, 'name': order_id.name} | ||||||
|  | 
 | ||||||
|  |     @api.multi | ||||||
|  |     def pg_create_sale_order_attachments(self, values): | ||||||
|  |         self.ensure_one() | ||||||
|  |         if isinstance(values, list): | ||||||
|  |             for vals in values: | ||||||
|  |                 self.create_attachment(self, vals) | ||||||
|  |         else: | ||||||
|  |             self.create_attachment(self, values) | ||||||
|  | 
 | ||||||
|  |     @api.multi | ||||||
|  |     def pg_create_order_lines(self, values): | ||||||
|  |         order_lines = [] | ||||||
|  |         for vals in values: | ||||||
|  |             vals = self.env['sale.order.line'].correct_values(vals) | ||||||
|  | 
 | ||||||
|  |             lot_id = False | ||||||
|  |             if vals.get('lot_id', False): | ||||||
|  |                 if vals['lot_id'].get('attachment_ids', False): | ||||||
|  |                     lot_attachment_values = vals['lot_id']['attachment_ids'] | ||||||
|  |                 else: | ||||||
|  |                     lot_attachment_values = [] | ||||||
|  |                 lot = self.env['stock.production.lot'].create({ | ||||||
|  |                     'name': vals['lot_id']['name'], | ||||||
|  |                     'product_id': vals['product_id'], | ||||||
|  |                     'notes': vals['lot_id']['notes'] | ||||||
|  |                 }) | ||||||
|  |                 for lot_attachment_vals in lot_attachment_values: | ||||||
|  |                     self.create_attachment(lot, lot_attachment_vals) | ||||||
|  |                 lot_id = lot.id | ||||||
|  |             order_lines.append(self.env['sale.order.line'].create({ | ||||||
|  |                 'order_id': self.id, | ||||||
|  |                 'product_id': vals['product_id'], | ||||||
|  |                 'price_unit': vals['price_unit'], | ||||||
|  |                 'product_uom_qty': vals['product_uom_qty'], | ||||||
|  |                 'lot_id': lot_id | ||||||
|  |             })) | ||||||
|  |         return order_lines | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def create_attachment(self, record, vals): | ||||||
|  |         attachment_vals = { | ||||||
|  |             'name': vals['filename'], | ||||||
|  |             'datas': vals['binary'], | ||||||
|  |             'datas_fname': vals['filename'], | ||||||
|  |             'res_model': record._name, | ||||||
|  |             'res_id': record.id, | ||||||
|  |         } | ||||||
|  |         self.env['ir.attachment'].create(attachment_vals) | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def correct_values(self, vals): | ||||||
|  |         if vals.get('line_id', False): | ||||||
|  |             line_id = self.env['res.line'].search([('name', '=', vals['line_id'])]) | ||||||
|  |             if line_id: | ||||||
|  |                 vals['line_id'] = line_id.id | ||||||
|  |             else: | ||||||
|  |                 raise ValidationError( | ||||||
|  |                     _("Produktionslinie \'%s\' kann nicht zugeordnet werden" % vals['line_id'])) | ||||||
|  |         return vals | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def _get_specified_fields(self): | ||||||
|  |         return ['origin', 'client_order_ref', 'note', 'date_order', 'assembled', 'line_id', 'partner_id', | ||||||
|  |                 'fiscal_position_id', 'user_id', 'payment_term_id', 'partner_delivery_id', 'partner_invoice_id'] | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class SaleOrderLine(models.Model): | ||||||
|  |     _inherit = 'sale.order.line' | ||||||
|  | 
 | ||||||
|  |     lot_id = fields.Many2one(comodel_name='stock.production.lot', string='Lot') | ||||||
|  | 
 | ||||||
|  |     @api.model | ||||||
|  |     def correct_values(self, vals): | ||||||
|  |         if vals.get('product_id', False): | ||||||
|  |             product_id = self.env['product.product'].search([('default_code', '=', vals['product_id'])]) | ||||||
|  |             if product_id: | ||||||
|  |                 vals['product_id'] = product_id.id | ||||||
|  |             else: | ||||||
|  |                 raise ValidationError( | ||||||
|  |                     _("Produkt \'%s\' kann nicht zugeordnet werden" % vals['product_id'])) | ||||||
|  |         return vals | ||||||
|  | @ -0,0 +1,28 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | ############################################################################## | ||||||
|  | # | ||||||
|  | #    datenpol gmbh | ||||||
|  | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
|  | # | ||||||
|  | #    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 <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | ############################################################################## | ||||||
|  | 
 | ||||||
|  | from odoo import fields, models | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class StockProductionLot(models.Model): | ||||||
|  |     _inherit = 'stock.production.lot' | ||||||
|  | 
 | ||||||
|  |     notes = fields.Text() | ||||||
|  | @ -1,2 +1,9 @@ | ||||||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||||||
| 
 | access_res_line_user,access_res_line_user,model_res_line,base.group_user,1,0,0,0 | ||||||
|  | access_res_line_sales_manager,access_res_line_sales_manager,model_res_line,sales_team.group_sale_manager,1,1,1,1 | ||||||
|  | access_res_partner_sector_user,access_res_partner_sector_user,model_res_partner_sector,base.group_user,1,0,0,0 | ||||||
|  | access_res_partner_sector_sales_manager,access_res_partner_sector_sales_manager,model_res_partner_sector,sales_team.group_sale_manager,1,1,1,1 | ||||||
|  | access_material_type_user,access_material_type_user,model_material_type,base.group_user,1,0,0,0 | ||||||
|  | access_material_type_sales_manager,access_material_type_sales_manager,model_material_type,sales_team.group_sale_manager,1,1,1,1 | ||||||
|  | access_product_xcategory_user,access_product_xcategory_user,model_product_xcategory,base.group_user,1,0,0,0 | ||||||
|  | access_product_xcategory_sales_manager,access_product_xcategory_sales_manager,model_product_xcategory,sales_team.group_sale_manager,1,1,1,1 | ||||||
|  |  | ||||||
| 
 | 
|  | @ -0,0 +1,43 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <odoo> | ||||||
|  | 
 | ||||||
|  |     <record id="material_type_form_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">material_type_form_view</field> | ||||||
|  |         <field name="model">material.type</field> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <form string="Materialtyp"> | ||||||
|  |                 <group> | ||||||
|  |                     <field name="name"/> | ||||||
|  |                     <field name="print_default_code"/> | ||||||
|  |                 </group> | ||||||
|  |             </form> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="material_type_tree_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">material_type_tree_view</field> | ||||||
|  |         <field name="model">material.type</field> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <tree> | ||||||
|  |                 <field name="name"/> | ||||||
|  |                 <field name="print_default_code"/> | ||||||
|  |             </tree> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="material_type_action" model="ir.actions.act_window"> | ||||||
|  |         <field name="name">Materialtypen</field> | ||||||
|  |         <field name="type">ir.actions.act_window</field> | ||||||
|  |         <field name="res_model">material.type</field> | ||||||
|  |         <field name="target">current</field> | ||||||
|  |         <field name="view_type">form</field> | ||||||
|  |         <field name="view_mode">tree,form</field> | ||||||
|  |         <field name="view_id" ref="material_type_tree_view"/> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <menuitem id="menu_material_type" | ||||||
|  |               parent="sale.menu_sale_config" | ||||||
|  |               name="Materialtypen" | ||||||
|  |               action="material_type_action"/> | ||||||
|  | 
 | ||||||
|  | </odoo> | ||||||
|  | @ -0,0 +1,63 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <odoo> | ||||||
|  |     <record id="product_template_form_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">product_template_form_view</field> | ||||||
|  |         <field name="model">product.template</field> | ||||||
|  |         <field name="inherit_id" ref="product.product_template_only_form_view"/> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <div name="volume" position="after"> | ||||||
|  |                 <field name="length"/> | ||||||
|  |                 <field name="width"/> | ||||||
|  |                 <field name="thickness"/> | ||||||
|  |                 <field name="surface"/> | ||||||
|  |             </div> | ||||||
|  |             <field name="barcode" position="after"> | ||||||
|  |                 <field name="is_internal"/> | ||||||
|  |             </field> | ||||||
|  |             <field name="categ_id" position="after"> | ||||||
|  |                 <field name="xcat_id"/> | ||||||
|  |                 <field name="material_type_id"/> | ||||||
|  |                 <field name="assembly_line_ids"/> | ||||||
|  |             </field> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     <record id="product_xcategory_form_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">product_xcategory_form_view</field> | ||||||
|  |         <field name="model">product.xcategory</field> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <form string="X-Kategorie"> | ||||||
|  |                 <group> | ||||||
|  |                     <field name="name"/> | ||||||
|  |                 </group> | ||||||
|  |             </form> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="product_xcategory_tree_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">product_xcategory_tree_view</field> | ||||||
|  |         <field name="model">product.xcategory</field> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <tree> | ||||||
|  |                 <field name="name"/> | ||||||
|  |             </tree> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="product_xcategory_action" model="ir.actions.act_window"> | ||||||
|  |         <field name="name">X-Kategorien</field> | ||||||
|  |         <field name="type">ir.actions.act_window</field> | ||||||
|  |         <field name="res_model">product.xcategory</field> | ||||||
|  |         <field name="target">current</field> | ||||||
|  |         <field name="view_type">form</field> | ||||||
|  |         <field name="view_mode">tree,form</field> | ||||||
|  |         <field name="view_id" ref="product_xcategory_tree_view"/> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <menuitem id="menu_product_xcategory" | ||||||
|  |               parent="sale.menu_sale_config" | ||||||
|  |               name="X-Kategorien" | ||||||
|  |               action="product_xcategory_action"/> | ||||||
|  | 
 | ||||||
|  | </odoo> | ||||||
|  | @ -0,0 +1,43 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <odoo> | ||||||
|  | 
 | ||||||
|  |     <record id="res_line_form_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">res_line_form_view</field> | ||||||
|  |         <field name="model">res.line</field> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <form string="Produktionslinie"> | ||||||
|  |                 <group> | ||||||
|  |                     <field name="name"/> | ||||||
|  |                     <field name="description"/> | ||||||
|  |                 </group> | ||||||
|  |             </form> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="res_line_tree_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">res_line_tree_view</field> | ||||||
|  |         <field name="model">res.line</field> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <tree> | ||||||
|  |                 <field name="name"/> | ||||||
|  |                 <field name="description"/> | ||||||
|  |             </tree> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="res_line_action" model="ir.actions.act_window"> | ||||||
|  |         <field name="name">Produktionslinien</field> | ||||||
|  |         <field name="type">ir.actions.act_window</field> | ||||||
|  |         <field name="res_model">res.line</field> | ||||||
|  |         <field name="target">current</field> | ||||||
|  |         <field name="view_type">form</field> | ||||||
|  |         <field name="view_mode">tree,form</field> | ||||||
|  |         <field name="view_id" ref="res_line_tree_view"/> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <menuitem id="menu_res_line" | ||||||
|  |               parent="sale.menu_sale_config" | ||||||
|  |               name="Produktionslinien" | ||||||
|  |               action="res_line_action"/> | ||||||
|  | 
 | ||||||
|  | </odoo> | ||||||
|  | @ -0,0 +1,101 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <odoo> | ||||||
|  | 
 | ||||||
|  |     <record id="view_partner_address_form" model="ir.ui.view"> | ||||||
|  |         <field name="name">view_partner_address_form</field> | ||||||
|  |         <field name="model">res.partner</field> | ||||||
|  |         <field name="inherit_id" ref="base.view_partner_address_form"/> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <field name="street" position="before"> | ||||||
|  |                 <field name="company"/> | ||||||
|  |             </field> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="view_partner_form" model="ir.ui.view"> | ||||||
|  |         <field name="name">view_partner_form</field> | ||||||
|  |         <field name="model">res.partner</field> | ||||||
|  |         <field name="inherit_id" ref="base.view_partner_form"/> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <xpath expr="/form/sheet/group/group[1]/label" position="before"> | ||||||
|  |                 <field name="company"/> | ||||||
|  |             </xpath> | ||||||
|  | 
 | ||||||
|  |             <xpath expr="//field[@name='child_ids']/form/sheet/group/group[1]/label" | ||||||
|  |                    position="before"> | ||||||
|  |                 <field name="company"/> | ||||||
|  |             </xpath> | ||||||
|  | 
 | ||||||
|  |             <xpath expr="//page[@name='internal_notes']" position="inside"> | ||||||
|  |                 <group name="general"> | ||||||
|  |                     <group name="portal_info" string="Portal Info"> | ||||||
|  |                         <field name="info_kundennr"/> | ||||||
|  |                         <field name="info_uid"/> | ||||||
|  |                         <field name="portal_id"/> | ||||||
|  |                     </group> | ||||||
|  |                 </group> | ||||||
|  |                 <field name="line_ids"/> | ||||||
|  |             </xpath> | ||||||
|  | 
 | ||||||
|  |             <xpath expr="//field[@name='category_id']" position="after"> | ||||||
|  |                 <field name="endkunde"/> | ||||||
|  |                 <field name="partner_sector_id"/> | ||||||
|  |             </xpath> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="res_partner_portal_action" model="ir.actions.act_window"> | ||||||
|  |         <field name="name">Neue Portalkunden</field> | ||||||
|  |         <field name="type">ir.actions.act_window</field> | ||||||
|  |         <field name="res_model">res.partner</field> | ||||||
|  |         <field name="domain">[('active','=',False), ('portal_id','!=',False), ('is_company','=',False)]</field> | ||||||
|  |         <field name="target">current</field> | ||||||
|  |         <field name="view_type">form</field> | ||||||
|  |         <field name="view_mode">tree,form</field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <menuitem id="menu_res_partner_portal" | ||||||
|  |               parent="sale.sale_order_menu" | ||||||
|  |               name="Neue Portalkunden" | ||||||
|  |               action="res_partner_portal_action"/> | ||||||
|  | 
 | ||||||
|  |     <record id="res_partner_sector_form_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">res_partner_sector_form_view</field> | ||||||
|  |         <field name="model">res.partner.sector</field> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <form string="Branch"> | ||||||
|  |                 <group> | ||||||
|  |                     <field name="sequence"/> | ||||||
|  |                     <field name="name"/> | ||||||
|  |                 </group> | ||||||
|  |             </form> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="res_partner_sector_tree_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">res_partner_sector_tree_view</field> | ||||||
|  |         <field name="model">res.partner.sector</field> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <tree> | ||||||
|  |                 <field name="sequence" widget="handle"/> | ||||||
|  |                 <field name="name"/> | ||||||
|  |             </tree> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="res_partner_sector_action" model="ir.actions.act_window"> | ||||||
|  |         <field name="name">Branchen</field> | ||||||
|  |         <field name="type">ir.actions.act_window</field> | ||||||
|  |         <field name="res_model">res.partner.sector</field> | ||||||
|  |         <field name="target">current</field> | ||||||
|  |         <field name="view_type">form</field> | ||||||
|  |         <field name="view_mode">tree,form</field> | ||||||
|  |         <field name="view_id" ref="res_partner_sector_tree_view"/> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <menuitem id="menu_res_partner_sector" | ||||||
|  |               parent="sale.menu_sale_config" | ||||||
|  |               name="Branchen" | ||||||
|  |               action="res_partner_sector_action"/> | ||||||
|  | 
 | ||||||
|  | </odoo> | ||||||
|  | @ -0,0 +1,32 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <odoo> | ||||||
|  | 
 | ||||||
|  |     <record id="sale_order_form_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">sale_order_form_view</field> | ||||||
|  |         <field name="model">sale.order</field> | ||||||
|  |         <field name="inherit_id" ref="sale.view_order_form"/> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <field name="payment_term_id" position="after"> | ||||||
|  |                 <field name="assembled"/> | ||||||
|  |                 <field name="line_id"/> | ||||||
|  |                 <field name="assembly_state"/> | ||||||
|  |             </field> | ||||||
|  |             <field name="note" position="after"> | ||||||
|  |                 <separator/> | ||||||
|  |                 <field name="internal_notes"/> | ||||||
|  |                 <separator/> | ||||||
|  |                 <field name="assembly_notes"/> | ||||||
|  |             </field> | ||||||
|  |             <xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="after"> | ||||||
|  |                 <field name="lot_id"/> | ||||||
|  |             </xpath> | ||||||
|  |             <xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="after"> | ||||||
|  |                 <field name="lot_id"/> | ||||||
|  |             </xpath> | ||||||
|  |             <xpath expr="//field[@name='order_line']/kanban//field[@name='product_id']" position="after"> | ||||||
|  |                 <field name="lot_id"/> | ||||||
|  |             </xpath> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  | </odoo> | ||||||
|  | @ -0,0 +1,15 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <odoo> | ||||||
|  | 
 | ||||||
|  |     <record id="stock_production_lot_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">stock_production_lot_view</field> | ||||||
|  |         <field name="model">stock.production.lot</field> | ||||||
|  |         <field name="inherit_id" ref="stock.view_production_lot_form"/> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <field name="ref" position="after"> | ||||||
|  |                 <field name="notes"/> | ||||||
|  |             </field> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  | </odoo> | ||||||
|  | @ -1,8 +1,8 @@ | ||||||
| # -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||||
| ############################################################################## | ############################################################################## | ||||||
| # | # | ||||||
| #    OpenERP, Open Source Management Solution | #    datenpol gmbh | ||||||
| #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
| # | # | ||||||
| #    This program is free software: you can redistribute it and/or modify | #    This program is free software: you can redistribute it and/or modify | ||||||
| #    it under the terms of the GNU Affero General Public License as | #    it under the terms of the GNU Affero General Public License as | ||||||
|  | @ -18,6 +18,3 @@ | ||||||
| #    along with this program.  If not, see <http://www.gnu.org/licenses/>. | #    along with this program.  If not, see <http://www.gnu.org/licenses/>. | ||||||
| # | # | ||||||
| ############################################################################## | ############################################################################## | ||||||
| 
 |  | ||||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |  | ||||||
| 
 |  | ||||||
|  |  | ||||||
|  | @ -1,8 +1,8 @@ | ||||||
| # -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||||
| ############################################################################## | ############################################################################## | ||||||
| # | # | ||||||
| #    OpenERP, Open Source Management Solution | #    datenpol gmbh | ||||||
| #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
| # | # | ||||||
| #    This program is free software: you can redistribute it and/or modify | #    This program is free software: you can redistribute it and/or modify | ||||||
| #    it under the terms of the GNU Affero General Public License as | #    it under the terms of the GNU Affero General Public License as | ||||||
|  | @ -20,10 +20,11 @@ | ||||||
| ############################################################################## | ############################################################################## | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | # noinspection PyStatementEffect | ||||||
| { | { | ||||||
|     'name': 'Datenübernahme', |     'name': 'Datenübernahme', | ||||||
|     'category': 'Custom',  |     'category': 'Custom',  | ||||||
|     'version': '1.0', |     'version': '11.0.1.0.0', | ||||||
|     'description': """Datenübernahme""", |     'description': """Datenübernahme""", | ||||||
|     'author': 'datenpol GmbH', |     'author': 'datenpol GmbH', | ||||||
|     'website': 'http://www.datenpol.at', |     'website': 'http://www.datenpol.at', | ||||||
|  | @ -35,5 +36,3 @@ | ||||||
|     'installable': True, |     'installable': True, | ||||||
|     'auto_install': False, |     'auto_install': False, | ||||||
| } | } | ||||||
| 
 |  | ||||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |  | ||||||
|  |  | ||||||
|  | @ -0,0 +1,2 @@ | ||||||
|  | "xmlid","name","print_default_code" | ||||||
|  | "dp_dmi.unique_material_id","Material Name","True" | ||||||
| 
 | 
|  | @ -0,0 +1,2 @@ | ||||||
|  | "xmlid","name" | ||||||
|  | "dp_dmi.unique_xcategory_id","XCategory Name" | ||||||
| 
 | 
|  | @ -0,0 +1,2 @@ | ||||||
|  | "xmlid","name","description" | ||||||
|  | "dp_dmi.unique_intrastat_id","Intrastat name","Intrastat Description" | ||||||
| 
 | 
|  | @ -1,2 +1,2 @@ | ||||||
| "name","description" | "xmlid","name","description" | ||||||
| "1234","Produktionslinie 1" | "dp_dmi.unique_line_id","1234","Produktionslinie 1" | ||||||
|  |  | ||||||
| 
 | 
|  | @ -0,0 +1,2 @@ | ||||||
|  | "xmlid","name","sequence" | ||||||
|  | "dp_dmi.unique_partner_sector_id","Partner Sector name","0" | ||||||
| 
 | 
|  | @ -1,2 +1,2 @@ | ||||||
| "id","name","login","password","email","groups_id/id","tz","mobile","phone","function" | "xmlid","name","login","password","email","groups_id/id","tz","mobile","phone","function" | ||||||
| "p_xxx","Max Mustermann","mustermann@max.at","x","mustermann@max.at","base.group_sale_salesman_all_leads,account.group_account_invoice,base.group_erp_manager,stock.group_stock_user,purchase.group_purchase_user","Europe/Vienna",,, | "dp_dmi.unique_user_id","Max Mustermann","mustermann@max.at","x","mustermann@max.at","base.group_sale_salesman_all_leads,account.group_account_invoice,base.group_erp_manager,stock.group_stock_user,purchase.group_purchase_user","Europe/Vienna",,, | ||||||
|  |  | ||||||
| 
 | 
|  | @ -1,4 +1,4 @@ | ||||||
| 
 | # -*- coding: utf-8 -*- | ||||||
| 
 | 
 | ||||||
| from odoo import api, models | from odoo import api, models | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| 
 | # -*- coding: utf-8 -*- | ||||||
| 
 | 
 | ||||||
| from odoo import api, models | from odoo import api, models | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ | ||||||
|                                  style="padding-right:2px;"> |                                  style="padding-right:2px;"> | ||||||
|                                 <span class="col-xs-6 text-left">Bestelldatum:</span> |                                 <span class="col-xs-6 text-left">Bestelldatum:</span> | ||||||
|                                 <span class="col-xs-6" t-field="o.date_order" |                                 <span class="col-xs-6" t-field="o.date_order" | ||||||
|                                       t-field-options='{"format": "dd.MM.yyyy"}'/> |                                       t-options='{"format": "dd.MM.yyyy"}'/> | ||||||
|                             </div> |                             </div> | ||||||
|                             <div class="col-xs-12" style="padding-right:2px;" t-if="o.partner_ref"> |                             <div class="col-xs-12" style="padding-right:2px;" t-if="o.partner_ref"> | ||||||
|                                 <span class="col-xs-6 text-left">Lieferantenreferenz:</span> |                                 <span class="col-xs-6 text-left">Lieferantenreferenz:</span> | ||||||
|  | @ -35,7 +35,7 @@ | ||||||
|                             <div class="col-xs-12" style="padding-right:2px;" t-if="o.date_planned"> |                             <div class="col-xs-12" style="padding-right:2px;" t-if="o.date_planned"> | ||||||
|                                 <span class="col-xs-6 text-left">Geplantes Lieferdatum:</span> |                                 <span class="col-xs-6 text-left">Geplantes Lieferdatum:</span> | ||||||
|                                 <span class="col-xs-6" t-field="o.date_planned" |                                 <span class="col-xs-6" t-field="o.date_planned" | ||||||
|                                       t-field-options='{"format": "dd.MM.yyyy"}'/> |                                       t-options='{"format": "dd.MM.yyyy"}'/> | ||||||
|                             </div> |                             </div> | ||||||
|                             <div class="col-xs-12" style="padding-right:2px;" t-if="user.partner_id"> |                             <div class="col-xs-12" style="padding-right:2px;" t-if="user.partner_id"> | ||||||
|                                 <span class="col-xs-6 text-left">Ansprechpartner:</span> |                                 <span class="col-xs-6 text-left">Ansprechpartner:</span> | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| 
 | # -*- coding: utf-8 -*- | ||||||
| 
 | 
 | ||||||
| from odoo import api, models | from odoo import api, models | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -38,19 +38,19 @@ | ||||||
|                                  style="padding-right:2px;"> |                                  style="padding-right:2px;"> | ||||||
|                                 <span class="col-xs-6 text-left">Angebotsdatum:</span> |                                 <span class="col-xs-6 text-left">Angebotsdatum:</span> | ||||||
|                                 <span class="col-xs-6" t-field="o.date_order" |                                 <span class="col-xs-6" t-field="o.date_order" | ||||||
|                                       t-field-options='{"format": "dd.MM.yyyy"}'/> |                                       t-options='{"format": "dd.MM.yyyy"}'/> | ||||||
|                             </div> |                             </div> | ||||||
|                             <div t-if="o.state in ['draft','sent'] and o.validity_date" class="col-xs-12" |                             <div t-if="o.state in ['draft','sent'] and o.validity_date" class="col-xs-12" | ||||||
|                                  style="padding-right:2px;"> |                                  style="padding-right:2px;"> | ||||||
|                                 <span class="col-xs-6 text-left">Gültig bis:</span> |                                 <span class="col-xs-6 text-left">Gültig bis:</span> | ||||||
|                                 <span class="col-xs-6" t-field="o.validity_date" |                                 <span class="col-xs-6" t-field="o.validity_date" | ||||||
|                                       t-field-options='{"format": "dd.MM.yyyy"}'/> |                                       t-options='{"format": "dd.MM.yyyy"}'/> | ||||||
|                             </div> |                             </div> | ||||||
|                             <div t-if="o.state not in ['draft','sent'] and o.confirmation_date" class="col-xs-12" |                             <div t-if="o.state not in ['draft','sent'] and o.confirmation_date" class="col-xs-12" | ||||||
|                                  style="padding-right:2px;"> |                                  style="padding-right:2px;"> | ||||||
|                                 <span class="col-xs-6 text-left">Bestelldatum:</span> |                                 <span class="col-xs-6 text-left">Bestelldatum:</span> | ||||||
|                                 <span class="col-xs-6" t-field="o.confirmation_date" |                                 <span class="col-xs-6" t-field="o.confirmation_date" | ||||||
|                                       t-field-options='{"format": "dd.MM.yyyy"}'/> |                                       t-options='{"format": "dd.MM.yyyy"}'/> | ||||||
|                             </div> |                             </div> | ||||||
|                             <div class="col-xs-12" style="padding-right:2px;" t-if="o.user_id"> |                             <div class="col-xs-12" style="padding-right:2px;" t-if="o.user_id"> | ||||||
|                                 <span class="col-xs-6 text-left">Ansprechpartner:</span> |                                 <span class="col-xs-6 text-left">Ansprechpartner:</span> | ||||||
|  |  | ||||||
|  | @ -0,0 +1,22 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | ############################################################################## | ||||||
|  | # | ||||||
|  | #    datenpol gmbh | ||||||
|  | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
|  | # | ||||||
|  | #    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 <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | ############################################################################## | ||||||
|  | 
 | ||||||
|  | from . import controllers | ||||||
|  | @ -0,0 +1,36 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | ############################################################################## | ||||||
|  | # | ||||||
|  | #    datenpol gmbh | ||||||
|  | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
|  | # | ||||||
|  | #    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 <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | ############################################################################## | ||||||
|  | 
 | ||||||
|  | # noinspection PyStatementEffect | ||||||
|  | { | ||||||
|  |     'name': 'datenpol Rest to RPC', | ||||||
|  |     'category': 'Custom', | ||||||
|  |     'version': '11.0.1.0.0', | ||||||
|  |     'description': """ | ||||||
|  |     datenpol Rest to RPC. Wird als Mockup verwendet für die OdooRPC oder XMLRpc Aufrufe | ||||||
|  |     """, | ||||||
|  |     'author': 'datenpol gmbh', | ||||||
|  |     'website': 'http://www.datenpol.at/', | ||||||
|  |     'depends': [], | ||||||
|  |     'data': [], | ||||||
|  |     'installable': True, | ||||||
|  |     'auto_install': False, | ||||||
|  | } | ||||||
|  | @ -0,0 +1,22 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | ############################################################################## | ||||||
|  | # | ||||||
|  | #    datenpol gmbh | ||||||
|  | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
|  | # | ||||||
|  | #    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 <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | ############################################################################## | ||||||
|  | 
 | ||||||
|  | from . import main | ||||||
|  | @ -0,0 +1,75 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | ############################################################################## | ||||||
|  | # | ||||||
|  | #    datenpol gmbh | ||||||
|  | #    Copyright (C) 2013-TODAY datenpol gmbh (<http://www.datenpol.at/>) | ||||||
|  | # | ||||||
|  | #    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 <http://www.gnu.org/licenses/>. | ||||||
|  | # | ||||||
|  | ############################################################################## | ||||||
|  | 
 | ||||||
|  | from odoo import http | ||||||
|  | from odoo.http import request | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class MyController(http.Controller): | ||||||
|  |     @http.route('/portal_create_partner', type='json', auth='none', methods=['POST']) | ||||||
|  |     def handle_portal_create_partner(self, **post): | ||||||
|  |         values = request.jsonrequest | ||||||
|  |         partner_obj = request.env['res.partner'].sudo() | ||||||
|  |         try: | ||||||
|  |             partner_id = partner_obj.portal_create_partner(values) | ||||||
|  |         except Exception as e: | ||||||
|  |             return e.args[0] | ||||||
|  |         return partner_id | ||||||
|  | 
 | ||||||
|  |     @http.route('/pg_create_company', type='json', auth='none', methods=['POST']) | ||||||
|  |     def handle_pg_create_company(self, **post): | ||||||
|  |         values = request.jsonrequest | ||||||
|  |         partner_obj = request.env['res.partner'].sudo() | ||||||
|  |         try: | ||||||
|  |             partner_id = partner_obj.pg_create_company(values) | ||||||
|  |         except Exception as e: | ||||||
|  |             return e.args[0] | ||||||
|  |         return partner_id | ||||||
|  | 
 | ||||||
|  |     @http.route('/pg_get_orders', type='json', auth='none', methods=['POST']) | ||||||
|  |     def handle_pg_get_orders(self, **post): | ||||||
|  |         values = request.jsonrequest | ||||||
|  |         sale_order_obj = request.env['sale.order'].sudo() | ||||||
|  |         try: | ||||||
|  |             sale_order_id = sale_order_obj.pg_get_orders(values['line'], values['state'], values['limit']) | ||||||
|  |         except Exception as e: | ||||||
|  |             return e.args[0] | ||||||
|  |         return sale_order_id | ||||||
|  | 
 | ||||||
|  |     @http.route('/create_product', type='json', auth='none', methods=['POST']) | ||||||
|  |     def handle_create_product(self, **post): | ||||||
|  |         values = request.jsonrequest | ||||||
|  |         product_obj = request.env['product.template'].sudo() | ||||||
|  |         try: | ||||||
|  |             product_id = product_obj.create_product(values) | ||||||
|  |         except Exception as e: | ||||||
|  |             return e.args[0] | ||||||
|  |         return product_id | ||||||
|  | 
 | ||||||
|  |     @http.route('/pg_create_quotation', type='json', auth='none', methods=['POST']) | ||||||
|  |     def handle_pg_create_quotation(self, **post): | ||||||
|  |         values = request.jsonrequest | ||||||
|  |         sale_order_obj = request.env['sale.order'].sudo() | ||||||
|  |         try: | ||||||
|  |             sale_order_id = sale_order_obj.pg_create_quotation(values) | ||||||
|  |         except Exception as e: | ||||||
|  |             return e.args[0] | ||||||
|  |         return sale_order_id | ||||||
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 2.2 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 26 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 17 KiB | 
		Loading…
	
		Reference in New Issue