Merge remote-tracking branch 'origin/develop' into develop

develop
Andreas Osim 2018-06-18 17:46:04 +02:00
commit 762606d120
25 changed files with 611 additions and 15 deletions

View File

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
from . import models
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,44 @@
# -*- encoding: utf-8 -*-
###########################################################################
#
# Copyright (C) 2016 - Today Turkesh Patel. <http://www.almightycs.com>
#
# @author Turkesh Patel <info@almightycs.com>
###########################################################################
{
'name': 'Sale, Purchase and Invoice Global Discounts',
'category': 'Accounting',
'version': '1.0',
'author' : 'Almighty Consulting Services',
'support': 'info@almightycs.com',
'website' : 'http://www.almightycs.com',
'summary': """Apply Global Discounts on Sale, Purchase Orders and Invoice based on fixed amounts and percentage""",
'description': """Apply Global Discounts on Sale, Purchase Orders and Invoice based on fixed amounts and percentage.
Global Discounts
Global Discount
Fixed Amount Discount
Discount on Total
Discount in Purchase
Discount in Invoice
Discount in Sale
Global Discount in Purchase
Global Discount in Invoice
Global Discount in Sale""",
'depends': ['purchase','sale_management','account'],
'data': [
'views/purchase_view.xml',
'views/sale_view.xml',
'views/invoice_view.xml',
'views/res_config_view.xml',
],
'images': [
'static/description/discount_cover_almightycs_turkesh.png',
],
'installable': True,
'auto_install': False,
'price': 35,
'currency': 'EUR',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
from . import sale
from . import purchase
from . import invoice
from . import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,62 @@
# -*- coding: utf-8 -*-
from odoo import fields, models, api, _
from odoo.exceptions import UserError
class Invoice(models.Model):
_inherit = "account.invoice"
global_discount = fields.Boolean("Add Global Disocunt", readonly=True, states={'draft': [('readonly', False)]},)
discount_type = fields.Selection([('fixed','Fixed'),('percentage','Percentage')],
"Disocunt Type", readonly=True, states={'draft': [('readonly', False)]}, default='fixed')
discount_amount = fields.Float("Disocunt Amount", readonly=True, states={'draft': [('readonly', False)]},)
discount_percentage = fields.Float("Disocunt Percentage", readonly=True, states={'draft': [('readonly', False)]},)
@api.multi
def _discount_unset(self):
if self.env.user.company_id.invoice_discount_product_id:
self.env['account.invoice.line'].search([('invoice_id', 'in', self.ids), ('product_id', '=', self.env.user.company_id.invoice_discount_product_id.id)]).unlink()
@api.multi
def create_discount(self):
InvoiceLine = self.env['account.invoice.line']
product_id = self.env.user.company_id.invoice_discount_product_id
if not product_id:
raise UserError(_('Please set Invoice Discount product in General Settings first.'))
# Remove Discount line first
self._discount_unset()
account_id = product_id.property_account_income_id.id
if not account_id:
prop = self.env['ir.property'].get('property_account_income_categ_id', 'product.category')
account_id = prop and prop.id or False
for invoice in self:
amount = 0
if invoice.discount_type == 'fixed':
amount = invoice.discount_amount
if invoice.discount_type == 'percentage':
amount = (invoice.amount_total * invoice.discount_percentage)/100
# Apply fiscal position
taxes = product_id.taxes_id.filtered(lambda t: t.company_id.id == invoice.company_id.id)
taxes_ids = taxes.ids
if invoice.partner_id and self.fiscal_position_id:
taxes_ids = self.fiscal_position_id.map_tax(taxes, product_id, invoice.partner_id).ids
# Create the Invoice line
InvoiceLine.create({
'name': product_id.name,
'price_unit': -amount,
'account_id': account_id,
'quantity': 1.0,
'discount': 0.0,
'uom_id': product_id.uom_id.id,
'product_id': product_id.id,
'invoice_id': invoice.id,
'invoice_line_tax_ids': [(6, 0, taxes_ids)],
'sequence': 100,
})
return True

View File

@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
from odoo import fields, models, api, _
from odoo.exceptions import UserError
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
global_discount = fields.Boolean("Add Global Disocunt", readonly=True, states={'draft': [('readonly', False)]},)
discount_type = fields.Selection([('fixed','Fixed'),('percentage','Percentage')],
"Disocunt Type", readonly=True, states={'draft': [('readonly', False)]}, default='fixed')
discount_amount = fields.Float("Disocunt Amount", readonly=True, states={'draft': [('readonly', False)]},)
discount_percentage = fields.Float("Disocunt Percentage", readonly=True, states={'draft': [('readonly', False)]},)
@api.multi
def _discount_unset(self):
if self.env.user.company_id.purchase_discount_product_id:
self.env['purchase.order.line'].search([('order_id', 'in', self.ids), ('product_id', '=', self.env.user.company_id.purchase_discount_product_id.id)]).unlink()
@api.multi
def create_discount(self):
Line = self.env['purchase.order.line']
product_id = self.env.user.company_id.purchase_discount_product_id
if not product_id:
raise UserError(_('Please set Purchase Discount product in General Settings first.'))
# Remove Discount line first
self._discount_unset()
for order in self:
amount = 0
if order.discount_type == 'fixed':
amount = order.discount_amount
if order.discount_type == 'percentage':
amount = (order.amount_total * order.discount_percentage)/100
# Create the Purchase line
Line.create({
'name': product_id.name,
'price_unit': -amount,
'product_qty': 1.0,
'product_uom': product_id.uom_id.id,
'product_id': product_id.id,
'order_id': order.id,
'date_planned': fields.datetime.now(),
#'sequence': 100,
})
return True

View File

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
from odoo import fields, models, api
class ResCompany(models.Model):
_inherit = "res.company"
purchase_discount_product_id = fields.Many2one('product.product', string='Purchase Discount Product')
sale_discount_product_id = fields.Many2one('product.product', string='Sale Discount Product')
invoice_discount_product_id = fields.Many2one('product.product', string='Invoice Discount Product')
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
purchase_discount_product_id = fields.Many2one('product.product', string='Purchase Discount Product')
sale_discount_product_id = fields.Many2one('product.product', string='Sale Discount Product')
invoice_discount_product_id = fields.Many2one('product.product', string='Invoice Discount Product')
@api.model
def get_values(self):
res = super(ResConfigSettings, self).get_values()
res.update(
purchase_discount_product_id=self.env.user.company_id.purchase_discount_product_id and self.env.user.company_id.purchase_discount_product_id.id or False,
sale_discount_product_id=self.env.user.company_id.sale_discount_product_id and self.env.user.company_id.sale_discount_product_id.id or False,
invoice_discount_product_id=self.env.user.company_id.invoice_discount_product_id and self.env.user.company_id.invoice_discount_product_id.id or False,
)
return res
@api.multi
def set_values(self):
super(ResConfigSettings, self).set_values()
if not self.env.user._is_admin():
raise AccessError(_("Only administrators can change the settings"))
self.env.user.company_id.purchase_discount_product_id = self.purchase_discount_product_id.id
self.env.user.company_id.sale_discount_product_id = self.sale_discount_product_id.id
self.env.user.company_id.invoice_discount_product_id = self.invoice_discount_product_id.id
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
from odoo import fields, models, api, _
from odoo.exceptions import UserError
class SaleOrder(models.Model):
_inherit = "sale.order"
global_discount = fields.Boolean("Add Global Disocunt", readonly=True, states={'draft': [('readonly', False)]},)
discount_type = fields.Selection([('fixed','Fixed'),('percentage','Percentage')],
"Disocunt Type", readonly=True, states={'draft': [('readonly', False)]}, default='fixed')
discount_amount = fields.Float("Disocunt Amount", readonly=True, states={'draft': [('readonly', False)]},)
discount_percentage = fields.Float("Disocunt Percentage", readonly=True, states={'draft': [('readonly', False)]},)
@api.multi
def _discount_unset(self):
if self.env.user.company_id.sale_discount_product_id:
self.env['sale.order.line'].search([('order_id', 'in', self.ids), ('product_id', '=', self.env.user.company_id.sale_discount_product_id.id)]).unlink()
@api.multi
def create_discount(self):
Line = self.env['sale.order.line']
product_id = self.env.user.company_id.sale_discount_product_id
if not product_id:
raise UserError(_('Please set Sale Discount product in General Settings first.'))
# Remove Discount line first
self._discount_unset()
for order in self:
amount = 0
if order.discount_type == 'fixed':
amount = order.discount_amount
if order.discount_type == 'percentage':
amount = (order.amount_total * order.discount_percentage)/100
# Create the Sale line
Line.create({
'name': product_id.name,
'price_unit': -amount,
'quantity': 1.0,
'discount': 0.0,
'product_uom': product_id.uom_id.id,
'product_id': product_id.id,
'order_id': order.id,
'sequence': 100,
})
return True

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,109 @@
<head>
<style>
.backgrounds{background-color:#fff; color:#0B80E6}
</style>
</head>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12 oe_mt32 mb32">
<h3 class="oe_slogan">Sale, Purchase and Invoice Global Discounts.</h3><h4><br/>In many cases we need to give some global discount on order. To handle such cases we have added this module where you can add discounts based on percentage or fixed amount.<br/>You will need to configure discount product in general settings and that product will be added as discount on Order. So you can set proper account on product and get expected analysis for account in related accounting reports</h4>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_demo oe_picture oe_screenshot">
<a href="http://www.almightycs.com/blog/blogs-1/post/add-global-discounts-in-odoo-42" target="_blank">
<img src="discount_settings_almightycs_odoo_turkesh_patel.png">
</a>
<div class="oe_demo_footer oe_centeralign">Set Discount product on general setting.</div>
</div>
<div class="oe_demo oe_picture oe_screenshot mt92">
<a href="http://www.almightycs.com/blog/blogs-1/post/add-global-discounts-in-odoo-42" target="_blank">
<img src="sale_discount_almightycs_odoo_turkesh_patel.png">
</a>
<div class="oe_demo_footer oe_centeralign">Fields to add discount on Sale Order.</div>
</div>
<div class="oe_demo oe_picture oe_screenshot mt92">
<a href="http://www.almightycs.com/blog/blogs-1/post/add-global-discounts-in-odoo-42" target="_blank">
<img src="purchase_discount_almightycs_odoo_turkesh_patel.png">
</a>
<div class="oe_demo_footer oe_centeralign">Fields to add discount on Puchase Order.</div>
</div>
<div class="oe_demo oe_picture oe_screenshot mt92">
<a href="http://www.almightycs.com/blog/blogs-1/post/add-global-discounts-in-odoo-42" target="_blank">
<img src="invoice_discount_almightycs_odoo_turkesh_patel.png">
</a>
<div class="oe_demo_footer oe_centeralign">Fields to add discount on Invoice.</div>
</div>
<div class="oe_demo oe_picture oe_screenshot mt92">
<a href="http://www.almightycs.com/blog/blogs-1/post/add-global-discounts-in-odoo-42" target="_blank">
<img src="bill_discount_almightycs_odoo_turkesh_patel.png">
</a>
<div class="oe_demo_footer oe_centeralign">Fields to add discount on Bill.</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h3 class="oe_slogan">Other Configuration</h3>
<p class="oe_slogan">To use this module no technical knowledge is required even no configuration is needed. Just install module and functionality is ready to use. For more customization and help contactus.</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="http://www.almightycs.com" target="_blank">
<img src="acs.png" width="200" height="auto">
</a>
<div class="oe_demo_footer oe_centeralign">Meet Us</div>
</div>
</div>
<div class="oe_span6">
<br/><br/>
<h2 class="oe_slogan">Do you need help?</h2>
<h3 class="oe_slogan">
Let's offer you the best services!
</h3>
<p class="oe_mt32 text-center">
Contact us by our official channels.
</p>
<p class="oe_mt32 text-center">
Skype: turkesh4friends
</p>
<div class="oe_spaced">
<ul class="text-center list-inline">
<li>
<a href="https://in.linkedin.com/pub/patel-turkesh/1b/51b/32b" Target="_blank"><i class="fa fa-linkedin-square fa-xs backgrounds"></i></a>
</li>
<li>
<a href="https://www.facebook.com/public/Turkesh-Patel" Target="_blank"><i class="fa fa-facebook-square fa-xs backgrounds"></i></a>
</li>
<li>
<a href="https://github.com/tpa-odoo" Target="_blank"><i class="fa fa-github-square fa-xs backgrounds"></i></a>
</li>
<li>
<a href="https://plus.google.com/+TurkeshPatel" Target="_blank"><i class="fa fa-google-plus-square fa-xs backgrounds"></i></a>
</li>
<li>
<a href="https://twitter.com/turkeshpatel?lang=en" Target="_blank" ><i class="fa fa-twitter-square fa-xs backgrounds"></i></a>
</li>
<li>
<a title="Contact us" data-toggle="tooltip" data-placement="left" Target="_blank" href="http://www.almightycs.com/page/website.contactus"><i class="fa fa-envelope-square fa-xs backgrounds"></i></a>
</li>
</ul>
</div>
</div>
</div>
</section>

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Invoice View -->
<record id="invoice_form" model="ir.ui.view">
<field name="name">account.invoice.form.withholding</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='user_id']" position="after">
<label for="global_discount"/>
<div name='global_discount'>
<div>
<field name='global_discount' class="oe_inline" nolabel="1" attrs="{'invisible': [('state','!=', 'draft')]}"/>
<field name='discount_type' class="oe_inline" nolabel="1" attrs="{'invisible': ['|',('global_discount','=', False), ('state','!=', 'draft')], 'required':[('global_discount','!=', False)]}"/>
<field name='discount_amount' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('global_discount','=', False), ('state','!=', 'draft'),('discount_type','!=','fixed')]}"/>
<field name='discount_percentage' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('global_discount','=', False), ('state','!=', 'draft'),('discount_type','!=','percentage')]}"/>
<button name="create_discount" string="Add Line" type="object" class="oe_inline fa fa-arrow-right oe_link" attrs="{'invisible': ['|',('global_discount','=', False), ('state','!=', 'draft')]}"/>
</div>
</div>
</xpath>
</data>
</field>
</record>
<!-- Bill View -->
<record id="invoice_supplier_form" model="ir.ui.view">
<field name="name">account.invoice.form.withholding</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='date_due']" position="after">
<label for="global_discount"/>
<div name='global_discount'>
<div>
<field name='global_discount' class="oe_inline" nolabel="1" attrs="{'invisible': [('state','!=', 'draft')]}"/>
<field name='discount_type' class="oe_inline" nolabel="1" attrs="{'invisible': ['|',('global_discount','=', False), ('state','!=', 'draft')], 'required':[('global_discount','!=', False)]}"/>
<field name='discount_amount' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('global_discount','=', False), ('state','!=', 'draft'),('discount_type','!=','fixed')]}"/>
<field name='discount_percentage' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('global_discount','=', False), ('state','!=', 'draft'),('discount_type','!=','percentage')]}"/>
<button name="create_discount" string="Add Line" type="object" class="oe_inline fa fa-arrow-right oe_link" attrs="{'invisible': ['|',('global_discount','=', False), ('state','!=', 'draft')]}"/>
</div>
</div>
</xpath>
</data>
</field>
</record>
</odoo>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Purchase View -->
<record id="purchase_order_form" model="ir.ui.view">
<field name="name">purchase.order.form.rounding</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='origin']" position="after">
<label for="global_discount"/>
<div name='global_discount'>
<div>
<field name='global_discount' class="oe_inline" nolabel="1" attrs="{'invisible': [('state','!=', 'draft')]}"/>
<field name='discount_type' class="oe_inline" nolabel="1" attrs="{'invisible': ['|',('global_discount','=', False), ('state','!=', 'draft')], 'required':[('global_discount','!=', False)]}"/>
<field name='discount_amount' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('global_discount','=', False), ('state','!=', 'draft'),('discount_type','!=','fixed')]}"/>
<field name='discount_percentage' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('global_discount','=', False), ('state','!=', 'draft'),('discount_type','!=','percentage')]}"/>
<button name="create_discount" string="Add Line" type="object" class="oe_inline fa fa-arrow-right oe_link" attrs="{'invisible': ['|',('global_discount','=', False), ('state','!=', 'draft')]}"/>
</div>
</div>
</xpath>
</data>
</field>
</record>
</odoo>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
<field name="arch" type="xml">
<field name="company_id" position="before">
<div id="discount">
<h2>Discount Configuration</h2>
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_right_pane">
<label string="Default Discount Products"/>
<div class="content-group">
<div class="mt16 row">
<label for="sale_discount_product_id" class="col-xs-3 col-md-3 o_light_label"/>
<field name="sale_discount_product_id" class="oe_inline"/>
</div>
<div class="mt16 row">
<label for="purchase_discount_product_id" class="col-xs-3 col-md-3 o_light_label"/>
<field name="purchase_discount_product_id" class="oe_inline"/>
</div>
<div class="mt16 row">
<label for="invoice_discount_product_id" class="col-xs-3 col-md-3 o_light_label"/>
<field name="invoice_discount_product_id" class="oe_inline"/>
</div>
</div>
</div>
</div>
</div>
</div>
</field>
</field>
</record>
</odoo>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Sale View -->
<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.order.form.rounding</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='payment_term_id']" position="after">
<label for="global_discount"/>
<div name='global_discount'>
<div>
<field name='global_discount' class="oe_inline" nolabel="1" attrs="{'invisible': [('state','!=', 'draft')]}"/>
<field name='discount_type' class="oe_inline" nolabel="1" attrs="{'invisible': ['|',('global_discount','=', False), ('state','!=', 'draft')], 'required':[('global_discount','!=', False)]}"/>
<field name='discount_amount' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('global_discount','=', False), ('state','!=', 'draft'),('discount_type','!=','fixed')]}"/>
<field name='discount_percentage' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('global_discount','=', False), ('state','!=', 'draft'),('discount_type','!=','percentage')]}"/>
<button name="create_discount" string="Add Line" type="object" class="oe_inline fa fa-arrow-right oe_link" attrs="{'invisible': ['|',('global_discount','=', False), ('state','!=', 'draft')]}"/>
</div>
</div>
</xpath>
</data>
</field>
</record>
</odoo>

View File

@ -37,7 +37,7 @@ msgstr "Untere Bemerkungen"
#. module: invoice_comment_template
#: model:ir.ui.view,arch_db:invoice_comment_template.invoice_form_add_comment
msgid "Comments"
msgstr "Bemerkungen"
msgstr "Textbausteine"
#. module: invoice_comment_template
#: model:ir.ui.menu,name:invoice_comment_template.menu_base_comment_template_invoice

View File

@ -0,0 +1,76 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_comment_template
#
# Translators:
# Rudolf Schnapka <rs@techno-flex.de>, 2017
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-16 11:59+0000\n"
"PO-Revision-Date: 2017-05-16 11:59+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: sale_comment_template
#: model:ir.model.fields,field_description:sale_comment_template.field_sale_order_note2
msgid "Bottom Comment"
msgstr "Untere Bemerkung"
#. module: sale_comment_template
#: model:ir.model.fields,field_description:sale_comment_template.field_sale_order_comment_template2_id
msgid "Bottom Comment Template"
msgstr "Vorlage für Untere Bemerkung"
#. module: sale_comment_template
#: model:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment
msgid "Bottom Comments"
msgstr "Untere Bemerkungen"
#. module: sale_comment_template
#: model:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment
msgid "Comments"
msgstr "Textbausteine"
#. module: sale_comment_template
#: model:ir.ui.menu,name:sale_comment_template.menu_base_comment_template_sale
msgid "Document Comments"
msgstr "Dokument-Bemerkungen"
#. module: sale_comment_template
#: model:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment
msgid "Load a template"
msgstr "Vorlage öffnen"
#. module: sale_comment_template
#: model:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment
msgid ""
"The comments will be displayed on the printed document. You can load a "
"predefined template, write your own text or load a template and then modify "
"it only for this document."
msgstr ""
"Bemerkungen werden im gedruckten Dokument angezeigt. Sie können zuvor "
"erstellte Vorlagen verwenden, Ihren eigenen Text erfassen oder eine Vorlage "
"öffnen und diese für dieses Dokument anpassen."
#. module: sale_comment_template
#: model:ir.model.fields,field_description:sale_comment_template.field_sale_order_note1
msgid "Top Comment"
msgstr "Obere Bemerkungen"
#. module: sale_comment_template
#: model:ir.model.fields,field_description:sale_comment_template.field_sale_order_comment_template1_id
msgid "Top Comment Template"
msgstr "Vorlagen für obere Bemerkungen"
#. module: sale_comment_template
#: model:ir.ui.view,arch_db:sale_comment_template.sale_order_form_add_comment
msgid "Top Comments"
msgstr "Obere Bemerkungen"

View File

@ -105,15 +105,16 @@ class Partner(models.Model):
users = self.env.ref('dp_custom.group_inform_on_new_company').users
for user in users:
values = {'user_id': user.id,
'date_deadline': fields.Date.today(),
'activity_type_id': self.env.ref('mail.mail_activity_data_todo').id,
'activity_category': 'default',
'res_id': recordset.id,
'res_model': recordset._name,
'res_model_id': self.env.ref('base_partner_sequence.model_res_partner').id,
"summary": "Es wurde ein neuer Portalkunde angelegt"
}
values = {
'user_id': user.id,
'date_deadline': fields.Date.today(),
'activity_type_id': self.env.ref('mail.mail_activity_data_todo').id,
'activity_category': 'default',
'res_id': recordset.id,
'res_model': recordset._name,
'res_model_id': self.env.ref('base_partner_sequence.model_res_partner').id,
'summary': 'Es wurde ein neuer Portalkunde angelegt'
}
self.env['mail.activity'].create(values)
return True
@ -326,7 +327,7 @@ class Partner(models.Model):
data=json.dumps(data))
if response.status_code != 200:
data = response.json()
error_string = data.get('errors',[])
error_string = data.get('errors', [])
raise ValidationError(_('Rabatt konnte nicht gesetzt werden. '
'Status Code: %s, Reason: %s') % (response.status_code, error_string))
@ -364,6 +365,13 @@ class Partner(models.Model):
res.append((partner.id, name))
return res
@api.model
def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None):
for context_element in self.env.context:
if context_element.startswith('search_default_activities_'):
return super(Partner, self.with_context(active_test=False)).search_read(domain=domain, fields=fields, offset=offset, limit=limit, order=order)
return super(Partner, self).search_read(domain=domain, fields=fields, offset=offset, limit=limit, order=order)
@api.depends('company_name', 'parent_id.is_company', 'commercial_partner_id.name')
def _compute_commercial_company_name(self):
res = super(Partner, self)._compute_commercial_company_name()

View File

@ -1,11 +1,13 @@
# 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 import fields, models
class DeliveryCarrier(models.Model):
_inherit = 'delivery.carrier'
integration_level = fields.Selection([('none', 'NONE'), ('rate', 'Get Rate'),
('rate_and_ship', 'Get Rate and Create Shipment')], string="Integration Level", default='none', help="Action while validating Delivery Orders")
('rate_and_ship', 'Get Rate and Create Shipment')],
string="Integration Level", default='none',
help="Action while validating Delivery Orders")

View File

@ -150,7 +150,8 @@ class Config(object):
'dp_show_company',
'mass_editing',
'tz_carrier_show_integration',
'base_partner_sequence'
'base_partner_sequence',
'global_discount'
]
# Setze das Feld "Attachment" im Report (wenn gesetzt wird das PDF in den Anhängen gespeichert)