Merge branch 'develop' into website

develop
Andreas Wabro 2018-08-14 14:38:09 +02:00
commit ff936cd97b
31 changed files with 397 additions and 11 deletions

View File

@ -510,8 +510,8 @@ class SaleOrderLine(models.Model):
self.env['stock.production.lot'].browse([lot_id.id]).write({
'intrastat_id': vals.get('intrastat_id')
})
elif vals.get('intrastat_id', False) and not lot_id:
raise UserError(_('Der Intrastrat Code kann nur gesetzt werden wenn ein Lot angegeben wurde.'))
# elif vals.get('intrastat_id', False) and not lot_id:
# raise UserError(_('Der Intrastrat Code kann nur gesetzt werden wenn ein Lot angegeben wurde.'))
not_allowed_designbox_keys = ['product_uom_qty', 'product_uom', 'price_unit']
if not self.check_allowed_vals_from_designbox(not_allowed_designbox_keys, vals):

View File

@ -73,6 +73,7 @@
<field name="zip"/>
<field name="city"/>
<field name="ref"/>
<field name="portal_id" string="PID"/>
</field>
<field name="email" position="replace">
<field name="email" invisible="1"/>

View File

@ -43,6 +43,6 @@
'delivery.carrier.csv',
'res.users.role.csv',
],
'installable': True,
'installable': False,
'auto_install': False,
}

View File

@ -20,3 +20,4 @@
##############################################################################
from . import models
from . import wizards

View File

@ -35,6 +35,7 @@
'data': [
'views/account_views.xml',
'views/res_company_views.xml',
'wizards/wizard_tz_ic.xml',
'security/ir.model.access.csv',
],
'installable': True,

View File

@ -36,6 +36,15 @@ class AccountInvoice(models.Model):
charge_further = fields.Boolean(string='Weiterverrechnen', compute='_compute_charge_further', store=True,
help='Ist gesetzt, wenn das WV-Flag von mindestens einer Zeile gesetzt ist')
pg_ic_num = fields.Char('PG_IC_Nummer')
pg_ic_flag = fields.Boolean(string='IC', help='Rechnung nach PG exportiert')
pg_admin = fields.Boolean(compute='_is_pg_admin', default=False, store=False)
@api.multi
def _is_pg_admin(self):
for record in self:
record.pg_admin = self.env.user.has_group('base.group_system')
@api.multi
def _compute_inter_company_supplier_isset(self):
for record in self:

View File

@ -6,11 +6,12 @@
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_invoice_cancel']" position="after">
<!-- <xpath expr="//button[@name='action_invoice_cancel']" position="after">
<button name="reimburse_invoice" type="object"
attrs="{'invisible': ['|', ('state', '=', 'draft'), '|', ('reimburse_invoice_id', '!=', False), '|', ('type', '!=', 'out_invoice'), ('charge_further', '=', False)]}"
string="Weiterverrechnen" groups="account.group_account_invoice"/>
</xpath>
-->
<field name="payment_term_id" position="after">
<label for="charge_further"/>
<div class="o_row" name="charge_further">
@ -18,7 +19,13 @@
<button class="btn btn-primary" type="object" name="action_set_all_wv_flag" string="Setzen"/>
<button class="btn btn-primary" type="object" name="action_unset_all_wv_flag" string="Löschen"/>
</div>
<field name="reimburse_invoice_id"/>
<field name="reimburse_invoice_id" attrs="{'invisible':True}"/>
<field name="pg_admin" attrs="{'invisible':True}"/>
<field name="pg_ic_num" attrs="{'readonly': [('pg_admin','=',False)]}"/>
<field name="pg_ic_flag" attrs="{'readonly': [('pg_admin','=',False)]}"/>
<!--
<field name="pg_ic_flag" attrs="{'readonly':[('state','not in',('draft','sent'))]}"/>
-->
</field>
<xpath expr="//field[@name='invoice_line_ids']/tree//field[@name='account_id']" position="before">
@ -42,6 +49,30 @@
</field>
</record>
<record id="view_account_invoice_filter_tz" model="ir.ui.view">
<field name="name">account.invoice.select</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<field name="journal_id" position="after">
<field name="pg_ic_num" string="IC-Nummer"/>
</field>
</field>
</record>
<record id="account_invoice_tree_view_tz" model="ir.ui.view">
<field name="name">account_invoice_tree_view_tz</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_tree"/>
<field name="arch" type="xml">
<field name="number" position="after">
<field name="pg_ic_num" string="IC-Num"/>
<field name="pg_ic_flag" string="IC"/>
</field>
</field>
</record>
<!--
<record id="action_reimburse_invoice" model="ir.actions.server">
<field name="name">Intern Weiterverrechnen</field>
<field name="model_id" ref="account.model_account_invoice"/>
@ -50,5 +81,6 @@
<field name="state">code</field>
<field name="code">records.reimburse_invoice()</field>
</record>
-->
</odoo>

View File

@ -0,0 +1 @@
from . import wizard_tz_ic

View File

@ -0,0 +1,42 @@
# Copyright 2018-Today datenpol gmbh (<http://www.datenpol.at>)
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class WizardTzIc(models.TransientModel):
_name = 'wizard.tz.ic'
_description = 'Generiere IC-Rechnung'
new_pg_ic_num = fields.Char()
@api.multi
def button_tz_ic(self):
if not self.new_pg_ic_num:
raise ValidationError(_("Keine IC-Nummer angegeben"))
inv = self.env['account.invoice']
ck_ivc = inv.search([('pg_ic_num', '=', self.new_pg_ic_num), ('pg_ic_flag', '=', True)], order='id ASC',
limit=1)
if ck_ivc:
info = 'IC-Nummer bereits bei folgenden Rechnungen vergegeben!'
for ivc in ck_ivc:
info += '\n %s' % ivc.number
raise ValidationError(_(info))
for wizard in self:
error_at_ivc = False
info = 'Bitte prüfen Sie den Status folgender Rechnungen:'
active_ids = self.env.context.get('active_ids', [])
ivcs = self.env['account.invoice'].browse(active_ids)
if ivcs.exists():
for ivc in ivcs:
if not ivc.charge_further or ivc.pg_ic_flag or (ivc.state in ['draft','cancel']):
info += '\n %s, WV=%s / IC_Flag=%s / Status=%s' % (ivc.number,ivc.charge_further,ivc.pg_ic_flag,ivc.state)
error_at_ivc = True
else:
ivc.pg_ic_num = self.new_pg_ic_num
if error_at_ivc:
raise ValidationError(_(info))
action = self.env.ref('account.action_invoice_tree').read()[0]
action['domain'] = [('id', 'in', active_ids)]
return action

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018-Today datenpol gmbh(<http://www.datenpol.at>)
License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). -->
<odoo>
<record id="view_wizard_tz_ic_form" model="ir.ui.view">
<field name="name">view_wizard_tz_ic_form</field>
<field name="model">wizard.tz.ic</field>
<field name="arch" type="xml">
<form string="Wizard Import TZBox">
<group>
<p>Wollen Sie für diese Rechnungen eine IC-Rechnung erstellen?</p>
</group>
<group>
<field name="new_pg_ic_num" string="IC-Nummer"/>
</group>
<footer>
<button name="button_tz_ic"
string="IC-Rechnung vorbereiten"
class="btn-primary"
type="object"/>
<button string="Abbrechen"
class="btn-default"
special="cancel"/>
</footer>
</form>
</field>
</record>
<act_window id="action_wizard_tz_ic"
name="IC-Rechnung vorbereiten"
src_model="account.invoice"
res_model="wizard.tz.ic"
view_type="form"
view_mode="form"
key2="client_action_multi"
target="new"/>
</odoo>

View File

@ -55,11 +55,11 @@
<span class="col-xs-2" t-field="o.positions"/>
</div>
<div class="row height-20">
<div class="col-xs-3" style="padding-right: 0px;">
<div class="col-xs-3" style="padding: 0px;">
<strong>
<span style="padding-right: 5px">Rechnungsdatum:</span>
<span style="padding-right: 2px">Rechnungsdatum:</span>
</strong>
<span style="padding: 0px" t-field="o.date_invoice"/>
<span style="padding: 0px; word-break: normal;" t-field="o.date_invoice"/>
</div>
<strong>
<span class="col-xs-2">Email:</span>

View File

@ -82,6 +82,12 @@
<span class="col-xs-2">Email:</span>
</strong>
<span class="col-xs-3" t-field="res_company.email"/>
<p t-if="o.origin">
<strong>
<span class="col-xs-2">Ref:</span>
</strong>
<span class="col-xs-2" t-field="o.origin"/>
</p>
</div>
<div class="row">
<div class="col-xs-3" style="padding-right: 4px">

View File

@ -0,0 +1,27 @@
Odoo Proprietary License v1.0
This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).
You may develop Odoo modules that use the Software as a library (typically by
depending on it, importing it and using its resources), but without copying any
source code or material from the Software. You may distribute those modules
under the license of your choice, provided that this license is compatible with
the terms of the Odoo Proprietary License (For example: LGPL, MIT,
or proprietary licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.
The above copyright notice and this permission notice must be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models

View File

@ -0,0 +1,17 @@
# Copyright 2018-Today TZAustria
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
# noinspection PyStatementEffect
{
'name': 'TZ Carrier Allow Tracking Modification',
'summary' : 'allows modification of tracking number even after confirmation of delivery',
'version': '11.0.1.0.0',
'license': 'OPL-1',
'author': 'TZAustria',
'support': 'andreas.osim@glaser-co.at',
'website': 'https://www.tzaustria.at',
'depends': ['sale_stock',],
'data': ['views/delivery_carrier_track.xml',],
'installable': True,
'auto_install': False,
}

View File

@ -0,0 +1,74 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import api, fields, models, registry, SUPERUSER_ID, _
from odoo.exceptions import UserError
_logger = logging.getLogger(__name__)
class TZCarrier(models.Model):
_inherit = 'delivery.carrier'
delivery_type = fields.Selection(selection_add=[('TZCarrier', 'TZCarrier')])
# ------------------------------------------------ #
# Fixed price shipping, aka a very simple provider #
# ------------------------------------------------ #
# fixed_price = fields.Float(compute='_compute_fixed_price', inverse='_set_product_fixed_price', store=True,
# string='Fixed Price')
#
#
# @api.depends('product_id.list_price', 'product_id.product_tmpl_id.list_price')
# def _compute_fixed_price(self):
# for carrier in self:
# carrier.fixed_price = carrier.product_id.list_price
#
#
# def _set_product_fixed_price(self):
# for carrier in self:
# carrier.product_id.list_price = carrier.fixed_price
#
#
def TZCarrier_rate_shipment(self, order):
price = 0
# price = self.fixed_price
# if self.company_id.currency_id.id != order.currency_id.id:
# price = self.env['res.currency']._compute(self.company_id.currency_id, order.currency_id, price)
# return {'success': True,
# 'price': price,
# 'error_message': False,
# 'warning_message': False}
return False
def TZCarrier_send_shipping(self, pickings):
res = []
# for p in pickings:
# res = res + [{'exact_price': p.carrier_id.fixed_price,
# 'tracking_number': False}]
return res
def TZCarrier_get_tracking_link(self, picking):
lSearch = picking.carrier_tracking_ref
if self.name == 'Weiss':
if picking.carrier_tracking_ref == '?':
lSearch = picking.origin
TZLink = r'http://isis.gw-world.com/siprod/sixWeb.pStartApp?i_vcAction=SearchConLight&i_vcSearchKey=%s&i_vcAdd=Glaser&i_vclangid=DE' % lSearch
elif self.name == 'DHL':
TZLink = r'https://www.dhl.at/en/express/tracking.html?AWB=%s&brand=DHL' % lSearch
elif self.name == 'Dachser':
TZLink = r'http://partner.dachser.com/shp2/?wicket:interface=:5:pnlHead:frmHead:btnSearch::IActivePageBehaviorListener:0:-1&wicket:ignoreIfNotActive=true&random=0.35369399622175934&tfiSearch=%s' % lSearch
elif self.name == 'DPD':
TZLink = r'https://tracking.dpd.de/status/de_AT/parcel/%s' % lSearch
else:
TZLink = False
return TZLink
def TZCarrier_cancel_shipment(self, pickings):
# return True
raise UserError('Derzeit nicht möglich!')

View File

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from . import delivery_carrier_pack
from . import TZCarrier

View File

@ -0,0 +1,15 @@
# Copyright 2018-Today Tischlerzentrum gmbh (<http://www.tzaustria.at>)
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
from odoo import api, fields, models
class DeliveryCarrierTrack(models.Model):
_inherit = 'stock.picking'
@api.multi
def write(self,vals):
#Check whether the carrier_tracking_ref field has being modified
if 'carrier_tracking_ref' in vals:
self.message_post('Tracking_number geändert auf: %s' % vals.get('carrier_tracking_ref'))
return super(DeliveryCarrierTrack, self).write(vals)

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018-Today Tischlerzentrum gmbh(<http://www.tzaustria.at>)
License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). -->
<odoo>
<record id="view_delivery_carrier_track_tz" model="ir.ui.view">
<field name="name">view_delivery_carrier_track_tz</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<field name="carrier_tracking_ref" position="replace">
<!-- <field name="carrier_tracking_ref" class="oe_inline" attrs="{'readonly': [('state', '=', 'done')]}"/> -->
<field name="carrier_tracking_ref" class="oe_inline"/>
</field>
</field>
</record>
</odoo>

View File

@ -0,0 +1,27 @@
Odoo Proprietary License v1.0
This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).
You may develop Odoo modules that use the Software as a library (typically by
depending on it, importing it and using its resources), but without copying any
source code or material from the Software. You may distribute those modules
under the license of your choice, provided that this license is compatible with
the terms of the Odoo Proprietary License (For example: LGPL, MIT,
or proprietary licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.
The above copyright notice and this permission notice must be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models

View File

@ -0,0 +1,17 @@
# Copyright 2018-Today TZAustria
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
# noinspection PyStatementEffect
{
'name': 'TZ goMaps',
'summary' : 'very simple google maps integration',
'version': '11.0.1.0.0',
'license': 'OPL-1',
'author': 'TZAustria',
'support': 'andreas.osim@glaser-co.at',
'website': 'https://www.tzaustria.at',
'depends': ['base','account'],
'data': ['views/res_partner_views.xml'],
'installable': True,
'auto_install': False,
}

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class TZgoMaps(models.Model):
_inherit = 'res.partner'
@api.multi
def goMaps(self):
for record in self:
street = record.street+',' if record.street else ''
zip = ' '+record.zip+',' if record.zip else ''
city = ' '+record.city+',' if record.city else ''
country_code = ' '+record.country_id.code+',' if record.country_id.code else ''
# gomaps_link = 'https://www.google.com/maps/place/'+street.replace('/','.')+zip+city+country_code
gomaps_link = 'https://www.google.com/maps/place/' + street + zip + city + country_code
return {
'type': 'ir.actions.act_url',
'url': '%s' % gomaps_link,
'view_mode':'form'
}

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import TZgMaps

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<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">
<div name="button_box" position="inside">
<button type="object" name="goMaps" class="oe_stat_button" icon='fa-globe' string="goMaps"/>
</div>
</field>
</record>
</odoo>

View File

@ -228,6 +228,12 @@ def main():
'invalidate_email',
]
if cmd == 'decouple_dmi_module':
methods = [
'login',
'decouple_dmi_module',
]
if not methods:
print('Unbekanntes Kommando')
_usage()

View File

@ -677,13 +677,13 @@ class DatenpolFunctions(object):
else:
return True
def set_dmi_noupdate(self):
def decouple_dmi_module(self):
"""DMI: Einträge auf 'no update' setzen"""
domain = [('module', '=', 'dp_dmi'), ('noupdate', '=', False)]
domain = [('module', '=', 'dp_dmi')]
data_ids = self.odoo.env['ir.model.data'].search(domain)
vals = {'noupdate': True}
vals = {'noupdate': True, 'module':'dp_dmi_decoupled'}
return self.odoo.env['ir.model.data'].write(data_ids, vals)
def dmi_confirm_inventory(self):