Fälle 4605, 4602

develop
Roman Widmann 2018-01-26 08:01:03 +01:00
parent acdb5574e4
commit 6301e23338
7 changed files with 35 additions and 9 deletions

View File

@ -1,3 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import odoorpc
@ -30,7 +31,10 @@ values = {
"email": "max@musterman.at",
"line_ids": ["12345"],
"opt_out": True,
"lang": "de"
"lang": "de",
"collective_bill": False,
"retailer": True,
"incoterm": "EXW",
}
res_partner_obj = odoo.env['res.partner']

View File

@ -1,7 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import odoorpc
# host = 'erp.tzaustria.info'
# host = 'localhost'
# port = 8080
# db = 'tz-austria_1'
# user = 'tz-admin'
@ -12,9 +13,10 @@ port = 443
db = 'odoo-test'
user = 'tz-admin'
pw = '12tza345'
protocol="jsonrpc+ssl"
protocol = "jsonrpc+ssl"
odoo = odoorpc.ODOO(host, protocol=protocol, port=port)
#odoo = odoorpc.ODOO(host, port=port)
odoo.login(db, user, pw)
values = {
@ -24,7 +26,7 @@ values = {
"date_order": "2017-11-21",
"assembled": True,
"line_id": "0000",
"portal_id": "111111",
"portal_id": "59-0001",
"portal_delivery_id": "111112",
"delivery_firstname": "Huber",
"delivery_lastname": "Bauer",
@ -48,7 +50,8 @@ values = {
"price_unit": 50.00,
"product_uom_qty": 4.0,
"lot_id": {
"name": "AAA0123",
"name": "AAA012345678",
"weight": 5.5,
"notes": "notes",
"attachment_ids": [{
"filename": "logo.gif",

View File

@ -56,7 +56,7 @@ class Partner(models.Model):
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')
collective_bill = fields.Boolean(string='Sammelrechnung')
collective_bill = fields.Boolean(string='Sammelrechnung', default=True)
_sql_constraints = [
('ref_uniq', 'unique(ref)', 'Die Interne Referenz muss eindeutig sein'),
@ -153,6 +153,16 @@ class Partner(models.Model):
raise ValidationError(_("Der Händler mit der Internen Referenz \'%s\' kann nicht zugeordnet werden" % vals[
'retail_partner_id']))
if vals.get('incoterm', False):
incoterm = self.env['stock.incoterms'].search(
[('code', '=', vals['incoterm'])])
if incoterm:
vals['sale_incoterm_id'] = incoterm.id
del vals['incoterm']
else:
raise ValidationError(_("Die Lieferbedingung mit dem Code \'%s\' kann nicht zugeordnet werden" % vals[
'incoterm']))
return vals
@api.model
@ -160,7 +170,8 @@ class Partner(models.Model):
common_list = ['street', 'street2', 'zip', 'city', 'country_id', 'fax', 'phone', 'mobile',
'endkunde', 'line_ids', 'lang', 'portal_id', 'email', 'opt_out']
if self.env.context.get('sst_1', False):
common_list.extend(['firstname', 'lastname', 'midname', 'company', 'info_kundennr', 'info_uid'])
common_list.extend(['firstname', 'lastname', 'midname', 'company', 'info_kundennr',
'info_uid', 'collective_bill', 'retailer', 'incoterm'])
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',

View File

@ -154,7 +154,8 @@ class SaleOrder(models.Model):
'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
'partner_invoice_id': partner.id,
'incoterm': partner.sale_incoterm_id.id
})
order_id = self.create(vals)
if attachment_vals:
@ -187,6 +188,7 @@ class SaleOrder(models.Model):
lot = self.env['stock.production.lot'].create({
'name': vals['lot_id']['name'],
'product_id': vals['product_id'],
'weight': vals['lot_id'].get('weight'),
'notes': vals['lot_id']['notes']
})
for lot_attachment_vals in lot_attachment_values:

View File

@ -26,3 +26,4 @@ class StockProductionLot(models.Model):
_inherit = 'stock.production.lot'
notes = fields.Text()
weight = fields.Float(string='Gewicht')

View File

@ -7,6 +7,7 @@
<field name="inherit_id" ref="stock.view_production_lot_form"/>
<field name="arch" type="xml">
<field name="ref" position="after">
<field name="weight"/>
<field name="notes"/>
</field>
</field>

View File

@ -137,10 +137,14 @@
<td class="text-left">
<span t-field="order_line.product_uom_qty"/>
</td>
<td class="text-right">
<td t-if="not order_line.lot_id.weight" class="text-right">
<span t-field="order_line.product_id.weight"/>
<span t-field="order_line.product_uom"/>
</td>
<td t-if="order_line.lot_id.weight" class="text-right">
<span t-field="order_line.lot_id.weight"/>
<span t-field="order_line.product_uom"/>
</td>
<td class="text-right">
<span t-field="order_line.price_unit"/>
</td>