Merge remote-tracking branch 'origin/develop' into develop
commit
8a628883ca
|
|
@ -30,7 +30,7 @@ values = {
|
|||
"line_ids": ["0000"],
|
||||
"opt_out": True,
|
||||
"lang": "de",
|
||||
"retailer": True,
|
||||
"is_retailer": True,
|
||||
}
|
||||
|
||||
res_partner_obj = odoo.env['res.partner']
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ values = {
|
|||
"date_vat_check": "2017-08-04",
|
||||
"active": True,
|
||||
"retail_partner_id": "004354",
|
||||
"retailer": False,
|
||||
"is_retailer": False,
|
||||
"collective_bill": False,
|
||||
"fiscal_position": "Drittland",# IG-Ausland, Drittland or False
|
||||
"carrier_id": "LKW"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
'report_intrastat',
|
||||
'dp_intercompany_invoicing',
|
||||
'sale_partner_incoterm',
|
||||
'base_user_role',
|
||||
'base_user_role'
|
||||
],
|
||||
'data': [
|
||||
'views/commission_account.xml',
|
||||
|
|
@ -49,6 +49,7 @@
|
|||
'data/glaser_company_data.xml',
|
||||
'data/tz_austria_company_data.xml',
|
||||
'data/product_data.xml',
|
||||
'data/tax_data.xml',
|
||||
'data/cron_job.xml',
|
||||
'views/dp_custom_views.xml',
|
||||
'views/res_line_views.xml',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="account_tax_20_mwst" model="account.tax">
|
||||
<field name="name">20% MwSt.</field>
|
||||
<field name="description">20% MwSt.</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="amount">20</field>
|
||||
<field name="bmd_tax_code">1</field>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_10_mwst" model="account.tax">
|
||||
<field name="name">10% MwSt.</field>
|
||||
<field name="description">10% MwSt.</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="amount">10</field>
|
||||
<field name="bmd_tax_code">1</field>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_0_mwst" model="account.tax">
|
||||
<field name="name">0% MwSt.</field>
|
||||
<field name="description">0% MwSt.</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="amount">0</field>
|
||||
<field name="bmd_tax_code">1</field>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_0_reverse_charge" model="account.tax">
|
||||
<field name="name">0% Reverse Charge</field>
|
||||
<field name="description">0% Rev. Chg.</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="amount">0</field>
|
||||
<field name="bmd_tax_code">7</field>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_0_drittland" model="account.tax">
|
||||
<field name="name">0% Drittland</field>
|
||||
<field name="description">0% Drittland</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="amount">0</field>
|
||||
<field name="bmd_tax_code">5</field>
|
||||
</record>
|
||||
|
||||
<record id="account_fiscal_position_ig_ausland" model="account.fiscal.position">
|
||||
<field name="name">IG-Ausland</field>
|
||||
<field name="note">Übergang der Steuerschuld auf den Leistungsempfänger gem § 19 Abs 1
|
||||
UStG
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_fiscal_position_tax_ig_ausland" model="account.fiscal.position.tax">
|
||||
<field name="tax_src_id" search="[('name','=','20% MwSt.')]"/>
|
||||
<field name="tax_dest_id" search="[('name','=','0% Reverse Charge')]"/>
|
||||
<field name="position_id" ref="account_fiscal_position_ig_ausland"/>
|
||||
</record>
|
||||
|
||||
<record id="account_fiscal_position_drittland" model="account.fiscal.position">
|
||||
<field name="name">Drittland</field>
|
||||
<field name="note"/>
|
||||
</record>
|
||||
|
||||
<record id="account_fiscal_position_tax_drittland" model="account.fiscal.position.tax">
|
||||
<field name="tax_src_id" search="[('name','=','20% MwSt.')]"/>
|
||||
<field name="tax_dest_id" search="[('name','=','0% Drittland')]"/>
|
||||
<field name="position_id" ref="account_fiscal_position_drittland"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -54,12 +54,14 @@ class AccountInvoiceLine(models.Model):
|
|||
|
||||
def write(self, vals):
|
||||
res = super(AccountInvoiceLine, self).write(vals)
|
||||
if vals.get('intrastat_id', False) and vals.get('lot_id', False):
|
||||
self.env['stock.production.lot'].browse([vals.get('lot_id', False)]).write({
|
||||
'intrastat_id': vals.get('intrastat_id')
|
||||
})
|
||||
elif vals.get('intrastat_id', False) and not vals.get('lot_id', False):
|
||||
raise UserError(_('Der Intrastrat Code kann nur gesetzt werden wenn ein Lot angegeben wurde.'))
|
||||
for record in self:
|
||||
lot_id = record.lot_id if 'lot_id' not in vals else vals.get('lot_id', False)
|
||||
if vals.get('intrastat_id', False) and lot_id:
|
||||
self.env['stock.production.lot'].browse([vals.get('lot_id', False)]).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.'))
|
||||
return res
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -216,7 +216,8 @@ class Partner(models.Model):
|
|||
_("Die Lieferbedingung mit dem Code \'%s\' kann nicht zugeordnet werden") % vals['incoterm'])
|
||||
|
||||
if vals.get('company_odoo_id', False):
|
||||
parent_id = self.env['res.partner'].with_context(active_test=False).search([('id', '=', vals['company_odoo_id'])])
|
||||
parent_id = self.env['res.partner'].with_context(active_test=False).search(
|
||||
[('id', '=', vals['company_odoo_id'])])
|
||||
if parent_id:
|
||||
vals['parent_id'] = parent_id.id
|
||||
vals['street'] = parent_id.street
|
||||
|
|
@ -240,6 +241,20 @@ class Partner(models.Model):
|
|||
raise ValidationError(
|
||||
_("Die Auslieferungsmethode mit dem Namen \'%s\' existiert nicht") % vals['carrier_id'])
|
||||
|
||||
if 'fiscal_position' in vals:
|
||||
if not vals.get('fiscal_position', False):
|
||||
vals['property_account_position_id'] = False
|
||||
del vals['fiscal_position']
|
||||
else:
|
||||
property_account_position_id = self.env['account.fiscal.position'].search(
|
||||
[('name', '=', vals['fiscal_position'])])
|
||||
if property_account_position_id:
|
||||
vals['property_account_position_id'] = property_account_position_id.id
|
||||
del vals['fiscal_position']
|
||||
else:
|
||||
raise ValidationError(
|
||||
_("Steuerzuorndung \'%s\' kann nicht zugeordnet werden") % vals['fiscal_position'])
|
||||
|
||||
return vals
|
||||
|
||||
@api.model
|
||||
|
|
@ -247,15 +262,15 @@ 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(['name', 'name2', 'info_kundennr', 'info_uid', 'retailer'])
|
||||
common_list.extend(['name', 'name2', 'info_kundennr', 'info_uid', 'comment', 'retail_partner_id'])
|
||||
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_product_pricelist',
|
||||
'retail_partner_id', 'retailer', 'info_uid', 'name2', 'carrier_id'])
|
||||
'date_vat_check', 'active', 'property_product_pricelist', 'retail_partner_id',
|
||||
'is_retailer', 'name2', 'carrier_id', 'collective_bill', 'fiscal_position'])
|
||||
return common_list
|
||||
elif self.env.context.get('sst_14', False):
|
||||
common_list.extend(['firstname', 'lastname', 'midname', 'company_odoo_id'])
|
||||
common_list = ['firstname', 'lastname', 'midname', 'email', 'company_odoo_id', 'portal_id', 'opt_out']
|
||||
return common_list
|
||||
else:
|
||||
return super(Partner, self)._get_specified_fields()
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class SaleOrder(models.Model):
|
|||
@api.onchange('partner_invoice_id')
|
||||
def _onchange_partner_invoice_id(self):
|
||||
for record in self:
|
||||
if record.partner_invoice_id.retailer:
|
||||
if record.partner_invoice_id.is_retailer:
|
||||
record.payment_term_id = record.partner_invoice_id.property_payment_term_id
|
||||
|
||||
@api.multi
|
||||
|
|
@ -458,7 +458,7 @@ class SaleOrderLine(models.Model):
|
|||
vals = line._prepare_invoice_line(qty=qty)
|
||||
vals.update({'invoice_id': invoice_id, 'sale_line_ids': [(6, 0, [line.id])]})
|
||||
invoice_lines |= self.env['account.invoice.line'].create(vals)
|
||||
if line.order_id.partner_invoice_id.retailer:
|
||||
if line.order_id.partner_invoice_id.is_retailer:
|
||||
discount = line.calc_discount()
|
||||
discount = int(round(discount))
|
||||
if discount > 0:
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ 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)],
|
||||
is_retailer = fields.Boolean(string='Ist ein Händler')
|
||||
retail_partner_id = fields.Many2one(comodel_name='res.partner', string='Händler', domain=[('is_retailer', '=', True)],
|
||||
help='Wenn ein Händler existiert, dann passiert die Verrechnung über den Händler')
|
||||
|
||||
@api.multi
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<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"/>
|
||||
<field name="is_retailer"/>
|
||||
</xpath>
|
||||
<field name="lang" position="after">
|
||||
<field name="retail_partner_id"/>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ class Config(object):
|
|||
|
||||
self.module_name = None
|
||||
self.lang = 'de_DE' # de_DE, en_US
|
||||
self.default_sales_tax = 'Mehrwertsteuer 20%'
|
||||
self.default_supplier_tax = 'Vorsteuer 20%'
|
||||
self.default_sales_tax = '20% MwSt'
|
||||
self.default_supplier_tax = '20% VSt'
|
||||
self.price_decimals = 2 # Nachkommastellen Preis
|
||||
self.uom_decimals = 3 # Nachkommastellen Mengeneinheiten
|
||||
|
||||
|
|
@ -30,14 +30,19 @@ class Config(object):
|
|||
# [pick_pack_ship] Verpacken Sie die Produkte an einer Pack-Station bevor Sie den Versand vornehmen
|
||||
self.delivery_steps = 'ship_only'
|
||||
|
||||
# Aktive Steuern
|
||||
self.valid_taxes = [
|
||||
'20% MwSt.',
|
||||
'10% MwSt.',
|
||||
'0% MwSt.',
|
||||
'0% Rev. Chg.',
|
||||
'0% Drittland'
|
||||
]
|
||||
|
||||
# Aktive Steuerzuordnungen
|
||||
self.valid_fiscal_positions = [
|
||||
# 'Lieferant EU (ohne Ust-ID)',
|
||||
# 'Lieferant EU Unternehmen (mit USt-ID)',
|
||||
# 'Lieferant Ausland',
|
||||
'Kunde Ausland',
|
||||
'Kunde EU (ohne USt-ID)',
|
||||
'Kunde EU Unternehmen (mit USt-ID)',
|
||||
'IG-Ausland',
|
||||
'Drittland'
|
||||
]
|
||||
|
||||
self.settings = {
|
||||
|
|
|
|||
|
|
@ -182,11 +182,13 @@ class DatenpolFunctions(object):
|
|||
[('name', '=', c.default_sales_tax)])
|
||||
self.odoo.env['ir.default'].set('product.template', 'taxes_id', sales_tax_ids, company_id=self.company_id.id)
|
||||
# Standard Purchase Tax
|
||||
supplier_tax_ids = self.odoo.env['account.tax'].search(
|
||||
[('name', '=', c.default_supplier_tax)])
|
||||
self.odoo.env['ir.default'].set('product.template', 'supplier_taxes_id', supplier_tax_ids,
|
||||
company_id=self.company_id.id)
|
||||
return True
|
||||
# supplier_tax_ids = self.odoo.env['account.tax'].search(
|
||||
# [('name', '=', c.default_supplier_tax)])
|
||||
# self.odoo.env['ir.default'].set('product.template', 'supplier_taxes_id', supplier_tax_ids,
|
||||
# company_id=self.company_id.id)
|
||||
# return True
|
||||
tax_ids = self.odoo.env['account.tax'].search([('description', 'not in', self.config.valid_taxes)])
|
||||
return self.odoo.env['account.tax'].browse(tax_ids).write({'active': False})
|
||||
|
||||
def set_incoterms(self):
|
||||
"""Lieferbedingungen setzen"""
|
||||
|
|
@ -390,8 +392,8 @@ class DatenpolFunctions(object):
|
|||
self.odoo.env['account.fiscal.position'].write(invalid_ids, {'active': False})
|
||||
|
||||
# Mappings inaktiver Steuern löschen (also wenn rechte Seite eine inaktive Steuer ist, wie z. B "strf. i.g.L"))
|
||||
valid_position_ids = self.odoo.env['account.fiscal.position'].search(
|
||||
[('name', 'in', c.valid_fiscal_positions)])
|
||||
# valid_position_ids = self.odoo.env['account.fiscal.position'].search(
|
||||
# [('name', 'in', c.valid_fiscal_positions)])
|
||||
# valid_tax_ids = self.odoo.env['account.tax'].search([('parent_id', '=', False)])
|
||||
|
||||
# position_tax_line_ids = self.odoo.env['account.fiscal.position.tax'].search(
|
||||
|
|
|
|||
Loading…
Reference in New Issue