Feedback 1114, 1139, 1147, 1164, 1166

develop
Ahmed Aly 2017-12-07 13:48:03 +01:00
parent 291deedcc2
commit f6181f82ef
24 changed files with 302 additions and 34 deletions

View File

@ -23,14 +23,13 @@ values = {
"phone": "+43 564564",
"mobile": "+43 677 564564",
"endkunde": True,
"portal_id": "6",
"portal_id": "9",
"company": "Bier AG",
"info_uid": "habe keine",
"info_kundennr": "K1234",
"email": "max@musterman.at",
"line_ids": ["12345"],
"opt_out": True,
"vat": False,
"lang": "de"
}

File diff suppressed because one or more lines are too long

View File

@ -10,14 +10,8 @@ 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)
result = sale_order_obj.pg_get_orders("12345", "approved", 8)
print(result)

View File

@ -11,7 +11,7 @@ odoo = odoorpc.ODOO(host, port=port)
odoo.login(db, user, pw)
values = {
"default_code": "02",
"default_code": "04",
"name": "Produktname",
"length": 45.01,
"width": 13.45,
@ -25,10 +25,12 @@ values = {
"notes": "notes",
"material_type_id": "Holz",
"categ_id": "all",
"intrastat_id": "Code",
"intrastat_id": "TEst",
"sale_ok": True,
"assembly_line_ids": ["12345", "12346"],
"list_price": 50.00
"list_price": 50.00,
"can_be_sold_unconfigured": True,
'image': "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
}
product_obj = odoo.env['product.template']

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import odoorpc
from urllib.parse import urlparse
host = 'localhost'
port = 8080
@ -11,23 +12,30 @@ odoo = odoorpc.ODOO(host, port=port)
odoo.login(db, user, pw)
values = {
"name": "Company",
"name": "Company2",
"street": "Elterleinplatz 11",
"street2": "Teststrasse 30",
"zip": 1170,
"city": "Wien",
"country_id": "AT",
"fax": "+43 55567051",
"phone": "+43 5556705",
"mobile": "+43 446783",
"endkunde": True,
"portal_id": "31",
"portal_id": "32",
"email": "company@test.at",
"opt_out": True,
"ref": "A144S3",
"ref": "A144S4",
"partner_sector_id": "Test",
"comment": "comment",
"vat": False,
"lang": "de",
"line_ids": ["L1", "L2"]
"line_ids": ["12345", "12346"],
"property_payment_term_id": "15 Tage",
"property_product_pricelist": "EUR",
"date_vat_check": "2017-08-04",
"active": True,
"retail_partner_id": "A144S3",
}
res_partner_obj = odoo.env['res.partner']

View File

@ -11,8 +11,7 @@ class ProductTemplate(models.Model):
def taxes_by_company(self, field, company_id, match_tax_ids=None):
taxes_ids = []
if match_tax_ids is None:
taxes_ids = self.env['ir.values'].get_default(
'product.template', field, company_id=company_id)
taxes_ids = self.env['ir.default'].get('product.template', field, company_id=company_id)
# If None: return default taxes if []: return empty list
if not match_tax_ids:
return isinstance(taxes_ids, list) and taxes_ids or []

View File

@ -119,7 +119,7 @@ class ProductTemplate(models.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']
'height', 'categ_id', 'can_be_sold_unconfigured', 'image']
class ProductCategory(models.Model):

View File

@ -56,6 +56,7 @@ class Partner(models.Model):
dat_vat_check = fields.Date(string='Datum letzte UID-Prüfung')
active = fields.Boolean(track_visibility='onchange')
portal_export_pending = fields.Boolean(string='Portal Export ausständig')
date_vat_check = fields.Date(string='Datum der letzten UID-Prüfung')
_sql_constraints = [
('ref_uniq', 'unique(ref)', 'Die Interne Referenz muss eindeutig sein'),
@ -68,7 +69,8 @@ class Partner(models.Model):
vals = self.correct_values(vals)
if not vals.get('active', False):
vals['active'] = False
return self.create(vals)
self.create(vals)
return True
@api.model
def pg_create_company(self, vals):
@ -79,14 +81,14 @@ class Partner(models.Model):
if not partner.is_company:
raise ValidationError(
_("Der Partner mit der Internen Referenz '%s' ist kein Unternehmen" % vals['ref']))
partner = self.write(vals)
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
return True
@api.model
def correct_values(self, vals):
@ -133,6 +135,24 @@ class Partner(models.Model):
raise ValidationError(_("Die Zahlungsbedingung mit dem Code \'%s\' kann nicht zugeordnet werden" % vals[
'property_payment_term_id']))
if vals.get('property_product_pricelist', False):
product_pricelist = self.env['product.pricelist'].search(
[('currency_id.name', '=', vals['property_product_pricelist'])])
if product_pricelist:
vals['property_product_pricelist'] = product_pricelist[0].id
else:
raise ValidationError(_("Die Preisliste mit der Währung \'%s\' kann nicht zugeordnet werden" % vals[
'property_product_pricelist']))
if vals.get('retail_partner_id', False):
retail_partner = self.env['res.partner'].search(
[('ref', '=', vals['retail_partner_id'])])
if retail_partner:
vals['retail_partner_id'] = retail_partner.id
else:
raise ValidationError(_("Der Händler mit der Internen Referenz \'%s\' kann nicht zugeordnet werden" % vals[
'retail_partner_id']))
return vals
@api.model
@ -144,7 +164,8 @@ class Partner(models.Model):
return common_list
elif self.env.context.get('sst_11', False):
common_list.extend(['name', 'ref', 'partner_sector_id', 'comment', 'vat', 'property_payment_term_id',
'property_pricelist_id', 'date_vat_check', 'active'])
'property_pricelist_id', 'date_vat_check', 'active', 'property_product_pricelist',
'retail_partner_id'])
return common_list
else:
return super(Partner, self)._get_specified_fields()

View File

@ -18,8 +18,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from datetime import datetime
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
class SaleOrder(models.Model):
@ -52,13 +55,22 @@ class SaleOrder(models.Model):
'filename': attachment.name,
'binary': attachment.datas.decode()
})
delivery_date = False
for picking_id in order.picking_ids:
if not delivery_date:
delivery_date = picking_id.scheduled_date
elif datetime.strptime(picking_id.scheduled_date, DEFAULT_SERVER_DATETIME_FORMAT) < datetime.strptime(
delivery_date, DEFAULT_SERVER_DATETIME_FORMAT):
delivery_date = picking_id.scheduled_date
order_list.append({
'id': order.id,
'name': order.name,
'attachments': attachment_list,
'internal_notes': order.internal_notes,
'assembly_notes': order.assembly_notes,
'user_id': order.user_id
'user_id': order.user_id.name,
'delivery_date': delivery_date
})
return order_list
@ -80,7 +92,7 @@ class SaleOrder(models.Model):
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.with_context(sst_1=True).remove_not_specified_fields(delivery_vals)
delivery_vals = delivery_partner.correct_values(delivery_vals)
delivery_vals['parent_id'] = partner.id
@ -141,6 +153,7 @@ class SaleOrder(models.Model):
lot_id = lot.id
order_lines.append(self.env['sale.order.line'].create({
'order_id': self.id,
'name': vals['name'],
'product_id': vals['product_id'],
'price_unit': vals['price_unit'],
'product_uom_qty': vals['product_uom_qty'],

View File

@ -19,8 +19,9 @@
<field name="assembly_line_ids" widget="many2many_tags" options="{'no_create': True}"/>
</field>
<xpath expr="//page[@name='general_information']/group" position="inside">
<label for="notes"/>
<field name="notes"/>
<group name="note" string="Notizen">
<field name="notes"/>
</group>
</xpath>
</field>
</record>

View File

@ -26,6 +26,14 @@
<field name="company"/>
</xpath>
<xpath expr="//page[@name='internal_notes']/field[@name='comment']" position="replace">
<group name="description">
<group string="Interner Hinweis">
<field name="comment" placeholder="Internal note..."/>
</group>
</group>
</xpath>
<xpath expr="//page[@name='internal_notes']" position="inside">
<group name="general">
<group name="portal_info" string="Portal Info">
@ -33,9 +41,9 @@
<field name="info_uid"/>
<field name="portal_id"/>
<field name="portal_export_pending"/>
<field name="line_ids" widget="many2many_tags"/>
</group>
</group>
<field name="line_ids"/>
</xpath>
<xpath expr="//field[@name='category_id']" position="after">

View File

@ -13,9 +13,13 @@
</field>
<field name="note" position="after">
<separator/>
<field name="internal_notes"/>
<group name="internal_notes" string="Notizen">
<field name="internal_notes"/>
</group>
<separator/>
<field name="assembly_notes"/>
<group name="assembly_notes" string="Notizen">
<field name="assembly_notes"/>
</group>
</field>
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="after">
<field name="lot_id"/>

View File

@ -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 models

View File

@ -0,0 +1,42 @@
# -*- 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': 'Generates Invoice for multiple orders',
'category': 'Sale',
'version': '11.0.1.0.0',
'description': """Generates Invoice for multiple orders""",
'author': 'datenpol gmbh',
'website': 'http://www.datenpol.at/',
'depends': [
'sale',
],
'data': [
'views/res_partner_views.xml',
'views/sale_views.xml',
'views/account_views.xml',
'security/ir.model.access.csv',
],
'installable': True,
'auto_install': False,
}

View File

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 20014-2016 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 sale
from . import account
from . import res_partner

View File

@ -0,0 +1,25 @@
# -*- 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
class AccountInvoiceLine(models.Model):
_inherit = 'account.invoice.line'

View File

@ -0,0 +1,39 @@
# -*- 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
class Partner(models.Model):
_inherit = 'res.partner'
retailer = fields.Boolean(string='Ist ein Händler')
retail_partner_id = fields.Many2one(comodel_name='res.partner', string='Händler', domain=[('retailer', '=', True)],
help='Wenn ein Händler existiert, dann passiert die Verrechnung über den Händler')
@api.multi
def address_get(self, adr_pref=None):
res = super(Partner, self).address_get(adr_pref=adr_pref)
for record in self:
if record.commercial_partner_id.retail_partner_id:
pass
return res

View File

@ -0,0 +1,32 @@
# -*- 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
class SaleLayoutCategory(models.Model):
_inherit = 'sale.layout_category'
order_id = fields.Many2one(comodel_name='sale.order')
@api.model
def name_search(self, name, args=None, operator='ilike', limit=100):
res = super(SaleLayoutCategory, self).name_search(name, args=args, operator=operator, limit=limit)
return res

View File

@ -0,0 +1 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
</odoo>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_partner_form_view" model="ir.ui.view">
<field name="name">res_partner_form_view</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='sales_purchases']//field[@name='customer']" position="after">
<field name="retailer"/>
</xpath>
<field name="lang" position="after">
<field name="retail_partner_id"/>
</field>
</field>
</record>
</odoo>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
</odoo>

View File

@ -130,6 +130,8 @@ class Config():
'report_intrastat',
'dp_sale_hide_discount',
'connector',
'dp_intercompany_invoicing',
'dp_retail_invoice'
]