update für 10.0
|  | @ -1,148 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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 openerp import fields, models | ||||
| from openerp import api | ||||
| from openerp.tools.translate import _ | ||||
| from openerp import SUPERUSER_ID | ||||
| from openerp import tools | ||||
| from lxml import etree | ||||
| 
 | ||||
| DISABLED_MENUS = [ | ||||
| ] | ||||
| 
 | ||||
| class ir_ui_menu(models.Model): | ||||
|     _inherit = 'ir.ui.menu' | ||||
|      | ||||
|     @tools.ormcache(skiparg=2) | ||||
|     def get_disabled_menu_ids(self, cr, uid, context=None): | ||||
|         data_obj = self.pool.get('ir.model.data') | ||||
|          | ||||
|         menu_ids = [] | ||||
|         for menu in DISABLED_MENUS: | ||||
|             module,xml_id = menu.split('.') | ||||
|             menu = data_obj.get_object(cr, uid, module, xml_id) | ||||
|             if menu: | ||||
|                 menu_ids.append(menu.id) | ||||
|         return menu_ids   | ||||
| 
 | ||||
|     def _filter_visible_menus(self, cr, uid, ids, context=None):  | ||||
|         if uid != 1:        | ||||
|             disabled_ids = self.get_disabled_menu_ids(cr, uid) | ||||
|              | ||||
|             ids = [id for id in ids if id not in disabled_ids] | ||||
| 
 | ||||
|         ids = super(ir_ui_menu, self)._filter_visible_menus(cr, uid, ids, context) | ||||
|         return ids | ||||
| 
 | ||||
| class res_partner(models.Model): | ||||
|     _inherit = 'res.partner' | ||||
|       | ||||
|     @api.model | ||||
|     def fields_view_get_address(self, arch): | ||||
|         """ verhindert das Überschreiben von address_format """ | ||||
|         return arch | ||||
|      | ||||
| 
 | ||||
| class mail_notification(models.Model): | ||||
|     _inherit = 'mail.notification' | ||||
| 
 | ||||
|     # override original function | ||||
|     def get_signature_footer(self, cr, uid, user_id, res_model=None, res_id=None, context=None, user_signature=True): | ||||
|         """ Format a standard footer for notification emails (such as pushed messages | ||||
|             notification or invite emails). | ||||
|             Format: | ||||
|                 <p>--<br /> | ||||
|                     Administrator | ||||
|                 </p> | ||||
|                 <div> | ||||
|                     <small>Sent from <a ...>Your Company</a> using <a ...>OpenERP</a>.</small> | ||||
|                 </div> | ||||
|         """ | ||||
|         footer = "" | ||||
|         if not user_id: | ||||
|             return footer | ||||
| 
 | ||||
|         # add user signature | ||||
|         user = self.pool.get("res.users").browse(cr, SUPERUSER_ID, [user_id], context=context)[0] | ||||
|         if user_signature: | ||||
|             if user.signature: | ||||
|                 signature = user.signature | ||||
|             else: | ||||
|                 signature = "--<br />%s" % user.name | ||||
|             footer = tools.append_content_to_html(footer, signature, plaintext=False) | ||||
| 
 | ||||
|         # add company signature | ||||
| #         if user.company_id.website: | ||||
| #             website_url = ('http://%s' % user.company_id.website) if not user.company_id.website.lower().startswith(('http:', 'https:')) \ | ||||
| #                 else user.company_id.website | ||||
| #             company = "<a style='color:inherit' href='%s'>%s</a>" % (website_url, user.company_id.name) | ||||
| #         else: | ||||
| #             company = user.company_id.name | ||||
| #         sent_by = _('Sent by %(company)s using %(odoo)s') | ||||
| #  | ||||
| #         signature_company = '<br /><small>%s</small>' % (sent_by % { | ||||
| #             'company': company, | ||||
| #             'odoo': "<a style='color:inherit' href='https://www.odoo.com/'>Odoo</a>" | ||||
| #         }) | ||||
| #         footer = tools.append_content_to_html(footer, signature_company, plaintext=False, container_tag='div') | ||||
| 
 | ||||
|         return footer | ||||
|      | ||||
| # class product_product(osv.osv): | ||||
| #     _inherit = 'product.product' | ||||
| #      | ||||
| #     def name_get(self, cr, user, ids, context=None): | ||||
| #         if context is None: | ||||
| #             context = {} | ||||
| #         c = context.copy() | ||||
| #         c.update({'display_default_code': False}) | ||||
| #         return super(product_product, self).name_get(cr, user, ids, context=c)  | ||||
|      | ||||
| class sale_order_line(models.Model): | ||||
|     _inherit = 'sale.order.line' | ||||
|      | ||||
|     @api.onchange('name') | ||||
|     def onchange_name(self): | ||||
|         if self.name != False and self.product_id.id == False: | ||||
|             ir_values = self.pool.get('ir.values') | ||||
|             company = self.env['res.company'].search([], limit=1) | ||||
|             taxes_id = ir_values.get_default(self._cr, self._uid, 'product.template', 'taxes_id', company_id=company.id) | ||||
|             at = self.env['account.tax'].search([('id','=',isinstance(taxes_id, list) and taxes_id[0] or taxes_id)]) | ||||
|             self.tax_id = at | ||||
| 
 | ||||
| class product_product(models.Model): | ||||
|     _inherit = 'product.product' | ||||
|      | ||||
|     def name_get(self, cr, user, ids, context=None): | ||||
|         """ beim Angebot die Nummer nicht in das Feld Bezeichnung übernehmen""" | ||||
|         if context is None: | ||||
|             context = {} | ||||
|         c = context.copy() | ||||
|         if c.get('partner_id', False): | ||||
|             if not c.get('quantity', False): | ||||
|                 c.update({'display_default_code': False}) | ||||
|         return super(product_product, self).name_get(cr, user, ids, context=c) | ||||
| 
 | ||||
| class res_country(models.Model): | ||||
|     _inherit = 'res.country' | ||||
|      | ||||
|     active = fields.Boolean('Aktiv', default=True) | ||||
|  | @ -1,7 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <openerp> | ||||
| 	<data noupdate="1"> | ||||
|          | ||||
|         | ||||
| 	</data> | ||||
| </openerp> | ||||
|  | @ -1,111 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <openerp> | ||||
| 	<data> | ||||
| 
 | ||||
| 		<record id="base.action_partner_form" model="ir.actions.act_window"> | ||||
| 			<field name="view_mode">tree,kanban,form</field> | ||||
| 		</record> | ||||
| 
 | ||||
| 		<record id="base.action_partner_form_view1" model="ir.actions.act_window.view"> | ||||
| 			<field eval="10" name="sequence" /> | ||||
| 		</record> | ||||
| 
 | ||||
| 		<record id="partner_section_form" model="ir.ui.view"> | ||||
| 			<field name="name">partner_section_form</field> | ||||
| 			<field name="model">res.partner</field> | ||||
| 			<field name="inherit_id" ref="base.view_partner_form" /> | ||||
| 			<field name="arch" type="xml">				 | ||||
|                 <xpath expr="//div[@class='address_format'][1]" position="replace"> | ||||
|                     <div class="address_format"> | ||||
|                         <field name="zip" placeholder="PLZ" style="width: 15%%"/> | ||||
|                         <field name="city" placeholder="Stadt" style="width: 84%%"/>  | ||||
|                         <field name="state_id" invisible="1"/> | ||||
|                     </div> | ||||
|                 </xpath> | ||||
|                  | ||||
|                 <xpath expr="//form[@string='Contact']//div[@class='address_format']" position="replace"> | ||||
|                     <div class="address_format"> | ||||
|                         <field name="zip" placeholder="PLZ" style="width: 15%%"/> | ||||
|                         <field name="city" placeholder="Stadt" style="width: 84%%"/>  | ||||
|                         <field name="state_id" invisible="1"/> | ||||
|                     </div> | ||||
|                 </xpath>				 | ||||
| 			</field> | ||||
| 		</record> | ||||
|          | ||||
|         <!--  Hide product variants --> | ||||
|         <record id="product_template_variant_kanban" model="ir.ui.view"> | ||||
|             <field name="name">product_template_variant_kanban</field> | ||||
|             <field name="model">product.template</field> | ||||
|             <field name="inherit_id" ref="product.product_template_kanban_view"/> | ||||
|             <field name="arch" type="xml">  | ||||
|                 <a name="%(product.product_variant_action)d" position="replace"/>   | ||||
|             </field>                             | ||||
|         </record>    | ||||
|          | ||||
| 
 | ||||
|         <record id="product_template_custom_tree" model="ir.ui.view"> | ||||
|             <field name="name">product_template_custom_tree</field> | ||||
|             <field name="model">product.template</field> | ||||
|             <field name="inherit_id" ref="product.product_template_tree_view"/> | ||||
|             <field name="arch" type="xml">  | ||||
|                 <field name="name" position="before"> | ||||
|                     <field name="default_code"/> | ||||
|                 </field> | ||||
|                 <field name="name" position="after"> | ||||
|                     <field name="list_price"/> | ||||
|                 </field> | ||||
|                 <!-- <field name="state" position="replace"/> --> | ||||
|             </field>                             | ||||
|         </record>        | ||||
|          | ||||
|         <record id="product.product_template_action" model="ir.actions.act_window"> | ||||
|             <field name="view_mode">tree,form,kanban</field> | ||||
|             <field name="view_id"></field> | ||||
|         </record>   | ||||
|      | ||||
|         <record id="product_supplierinfo_form_view" model="ir.ui.view"> | ||||
|             <field name="name">product.supplierinfo.form.view</field> | ||||
|             <field name="model">product.supplierinfo</field> | ||||
|             <field name="inherit_id" ref="product.product_supplierinfo_form_view"/> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <field name="product_code" position="replace"> | ||||
|                 	<field name="product_code" invisible="1"/> | ||||
|                 </field> | ||||
|             </field> | ||||
|         </record> | ||||
| 
 | ||||
|         <!--  documents menu --> | ||||
| 	    <menuitem | ||||
| 	        name="Documents" | ||||
| 	        id="menu_document_main" | ||||
| 	        parent="knowledge.menu_document" | ||||
| 	        groups="base.group_document_user" | ||||
| 	        sequence="0" | ||||
| 	    />   | ||||
| 
 | ||||
| 	    <record model="ir.actions.act_window" id="action_document_files"> | ||||
| 	        <field name="name">Dokumente</field> | ||||
| 	        <field name="type">ir.actions.act_window</field> | ||||
| 	        <field name="res_model">ir.attachment</field> | ||||
| 	        <field name="view_type">form</field> | ||||
| 	        <field name="view_mode">tree,form</field> | ||||
| 	        <field name="help" type="html"> | ||||
| 	          <p class="oe_view_nocontent_create"> | ||||
| 	            Click to create a new document.  | ||||
| 	          </p><p> | ||||
| 	            The Documents repository gives you access to all attachments, such | ||||
| 	            as mails, project documents, invoices etc. | ||||
| 	          </p> | ||||
| 	        </field> | ||||
| 	    </record> | ||||
| 	             | ||||
| 	    <menuitem | ||||
| 	        name="Documents" | ||||
| 	        action="action_document_files" | ||||
| 	        id="menu_document_files" | ||||
| 	        parent="menu_document_main" | ||||
| 	        sequence="0" | ||||
| 	    />         | ||||
| 	</data> | ||||
| </openerp> | ||||
| Before Width: | Height: | Size: 2.8 KiB | 
| Before Width: | Height: | Size: 66 KiB | 
| Before Width: | Height: | Size: 82 KiB | 
|  | @ -1,11 +0,0 @@ | |||
| <openerp> | ||||
| 	<data> | ||||
| 
 | ||||
|     <template id="custom_header" inherit_id="web.layout" name="Custom Header"> | ||||
|         <xpath expr="//link[@rel='shortcut icon']" position="replace"> | ||||
|             <link rel="shortcut icon" href="/cam_custom/static/src/img/favicon.ico" type="image/x-icon"/> | ||||
|         </xpath> | ||||
|     </template> | ||||
| 
 | ||||
| 	</data> | ||||
| </openerp> | ||||
|  | @ -1,24 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| import cam_customer_pricelist | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
|  | @ -1,39 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| { | ||||
|     'name': 'Camadeus Customer Pricelist', | ||||
|     'category': 'Custom',  | ||||
|     'version': '1.0', | ||||
|     'description': """Prices per user basis""", | ||||
|     'author': 'Camadeus GmbH', | ||||
|     'website': 'http://www.camadeus.at', | ||||
|     'depends': ['product'], | ||||
|     'data': [          | ||||
|         'cam_customer_pricelist_view.xml', | ||||
|         'cam_customer_pricelist_data.xml', | ||||
|         'security/ir.model.access.csv', | ||||
|     ],   | ||||
|     'installable': True, | ||||
|     'auto_install': False, | ||||
| } | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
|  | @ -1,256 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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 openerp.osv import fields, osv | ||||
| from openerp.tools.translate import _ | ||||
| import openerp.addons.decimal_precision as dp | ||||
| import datetime | ||||
| import time | ||||
| 
 | ||||
| class product_pricelist_item(osv.osv): | ||||
|      | ||||
|     _inherit = "product.pricelist.item" | ||||
| 
 | ||||
|     def _price_field_get(self, cr, uid, context=None): | ||||
|         pt = self.pool.get('product.price.type') | ||||
|         ids = pt.search(cr, uid, [], context=context) | ||||
|         result = [] | ||||
|         for line in pt.browse(cr, uid, ids, context=context): | ||||
|             result.append((line.id, line.name)) | ||||
| 
 | ||||
|         result.append((-1, _('Other Pricelist'))) | ||||
|         result.append((-2, _('Supplier Prices on the product form'))) | ||||
|         result.append((-3, _('Kundenbezogener Preis'))) | ||||
|         return result | ||||
| 
 | ||||
|     _columns = { | ||||
|         'base': fields.selection(_price_field_get, 'Based on', required=True, size=-1, help="Base price for computation."), | ||||
|     } | ||||
|      | ||||
| class product_pricelist_customer(osv.osv): | ||||
|      | ||||
|     _name = "product.pricelist.customer"   | ||||
|     _inherit = ['mail.thread'] | ||||
|      | ||||
|     _columns = { | ||||
|         'partner_id': fields.many2one('res.partner', 'Kunde', domain="[('customer','=',True)]", required=True),  | ||||
|         'product_id': fields.many2one('product.product', 'Produkt', required=True), | ||||
|         'unit_price': fields.float('Preis pro Einheit', digits_compute=dp.get_precision('Product Price'), track_visibility='onchange'), | ||||
|         'min_quantity': fields.integer('Mindestbestellmenge', track_visibility='onchange'), | ||||
|         'date_start': fields.date('Begindatum', track_visibility='onchange'), | ||||
|         'date_end': fields.date('Enddatum', track_visibility='onchange'), | ||||
|     }   | ||||
|      | ||||
| class product_pricelist(osv.osv): | ||||
|      | ||||
|     _inherit = "product.pricelist" | ||||
|      | ||||
|     def _price_rule_get_multi(self, cr, uid, pricelist, products_by_qty_by_partner, context=None): | ||||
|         context = context or {} | ||||
|         date = context.get('date') or time.strftime('%Y-%m-%d') | ||||
| 
 | ||||
|         products = map(lambda x: x[0], products_by_qty_by_partner) | ||||
|         currency_obj = self.pool.get('res.currency') | ||||
|         product_obj = self.pool.get('product.template') | ||||
|         product_uom_obj = self.pool.get('product.uom') | ||||
|         price_type_obj = self.pool.get('product.price.type') | ||||
| 
 | ||||
|         if not products: | ||||
|             return {} | ||||
| 
 | ||||
|         version = False | ||||
|         for v in pricelist.version_id: | ||||
|             if ((v.date_start is False) or (v.date_start <= date)) and ((v.date_end is False) or (v.date_end >= date)): | ||||
|                 version = v | ||||
|                 break | ||||
|         if not version: | ||||
|             raise osv.except_osv(_('Warning!'), _("At least one pricelist has no active version !\nPlease create or activate one.")) | ||||
|         categ_ids = {} | ||||
|         for p in products: | ||||
|             categ = p.categ_id | ||||
|             while categ: | ||||
|                 categ_ids[categ.id] = True | ||||
|                 categ = categ.parent_id | ||||
|         categ_ids = categ_ids.keys() | ||||
| 
 | ||||
|         is_product_template = products[0]._name == "product.template" | ||||
|         if is_product_template: | ||||
|             prod_tmpl_ids = [tmpl.id for tmpl in products] | ||||
|             prod_ids = [product.id for product in tmpl.product_variant_ids for tmpl in products] | ||||
|         else: | ||||
|             prod_ids = [product.id for product in products] | ||||
|             prod_tmpl_ids = [product.product_tmpl_id.id for product in products] | ||||
| 
 | ||||
|         # Load all rules | ||||
|         cr.execute( | ||||
|             'SELECT i.id ' | ||||
|             'FROM product_pricelist_item AS i ' | ||||
|             'WHERE (product_tmpl_id IS NULL OR product_tmpl_id = any(%s)) ' | ||||
|                 'AND (product_id IS NULL OR (product_id = any(%s))) ' | ||||
|                 'AND ((categ_id IS NULL) OR (categ_id = any(%s))) ' | ||||
|                 'AND (price_version_id = %s) ' | ||||
|             'ORDER BY sequence, min_quantity desc', | ||||
|             (prod_tmpl_ids, prod_ids, categ_ids, version.id)) | ||||
|          | ||||
|         item_ids = [x[0] for x in cr.fetchall()] | ||||
|         items = self.pool.get('product.pricelist.item').browse(cr, uid, item_ids, context=context) | ||||
| 
 | ||||
|         price_types = {} | ||||
| 
 | ||||
|         results = {} | ||||
|         for product, qty, partner in products_by_qty_by_partner: | ||||
|             results[product.id] = 0.0 | ||||
|             rule_id = False | ||||
|             price = False | ||||
| 
 | ||||
|             # Final unit price is computed according to `qty` in the `qty_uom_id` UoM. | ||||
|             # An intermediary unit price may be computed according to a different UoM, in | ||||
|             # which case the price_uom_id contains that UoM. | ||||
|             # The final price will be converted to match `qty_uom_id`. | ||||
|             qty_uom_id = context.get('uom') or product.uom_id.id | ||||
|             price_uom_id = product.uom_id.id | ||||
|             qty_in_product_uom = qty | ||||
|             if qty_uom_id != product.uom_id.id: | ||||
|                 try: | ||||
|                     qty_in_product_uom = product_uom_obj._compute_qty( | ||||
|                         cr, uid, context['uom'], qty, product.uom_id.id or product.uos_id.id) | ||||
|                 except except_orm: | ||||
|                     # Ignored - incompatible UoM in context, use default product UoM | ||||
|                     pass | ||||
| 
 | ||||
|             for rule in items: | ||||
|                 if rule.min_quantity and qty_in_product_uom < rule.min_quantity: | ||||
|                     continue | ||||
|                 if is_product_template: | ||||
|                     if rule.product_tmpl_id and product.id != rule.product_tmpl_id.id: | ||||
|                         continue | ||||
|                     if rule.product_id: | ||||
|                         continue | ||||
|                 else: | ||||
|                     if rule.product_tmpl_id and product.product_tmpl_id.id != rule.product_tmpl_id.id: | ||||
|                         continue | ||||
|                     if rule.product_id and product.id != rule.product_id.id: | ||||
|                         continue | ||||
| 
 | ||||
|                 if rule.categ_id: | ||||
|                     cat = product.categ_id | ||||
|                     while cat: | ||||
|                         if cat.id == rule.categ_id.id: | ||||
|                             break | ||||
|                         cat = cat.parent_id | ||||
|                     if not cat: | ||||
|                         continue | ||||
| 
 | ||||
|                 if rule.base == -1: | ||||
|                     if rule.base_pricelist_id: | ||||
|                         price_tmp = self._price_get_multi(cr, uid, | ||||
|                                 rule.base_pricelist_id, [(product, | ||||
|                                 qty, False)], context=context)[product.id] | ||||
|                         ptype_src = rule.base_pricelist_id.currency_id.id | ||||
|                         price_uom_id = qty_uom_id | ||||
|                         price = currency_obj.compute(cr, uid, | ||||
|                                 ptype_src, pricelist.currency_id.id, | ||||
|                                 price_tmp, round=False, | ||||
|                                 context=context) | ||||
|                 elif rule.base == -2: | ||||
|                     seller = False | ||||
|                     for seller_id in product.seller_ids: | ||||
|                         if (not partner) or (seller_id.name.id != partner): | ||||
|                             continue | ||||
|                         seller = seller_id | ||||
|                     if not seller and product.seller_ids: | ||||
|                         seller = product.seller_ids[0] | ||||
|                     if seller: | ||||
|                         qty_in_seller_uom = qty | ||||
|                         seller_uom = seller.product_uom.id | ||||
|                         if qty_uom_id != seller_uom: | ||||
|                             qty_in_seller_uom = product_uom_obj._compute_qty(cr, uid, qty_uom_id, qty, to_uom_id=seller_uom) | ||||
|                         price_uom_id = seller_uom | ||||
|                         for line in seller.pricelist_ids: | ||||
|                             if line.min_quantity <= qty_in_seller_uom: | ||||
|                                 price = line.price | ||||
|                 elif rule.base == -3: | ||||
|                     ppc_obj = self.pool.get('product.pricelist.customer') | ||||
|                     ppc_ids = ppc_obj.search(cr, uid, [('partner_id','=',partner), ('product_id','=',product.id)], context=context) | ||||
|                      | ||||
|                     ppc_best = False | ||||
|                     today = datetime.date.today() | ||||
|                     for ppc in ppc_obj.browse(cr, uid, ppc_ids, context=context): | ||||
|                         ppc_start = ppc.date_start or '0001-01-01' | ||||
|                         ppc_start = datetime.datetime.strptime(ppc_start, '%Y-%m-%d').date() | ||||
|                         ppc_end = ppc.date_end or '9999-01-01' | ||||
|                         ppc_end = datetime.datetime.strptime(ppc_end, '%Y-%m-%d').date() | ||||
|                          | ||||
|                         # 1) Entweder es gibt noch kein best oder die best min_qty muss kleiner sein als die canditate min_qty | ||||
|                         # 2) Die qty aus der Zeile muss größer sein als die canditate min_qty | ||||
|                         # 3) Heute muss zwischen start und end datum der candite regel sein | ||||
|                         if (not ppc_best or ppc_best.min_quantity < ppc.min_quantity) and qty_in_product_uom >= ppc.min_quantity and ppc_start <= today <= ppc_end: | ||||
|                             ppc_best = ppc | ||||
|                      | ||||
|                     if ppc_best:     | ||||
|                         price = ppc_best.unit_price | ||||
|                     else: | ||||
|                         continue | ||||
|                                          | ||||
|                 else: | ||||
|                     if rule.base not in price_types: | ||||
|                         price_types[rule.base] = price_type_obj.browse(cr, uid, int(rule.base)) | ||||
|                     price_type = price_types[rule.base] | ||||
| 
 | ||||
|                     # price_get returns the price in the context UoM, i.e. qty_uom_id | ||||
|                     price_uom_id = qty_uom_id | ||||
|                     price = currency_obj.compute( | ||||
|                             cr, uid, | ||||
|                             price_type.currency_id.id, pricelist.currency_id.id, | ||||
|                             product_obj._price_get(cr, uid, [product], price_type.field, context=context)[product.id], | ||||
|                             round=False, context=context) | ||||
| 
 | ||||
|                 if price is not False: | ||||
|                     price_limit = price | ||||
|                     price = price * (1.0+(rule.price_discount or 0.0)) | ||||
|                     if rule.price_round: | ||||
|                         price = tools.float_round(price, precision_rounding=rule.price_round) | ||||
| 
 | ||||
|                     convert_to_price_uom = (lambda price: product_uom_obj._compute_price( | ||||
|                                                 cr, uid, product.uom_id.id, | ||||
|                                                 price, price_uom_id)) | ||||
|                     if rule.price_surcharge: | ||||
|                         price_surcharge = convert_to_price_uom(rule.price_surcharge) | ||||
|                         price += price_surcharge | ||||
| 
 | ||||
|                     if rule.price_min_margin: | ||||
|                         price_min_margin = convert_to_price_uom(rule.price_min_margin) | ||||
|                         price = max(price, price_limit + price_min_margin) | ||||
| 
 | ||||
|                     if rule.price_max_margin: | ||||
|                         price_max_margin = convert_to_price_uom(rule.price_max_margin) | ||||
|                         price = min(price, price_limit + price_max_margin) | ||||
| 
 | ||||
|                     rule_id = rule.id | ||||
|                 break | ||||
| 
 | ||||
|             # Final price conversion to target UoM | ||||
|             price = product_uom_obj._compute_price(cr, uid, price_uom_id, price, qty_uom_id) | ||||
| 
 | ||||
|             results[product.id] = (price, rule_id) | ||||
|         return results | ||||
|      | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
|  | @ -1,117 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <openerp> | ||||
| 	<data> | ||||
| 		 | ||||
|        <record id="product_pricelist_customer_form" model="ir.ui.view"> | ||||
|             <field name="name">product_pricelist_customer_form</field> | ||||
|             <field name="model">product.pricelist.customer</field> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <form string="Kundenbezogene Preise" version="7.0"> | ||||
| 	                <sheet> | ||||
| 	                	<group> | ||||
| 							<field name="partner_id"/> | ||||
| 		                	<field name="product_id"/>                          | ||||
| 		                    <field name="unit_price"/> | ||||
| 							<field name="min_quantity"/>  | ||||
| 							<field name="date_start"/>  | ||||
| 							<field name="date_end"/>       | ||||
| 						</group>                      | ||||
| 	                </sheet> | ||||
| 	                <div class="oe_chatter"> | ||||
| 	                    <field name="message_follower_ids" widget="mail_followers"/> | ||||
| 	                    <field name="message_ids" widget="mail_thread"/> | ||||
| 	                </div>  | ||||
|                 </form> | ||||
|             </field> | ||||
|         </record> | ||||
|          | ||||
|        <record id="product_pricelist_customer_tree" model="ir.ui.view"> | ||||
|             <field name="name">product_pricelist_customer_tree</field> | ||||
|             <field name="model">product.pricelist.customer</field> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <tree string="Kundenbezogene Preise"> | ||||
|                         <field name="partner_id"/> | ||||
|                         <field name="product_id"/> | ||||
|                         <field name="unit_price"/> | ||||
|                         <field name="min_quantity"/> | ||||
|                         <field name="date_start"/> | ||||
| 						<field name="date_end"/>                         | ||||
|                </tree> | ||||
|             </field> | ||||
|         </record> | ||||
|          | ||||
|         <record id="product_pricelist_customer_search" model="ir.ui.view"> | ||||
|             <field name="name">product_pricelist_customer_search</field> | ||||
|             <field name="model">product.pricelist.customer</field> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <search string="Suche Kundenbezogene Preise"> | ||||
|                     <field name="partner_id"/> | ||||
|                     <field name="product_id"/> | ||||
|                     <separator/> | ||||
|                     <group expand="0" string="Group By"> | ||||
|                         <filter string="Kunde" domain="[]" context="{'group_by':'partner_id'}"/> | ||||
|                         <filter string="Produkt" domain="[]" context="{'group_by':'product_id'}"/> | ||||
|                     </group> | ||||
|                </search> | ||||
|             </field> | ||||
|         </record> | ||||
| 		 | ||||
|        <record id="customer_pricelist_action" model="ir.actions.act_window"> | ||||
|             <field name="name">Kundenbez. Preise</field> | ||||
|             <field name="type">ir.actions.act_window</field> | ||||
|             <field name="res_model">product.pricelist.customer</field> | ||||
|             <field name="view_type">form</field> | ||||
| 			<field name="view_mode">tree,form</field> | ||||
|         </record> | ||||
|          | ||||
|        <record id="customer_pricelist_prod_action" model="ir.actions.act_window"> | ||||
|             <field name="name">Kundenbez. Preise</field> | ||||
|             <field name="type">ir.actions.act_window</field> | ||||
|             <field name="res_model">product.pricelist.customer</field> | ||||
|             <field name="view_type">form</field> | ||||
| 			<field name="view_mode">tree,form</field> | ||||
| 			<field name="domain">[('product_id.product_tmpl_id', '=', active_id)]</field> | ||||
| 			<field name="context">{'default_product_id': active_id}</field> | ||||
|         </record> | ||||
|          | ||||
|        <record id="customer_pricelist_part_action" model="ir.actions.act_window"> | ||||
|             <field name="name">Kundenbez. Preise</field> | ||||
|             <field name="type">ir.actions.act_window</field> | ||||
|             <field name="res_model">product.pricelist.customer</field> | ||||
|             <field name="view_type">form</field> | ||||
| 			<field name="view_mode">tree,form</field> | ||||
| 			<field name="domain">[('partner_id', '=', active_id)]</field> | ||||
| 			<field name="context">{'default_partner_id': active_id}</field> | ||||
|         </record> | ||||
|          | ||||
|         <!-- | ||||
| 		<menuitem id="customer_pricelist_main" name="Kundenbezogene Preise" sequence="21"/> | ||||
|         <menuitem id="customer_pricelist_sub" parent="customer_pricelist_main" name="Kundenbezogene Preise" sequence="10"/> | ||||
|         <menuitem action="customer_pricelist_action" id="customer_pricelist_menu" parent="customer_pricelist_sub" sequence="10"/>  | ||||
|         --> | ||||
|         <menuitem action="customer_pricelist_action" id="customer_pricelist_menu" parent="product.menu_product_pricelist_main" sequence="5" groups="base.group_sale_manager"/> | ||||
|                          | ||||
|         <record id="product_template_only_form_view" model="ir.ui.view"> | ||||
|             <field name="name">product.template.product.form</field> | ||||
|             <field name="model">product.template</field> | ||||
|             <field name="inherit_id" ref="product.product_template_form_view"/> | ||||
|             <field name="arch" type="xml"> | ||||
|             	<xpath expr="//div[@name='buttons']" position="inside">  | ||||
| 					<button class="oe_inline oe_stat_button" string="Kundenpreise" type="action" name="%(customer_pricelist_prod_action)d" icon="fa-eur"/> | ||||
|             	</xpath> | ||||
|             </field> | ||||
|         </record> | ||||
|          | ||||
|         <record id="view_partner_form" model="ir.ui.view"> | ||||
|             <field name="name">res.partner.form</field> | ||||
|             <field name="model">res.partner</field> | ||||
|             <field name="inherit_id" ref="base.view_partner_form"/> | ||||
|             <field name="arch" type="xml"> | ||||
|             	<xpath expr="//div[@name='buttons']" position="inside">  | ||||
| 					<button class="oe_inline oe_stat_button" string="Kundenpreise" type="action" name="%(customer_pricelist_part_action)d" icon="fa-eur"/> | ||||
|             	</xpath> | ||||
|             </field> | ||||
|         </record> | ||||
|         	 | ||||
| 	</data> | ||||
| </openerp> | ||||
|  | @ -1,3 +0,0 @@ | |||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||||
| product_pricelist_customer_user,product.pricelist.customer.user,model_product_pricelist_customer,base.group_sale_salesman,1,0,0,0 | ||||
| product_pricelist_customer_manager,product.pricelist.customer.manager,model_product_pricelist_customer,base.group_sale_manager,1,1,1,1 | ||||
| 
 | 
| Before Width: | Height: | Size: 2.8 KiB | 
| Before Width: | Height: | Size: 66 KiB | 
|  | @ -1,24 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| import cam_invoice_skonto | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
|  | @ -1,42 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| { | ||||
|     'name': 'Camadeus Invoice Skonto', | ||||
|     'version': '1.0', | ||||
|     'category': 'Custom', | ||||
|     'description': | ||||
|     """ | ||||
|     - Fügt die Felder Netto Tage, Skonto Tage, Skonto Prozent zu Zahlungsbedingungen (account.payment.term) hinzu. | ||||
|     - Fügt die Felder Skonto Fälligkeit und Betrag inkl. Skonto zur Rechnung (account.invoice) hinzu. | ||||
|     """, | ||||
|     'author': 'camadeus GmbH', | ||||
|     'website': 'http://www.camadeus.at', | ||||
|     'depends': ['account', 'sale'],  | ||||
|     'data': [ | ||||
|         'cam_invoice_skonto_view.xml', | ||||
|         'cam_invoice_skonto_data.xml', | ||||
|         ], | ||||
|     'installable': True, | ||||
|     'auto_install': False, | ||||
| } | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
|  | @ -1,403 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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 openerp.osv import fields, osv | ||||
| from openerp import models, fields as f, api | ||||
| import openerp.addons.decimal_precision as dp | ||||
| from datetime import date, timedelta, datetime | ||||
| from openerp.tools.translate import _ | ||||
| 
 | ||||
| class account_payment_term(osv.osv): | ||||
|     _inherit = 'account.payment.term' | ||||
| 
 | ||||
|     _columns = { | ||||
|         'netto_tage': fields.integer('Netto Tage'), | ||||
|         'skonto_tage': fields.integer('Skonto Tage'), | ||||
|         'skonto_prozent': fields.float('Skonto Prozent'), | ||||
|     } | ||||
|      | ||||
|     def write(self, cr, uid, ids, values, context=None): | ||||
|         if context is None: | ||||
|             context = {} | ||||
|          | ||||
|         tl_obj = self.pool.get('account.payment.term.line') | ||||
|         for pay_term in self.browse(cr, uid, ids, context=context): | ||||
|             # Delete old account.payment.term.line | ||||
|             for tl_id in pay_term.line_ids: | ||||
|                 tl_obj.unlink(cr, uid, tl_id.id, context=context) | ||||
|             # Create new account.payment.term.line based on netto_tage | ||||
|             days = 0 | ||||
|             if('netto_tage' in values):  | ||||
|                 days = values['netto_tage'] | ||||
|             else:  | ||||
|                 days = pay_term.netto_tage | ||||
|             values['line_ids'] = [(0,0, {'payment_id':pay_term.id, 'value': 'balance', 'days': days, 'days2':0})] | ||||
|              | ||||
|         return super(account_payment_term, self).write(cr, uid, ids, values, context=context) | ||||
|          | ||||
|     def create(self, cr, uid, vals, context=None): | ||||
|         if context is None: | ||||
|             context = {} | ||||
|              | ||||
|         new_id = super(account_payment_term, self).create(cr, uid, vals, context=context) | ||||
|         self.write(cr, uid, new_id, {'netto_tage': vals['netto_tage']}, context=context) | ||||
|          | ||||
|         return new_id | ||||
|              | ||||
| class account_invoice(models.Model): | ||||
|     _inherit = 'account.invoice' | ||||
| 
 | ||||
|     @api.one | ||||
|     def _skonto_betrag_inkl(self): | ||||
|         if self.payment_term and self.payment_term.skonto_prozent: | ||||
|             self.skonto_betrag_inkl = self.amount_total * (1 - self.payment_term.skonto_prozent/100.0) | ||||
| 
 | ||||
|     skonto_faelligkeit = f.Date(string=u'Skonto Fälligkeit', readonly=True)   | ||||
|     skonto_betrag_inkl = f.Float(string='Betrag inkl. Skonto', digits=dp.get_precision('Account'), readonly=True, compute='_skonto_betrag_inkl')  | ||||
|      | ||||
|     @api.multi | ||||
|     def action_skonto_faelligkeit_assign(self): | ||||
|         for inv in self: | ||||
|             if inv.payment_term and inv.payment_term.skonto_tage: | ||||
|                 inv.write({'skonto_faelligkeit': datetime.strptime(inv.date_invoice, '%Y-%m-%d') + timedelta(days=inv.payment_term.skonto_tage)}) | ||||
|         return True        | ||||
| 
 | ||||
|     # Add context 'click_register_payment' | ||||
|     def invoice_pay_customer(self, cr, uid, ids, context=None): | ||||
|         if not ids: return [] | ||||
|         dummy, view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_dialog_form') | ||||
| 
 | ||||
|         inv = self.browse(cr, uid, ids[0], context=context) | ||||
|         return { | ||||
|             'name':_("Pay Invoice"), | ||||
|             'view_mode': 'form', | ||||
|             'view_id': view_id, | ||||
|             'view_type': 'form', | ||||
|             'res_model': 'account.voucher', | ||||
|             'type': 'ir.actions.act_window', | ||||
|             'nodestroy': True, | ||||
|             'target': 'new', | ||||
|             'domain': '[]', | ||||
|             'context': { | ||||
|                 'payment_expected_currency': inv.currency_id.id, | ||||
|                 'default_partner_id': self.pool.get('res.partner')._find_accounting_partner(inv.partner_id).id, | ||||
|                 'default_amount': inv.type in ('out_refund', 'in_refund') and -inv.residual or inv.residual, | ||||
|                 'default_reference': inv.name, | ||||
|                 'close_after_process': True, | ||||
|                 'invoice_type': inv.type, | ||||
|                 'invoice_id': inv.id, | ||||
|                 'default_type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment', | ||||
|                 'type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment', | ||||
|                 'click_register_payment':True, | ||||
|             } | ||||
|         } | ||||
|      | ||||
| class account_voucher(osv.osv): | ||||
|     _inherit = 'account.voucher' | ||||
| 
 | ||||
|     #Workaround to send context in _compute_writeoff_amount() | ||||
|     def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_currency, type, context=None):         | ||||
|         context = context or {} | ||||
|         if not line_dr_ids and not line_cr_ids: | ||||
|             return {'value':{'writeoff_amount': 0.0}} | ||||
|         line_osv = self.pool.get("account.voucher.line") | ||||
|         line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context) | ||||
|         line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context) | ||||
|         #compute the field is_multi_currency that is used to hide/display options linked to secondary currency on the voucher | ||||
|         is_multi_currency = False | ||||
|         #loop on the voucher lines to see if one of these has a secondary currency. If yes, we need to see the options | ||||
|         for voucher_line in line_dr_ids+line_cr_ids: | ||||
|             line_id = voucher_line.get('id') and self.pool.get('account.voucher.line').browse(cr, uid, voucher_line['id'], context=context).move_line_id.id or voucher_line.get('move_line_id') | ||||
|             if line_id and self.pool.get('account.move.line').browse(cr, uid, line_id, context=context).currency_id: | ||||
|                 is_multi_currency = True | ||||
|                 break | ||||
|         return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, type, context=context), 'is_multi_currency': is_multi_currency}} | ||||
| 
 | ||||
|       | ||||
|     def get_default_acc_id(self, cr, uid, args): | ||||
|         konto = self.pool.get('account.account').search(cr,uid,[('code','=','99999999')],limit=1) | ||||
|         if konto: | ||||
|             return konto[0] | ||||
|         else: | ||||
|             raise osv.except_osv(_('Konfigurationsfehler!'),_("Es ist kein Konto für den Ausgleich der Rechnungen definiert (Skonto). Bitte wenden Sie sich an den Support.")) | ||||
|           | ||||
|         return False | ||||
|       | ||||
|     _defaults = { | ||||
|                 'comment': 'Skonto', | ||||
|                 'writeoff_acc_id': get_default_acc_id, | ||||
|                 } | ||||
| 
 | ||||
|     def _get_writeoff_amount(self, cr, uid, ids, name, args, context={}): | ||||
|         if not ids: return {} | ||||
|         currency_obj = self.pool.get('res.currency') | ||||
|         res = {}; diff_amount = 0.0 | ||||
|         debit = credit = total_inv_residual = 0.0 | ||||
|         for voucher in self.browse(cr, uid, ids, context=context): | ||||
|             sign = voucher.type == 'payment' and -1 or 1 | ||||
|             for l in voucher.line_dr_ids: | ||||
|                 debit += l.amount | ||||
|                 if context.has_key('click_register_payment'): | ||||
|                     if voucher.payment_option == 'with_writeoff': | ||||
|                         # There can be several open lines => we only want to reconcile the line related to the invoice | ||||
|                         if l.move_line_id and l.move_line_id.invoice and l.move_line_id.invoice.id == context.get('invoice_id',-1): | ||||
|                             l.write({'reconcile': True, 'amount': l.amount_unreconciled}) | ||||
|                     total_inv_residual += (l.amount > 0  and l.amount_unreconciled - l.amount) | ||||
|             for l in voucher.line_cr_ids: | ||||
|                 credit += l.amount  | ||||
|                 if context.has_key('click_register_payment'): | ||||
|                     if voucher.payment_option == 'with_writeoff': | ||||
|                         # There can be several open lines => we only want to reconcile the line related to the invoice | ||||
|                         if l.move_line_id and l.move_line_id.invoice and l.move_line_id.invoice.id == context.get('invoice_id',-1): | ||||
|                             l.write({'reconcile': True, 'amount': l.amount_unreconciled}) | ||||
|                     total_inv_residual += (l.amount > 0  and l.amount_unreconciled - l.amount) | ||||
|             currency = voucher.currency_id or voucher.company_id.currency_id | ||||
|             write_off_amount = voucher.amount - sign * (credit - debit) | ||||
|             if context.has_key('click_register_payment'): | ||||
|                 write_off_amount = total_inv_residual * sign | ||||
|                  | ||||
|             res[voucher.id] =  currency_obj.round(cr, uid, currency, write_off_amount) | ||||
|         return res | ||||
|      | ||||
|     _columns = { | ||||
|         'writeoff_amount': fields.function(_get_writeoff_amount, string='Difference Amount', type='float', readonly=True, help="Computed as the difference between the amount stated in the voucher and the sum of allocation on the voucher lines."),         | ||||
|         } | ||||
| 
 | ||||
|     #working on context to differentiate the button clicks without affecting the present code | ||||
|     #Workaround to send context in _compute_writeoff_amount() | ||||
|     def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, type, context={}): | ||||
|         debit = credit = total_inv_residual = 0.0 | ||||
|         sign = type == 'payment' and -1 or 1 | ||||
|         for l in line_dr_ids: | ||||
|             debit += l['amount'] | ||||
|             #total_inv_residual += (l['amount'] > 0 and l['amount_unreconciled'] - l['amount']) | ||||
|             total_inv_residual += l['amount_unreconciled'] | ||||
|         for l in line_cr_ids: | ||||
|             credit += l['amount'] | ||||
|             #total_inv_residual += (l['amount'] > 0 and  l['amount_unreconciled'] - l['amount']) | ||||
|             total_inv_residual += l['amount_unreconciled'] | ||||
|         writeoff_amount = amount - sign * (credit - debit) | ||||
|         if context.has_key('click_register_payment'): | ||||
|             writeoff_amount = amount - (total_inv_residual) | ||||
|         return writeoff_amount | ||||
| 
 | ||||
|     #Workaround to send context in _compute_writeoff_amount() | ||||
|     def recompute_voucher_lines(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None): | ||||
|         """ | ||||
|         Returns a dict that contains new values and context | ||||
| 
 | ||||
|         @param partner_id: latest value from user input for field partner_id | ||||
|         @param args: other arguments | ||||
|         @param context: context arguments, like lang, time zone | ||||
| 
 | ||||
|         @return: Returns a dict which contains new values, and context | ||||
|         """ | ||||
|         def _remove_noise_in_o2m(): | ||||
|             """if the line is partially reconciled, then we must pay attention to display it only once and | ||||
|                 in the good o2m. | ||||
|                 This function returns True if the line is considered as noise and should not be displayed | ||||
|             """ | ||||
|             if line.reconcile_partial_id: | ||||
|                 if currency_id == line.currency_id.id: | ||||
|                     if line.amount_residual_currency <= 0: | ||||
|                         return True | ||||
|                 else: | ||||
|                     if line.amount_residual <= 0: | ||||
|                         return True | ||||
|             return False | ||||
| 
 | ||||
|         if context is None: | ||||
|             context = {} | ||||
|         context_multi_currency = context.copy() | ||||
| 
 | ||||
|         currency_pool = self.pool.get('res.currency') | ||||
|         move_line_pool = self.pool.get('account.move.line') | ||||
|         partner_pool = self.pool.get('res.partner') | ||||
|         journal_pool = self.pool.get('account.journal') | ||||
|         line_pool = self.pool.get('account.voucher.line') | ||||
| 
 | ||||
|         #set default values | ||||
|         default = { | ||||
|             'value': {'line_dr_ids': [], 'line_cr_ids': [], 'pre_line': False}, | ||||
|         } | ||||
| 
 | ||||
|         # drop existing lines | ||||
|         line_ids = ids and line_pool.search(cr, uid, [('voucher_id', '=', ids[0])]) | ||||
|         for line in line_pool.browse(cr, uid, line_ids, context=context): | ||||
|             if line.type == 'cr': | ||||
|                 default['value']['line_cr_ids'].append((2, line.id)) | ||||
|             else: | ||||
|                 default['value']['line_dr_ids'].append((2, line.id)) | ||||
| 
 | ||||
|         if not partner_id or not journal_id: | ||||
|             return default | ||||
| 
 | ||||
|         journal = journal_pool.browse(cr, uid, journal_id, context=context) | ||||
|         partner = partner_pool.browse(cr, uid, partner_id, context=context) | ||||
|         currency_id = currency_id or journal.company_id.currency_id.id | ||||
| 
 | ||||
|         total_credit = 0.0 | ||||
|         total_debit = 0.0 | ||||
|         account_type = None | ||||
|         if context.get('account_id'): | ||||
|             account_type = self.pool['account.account'].browse(cr, uid, context['account_id'], context=context).type | ||||
|         if ttype == 'payment': | ||||
|             if not account_type: | ||||
|                 account_type = 'payable' | ||||
|             total_debit = price or 0.0 | ||||
|         else: | ||||
|             total_credit = price or 0.0 | ||||
|             if not account_type: | ||||
|                 account_type = 'receivable' | ||||
| 
 | ||||
|         if not context.get('move_line_ids', False): | ||||
|             if context.get('click_register_payment', False) and context.get('invoice_id', False): | ||||
|                 ids = move_line_pool.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id),('invoice','=',context.get('invoice_id'))], context=context) | ||||
|             else: | ||||
|                 ids = move_line_pool.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context) | ||||
|         else: | ||||
|             ids = context['move_line_ids'] | ||||
|         invoice_id = context.get('invoice_id', False) | ||||
|         company_currency = journal.company_id.currency_id.id | ||||
|         move_lines_found = [] | ||||
| 
 | ||||
|         #order the lines by most old first | ||||
|         ids.reverse() | ||||
|         account_move_lines = move_line_pool.browse(cr, uid, ids, context=context) | ||||
| 
 | ||||
|         #compute the total debit/credit and look for a matching open amount or invoice | ||||
|         for line in account_move_lines: | ||||
|             if _remove_noise_in_o2m(): | ||||
|                 continue | ||||
| 
 | ||||
|             if invoice_id: | ||||
|                 if line.invoice.id == invoice_id: | ||||
|                     #if the invoice linked to the voucher line is equal to the invoice_id in context | ||||
|                     #then we assign the amount on that line, whatever the other voucher lines | ||||
|                     move_lines_found.append(line.id) | ||||
|             elif currency_id == company_currency: | ||||
|                 #otherwise treatments is the same but with other field names | ||||
|                 if line.amount_residual == price: | ||||
|                     #if the amount residual is equal the amount voucher, we assign it to that voucher | ||||
|                     #line, whatever the other voucher lines | ||||
|                     move_lines_found.append(line.id) | ||||
|                     break | ||||
|                 #otherwise we will split the voucher amount on each line (by most old first) | ||||
|                 total_credit += line.credit or 0.0 | ||||
|                 total_debit += line.debit or 0.0 | ||||
|             elif currency_id == line.currency_id.id: | ||||
|                 if line.amount_residual_currency == price: | ||||
|                     move_lines_found.append(line.id) | ||||
|                     break | ||||
|                 total_credit += line.credit and line.amount_currency or 0.0 | ||||
|                 total_debit += line.debit and line.amount_currency or 0.0 | ||||
| 
 | ||||
|         remaining_amount = price | ||||
|         #voucher line creation | ||||
|         for line in account_move_lines: | ||||
| 
 | ||||
|             if _remove_noise_in_o2m(): | ||||
|                 continue | ||||
| 
 | ||||
|             if line.currency_id and currency_id == line.currency_id.id: | ||||
|                 amount_original = abs(line.amount_currency) | ||||
|                 amount_unreconciled = abs(line.amount_residual_currency) | ||||
|             else: | ||||
|                 #always use the amount booked in the company currency as the basis of the conversion into the voucher currency | ||||
|                 amount_original = currency_pool.compute(cr, uid, company_currency, currency_id, line.credit or line.debit or 0.0, context=context_multi_currency) | ||||
|                 amount_unreconciled = currency_pool.compute(cr, uid, company_currency, currency_id, abs(line.amount_residual), context=context_multi_currency) | ||||
|             line_currency_id = line.currency_id and line.currency_id.id or company_currency | ||||
|             rs = { | ||||
|                 'name':line.move_id.name, | ||||
|                 'type': line.credit and 'dr' or 'cr', | ||||
|                 'move_line_id':line.id, | ||||
|                 'account_id':line.account_id.id, | ||||
|                 'amount_original': amount_original, | ||||
|                 'amount': (line.id in move_lines_found) and min(abs(remaining_amount), amount_unreconciled) or 0.0, | ||||
|                 'date_original':line.date, | ||||
|                 'date_due':line.date_maturity, | ||||
|                 'amount_unreconciled': amount_unreconciled, | ||||
|                 'currency_id': line_currency_id, | ||||
|             } | ||||
|             remaining_amount -= rs['amount'] | ||||
|             #in case a corresponding move_line hasn't been found, we now try to assign the voucher amount | ||||
|             #on existing invoices: we split voucher amount by most old first, but only for lines in the same currency | ||||
|             if not move_lines_found: | ||||
|                 if currency_id == line_currency_id: | ||||
|                     if line.credit: | ||||
|                         amount = min(amount_unreconciled, abs(total_debit)) | ||||
|                         rs['amount'] = amount | ||||
|                         total_debit -= amount | ||||
|                     else: | ||||
|                         amount = min(amount_unreconciled, abs(total_credit)) | ||||
|                         rs['amount'] = amount | ||||
|                         total_credit -= amount | ||||
| 
 | ||||
|             if rs['amount_unreconciled'] == rs['amount']: | ||||
|                 rs['reconcile'] = True | ||||
| 
 | ||||
|             if rs['type'] == 'cr': | ||||
|                 default['value']['line_cr_ids'].append(rs) | ||||
|             else: | ||||
|                 default['value']['line_dr_ids'].append(rs) | ||||
| 
 | ||||
|             if len(default['value']['line_cr_ids']) > 0: | ||||
|                 default['value']['pre_line'] = 1 | ||||
|             elif len(default['value']['line_dr_ids']) > 0: | ||||
|                 default['value']['pre_line'] = 1 | ||||
|             default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, ttype, context=context) | ||||
|         return default | ||||
| 
 | ||||
| def resolve_o2m_operations(cr, uid, target_osv, operations, fields, context): | ||||
|     results = [] | ||||
|     for operation in operations: | ||||
|         result = None | ||||
|         if not isinstance(operation, (list, tuple)): | ||||
|             result = target_osv.read(cr, uid, operation, fields, context=context) | ||||
|         elif operation[0] == 0: | ||||
|             # may be necessary to check if all the fields are here and get the default values? | ||||
|             result = operation[2] | ||||
|         elif operation[0] == 1: | ||||
|             result = target_osv.read(cr, uid, operation[1], fields, context=context) | ||||
|             if not result: result = {} | ||||
|             result.update(operation[2]) | ||||
|         elif operation[0] == 4: | ||||
|             result = target_osv.read(cr, uid, operation[1], fields, context=context) | ||||
|         if result != None: | ||||
|             results.append(result) | ||||
|     return results      | ||||
| 
 | ||||
| class sale_order(osv.osv): | ||||
|     _inherit = 'sale.order' | ||||
|      | ||||
|     def _skonto_betrag_inkl(self, cr, uid, ids, field_name, arg, context=None): | ||||
|         res = {} | ||||
|         sos = self.browse(cr, uid, ids, context=context) | ||||
|         for so in sos: | ||||
|             if so.payment_term and so.payment_term.skonto_prozent: | ||||
|                 res[so.id] = so.amount_total * (1 - so.payment_term.skonto_prozent/100.0) | ||||
|         return res | ||||
|         | ||||
|     _columns = { | ||||
|         'skonto_betrag_inkl': fields.function(_skonto_betrag_inkl, string='Betrag inkl. Skonto', type='float'), | ||||
|     } | ||||
|      | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
|  | @ -1,50 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| 
 | ||||
| <!-- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). | ||||
| # | ||||
| #    cam_invoice_skonto, Custom Module for OpenERP | ||||
| #    Copyright (C) 2014 Camadeus Consulting GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| --> | ||||
| 
 | ||||
| <openerp> | ||||
| 	<data> | ||||
|         <record id="account.act_open" model="workflow.activity"> | ||||
|             <field name="action">action_date_assign() | ||||
| action_move_create() | ||||
| action_number() | ||||
| invoice_validate() | ||||
| action_skonto_faelligkeit_assign()</field> | ||||
|         </record>		 | ||||
| 	</data> | ||||
| 
 | ||||
|     <data noupdate="1"> | ||||
| 
 | ||||
|         <record id="account_account_skonto" model="account.account"> | ||||
|             <field name="name">Skonto</field> | ||||
|             <field name="code">99999999</field> | ||||
|             <field name="type">other</field> | ||||
|             <field name="user_type" search="[('code','=','other')]"/> | ||||
|         </record> | ||||
| 
 | ||||
|     </data> | ||||
| 
 | ||||
| </openerp> | ||||
|  | @ -1,87 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| 
 | ||||
| <!-- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). | ||||
| # | ||||
| #    cam_invoice_skonto, Custom Module for OpenERP | ||||
| #    Copyright (C) 2014 Camadeus Consulting GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| --> | ||||
| 
 | ||||
| <openerp> | ||||
|     <data>     | ||||
|     	 | ||||
|         <record id="view_payment_term_form" model="ir.ui.view"> | ||||
|             <field name="name">cam_invoice_skonto.payment.term.form</field> | ||||
|             <field name="model">account.payment.term</field> | ||||
|             <field name="inherit_id" ref="account.view_payment_term_form"/> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <xpath expr="//form[@string='Payment Term']/separator[@string='Computation']" position="replace"> | ||||
|                 </xpath> | ||||
|                 <xpath expr="//form[@string='Payment Term']/field[@name='line_ids']" position="replace"> | ||||
|                     <group col="4"> | ||||
|                     	<field name="skonto_tage"/> | ||||
|                         <field name="netto_tage"/> | ||||
| 						<field name="skonto_prozent"/> | ||||
|                     </group>                	 | ||||
|                 </xpath>                            	 | ||||
|             </field> | ||||
|         </record>    | ||||
|          | ||||
| 		<record id="invoice_form" model="ir.ui.view"> | ||||
|             <field name="name">cam_invoice_skonto.invoice.form</field> | ||||
|             <field name="model">account.invoice</field> | ||||
|             <field name="inherit_id" ref="account.invoice_form"/> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <field name="date_due" position="after"> | ||||
|                     <field name="skonto_faelligkeit"/> | ||||
|                 </field> | ||||
|                 <field name="residual" position="before"> | ||||
| 					<field name="skonto_betrag_inkl" attrs="{'invisible': [('skonto_betrag_inkl','=',0)]}"/>                     | ||||
|                 </field>                 | ||||
|             </field> | ||||
|         </record> | ||||
| 
 | ||||
|         <!-- account.voucher --> | ||||
|         <record id="account_voucher_form" model="ir.ui.view"> | ||||
|             <field name="name">cam_invoice_skonto.account_voucher.form</field> | ||||
|             <field name="model">account.voucher</field> | ||||
|             <field name="inherit_id" ref="account_voucher.view_vendor_receipt_dialog_form"/> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <field name="writeoff_acc_id" position="attributes"> | ||||
|                     <attribute name="invisible">1</attribute> | ||||
|                 </field> | ||||
| 
 | ||||
|             </field> | ||||
|         </record> | ||||
|          | ||||
|         <record id="view_order_form" model="ir.ui.view"> | ||||
|             <field name="name">sale.order.form</field> | ||||
|             <field name="model">sale.order</field> | ||||
|             <field name="inherit_id" ref="sale.view_order_form"/> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <field name="amount_total" position="after"> | ||||
| 					<field name="skonto_betrag_inkl"/>                     | ||||
|                 </field>  | ||||
|             </field> | ||||
|         </record> | ||||
|                  		 | ||||
|     </data> | ||||
| </openerp> | ||||
| Before Width: | Height: | Size: 11 KiB | 
|  | @ -1,40 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| 
 | ||||
| { | ||||
|     'name': 'Max. Width for Form View', | ||||
|     'category': 'Custom',  | ||||
|     'version': '1.0', | ||||
|     'description': """ | ||||
|     """, | ||||
|     'author': 'camadeus GmbH', | ||||
|     'website': 'http://www.camadeus.at', | ||||
|     'depends': [], | ||||
|     'data': [ | ||||
|              'views/max_width.xml',    | ||||
|         ],   | ||||
|     'installable': True, | ||||
|     'sequence': 150, | ||||
|     'auto_install': False, | ||||
| } | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
| Before Width: | Height: | Size: 2.8 KiB | 
|  | @ -1,10 +0,0 @@ | |||
| .openerp .oe_followers .oe_invite { | ||||
|   float: none !important; | ||||
|   display: block; | ||||
|   padding-left: 0px; | ||||
| } | ||||
| 
 | ||||
| .openerp .oe_form_sheet_width { | ||||
|   max-width: 95% !important; | ||||
| } | ||||
| 
 | ||||
|  | @ -1,12 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <!-- vim:fdn=3: | ||||
| --> | ||||
| <openerp> | ||||
|     <data> | ||||
|         <template id="assets_backend" name="mail assets" inherit_id="web.assets_backend"> | ||||
|             <xpath expr="." position="inside"> | ||||
|                 <link rel="stylesheet" href="/cam_max_width/static/src/css/max_width.css"/> | ||||
|             </xpath> | ||||
|         </template> | ||||
|     </data> | ||||
| </openerp> | ||||
|  | @ -1,24 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| import cam_reports | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
| 
 | ||||
|  | @ -1,37 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| 
 | ||||
| { | ||||
|     'name': 'Camadeus Reports', | ||||
|     'category': 'Custom',  | ||||
|     'version': '1.0', | ||||
|     'description': """Individuelle Dokumentenvorlagen""", | ||||
|     'author': 'camadeus GmbH', | ||||
|     'website': 'http://www.camadeus.at', | ||||
|     'depends': ['purchase','sale','account','stock'], | ||||
|     'data': ['reports_data.xml',        | ||||
|     ], | ||||
|     'installable': True, | ||||
|     'auto_install': False, | ||||
| } | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
|  | @ -1,93 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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 openerp.osv import fields, osv | ||||
| import openerp.modules as addons | ||||
| import os | ||||
| import base64 | ||||
| 
 | ||||
| class res_company(osv.osv): | ||||
|     _inherit = 'res.company' | ||||
|      | ||||
|     def get_image(self, img): | ||||
|          | ||||
|         def _get_dir(): | ||||
|             styles_dir = 'cam_reports/static/src/img' | ||||
|             adps = addons.module.ad_paths         | ||||
|             for adp in adps: | ||||
|                 dir = os.path.join(adp, styles_dir) | ||||
|                 if os.path.isdir(dir):                 | ||||
|                     return dir         | ||||
|             return False | ||||
| 
 | ||||
|         def _get_file_data(filename): | ||||
|             try: | ||||
|                 f = open(filename , 'rb') | ||||
|                 data = base64.b64encode(f.read()) | ||||
|                 f.close() | ||||
|                 return data | ||||
|             except: | ||||
|                 print "Error openening file '%s'." % (filename) | ||||
|                 return False     | ||||
|          | ||||
|         path = _get_dir() | ||||
|         fname = os.path.join(path, img)  | ||||
|         img_data = _get_file_data(fname) | ||||
|         return img_data | ||||
|      | ||||
|     def _get_rml_header(self, cr, uid, ids, _field_name, _args, context=None): | ||||
|         result = dict.fromkeys(ids, False) | ||||
|         # Get filename | ||||
|         dirname = 'cam_reports/report' | ||||
|         adps = addons.module.ad_paths         | ||||
|         for adp in adps: | ||||
|             dir = os.path.join(adp, dirname) | ||||
|             if os.path.isdir(dir): | ||||
|                 break | ||||
|          | ||||
|         if os.path.isdir(dir): | ||||
|             filename = os.path.join(dir, 'briefkopf.rml')  | ||||
|             f = open(filename , 'rb') | ||||
|             data = f.read() | ||||
|             result = dict.fromkeys(ids, data) | ||||
|         return result | ||||
|      | ||||
|     def _get_rml_header2(self, cr, uid, ids, _field_name, _args, context=None): | ||||
|         result = dict.fromkeys(ids, False) | ||||
|         # Get filename | ||||
|         dirname = 'cam_reports/report' | ||||
|         adps = addons.module.ad_paths         | ||||
|         for adp in adps: | ||||
|             dir = os.path.join(adp, dirname) | ||||
|             if os.path.isdir(dir): | ||||
|                 break | ||||
|          | ||||
|         if os.path.isdir(dir): | ||||
|             filename = os.path.join(dir, 'page.rml')  | ||||
|             f = open(filename , 'rb') | ||||
|             data = f.read() | ||||
|             result = dict.fromkeys(ids, data) | ||||
|         return result | ||||
|      | ||||
|     _columns = { | ||||
|         'rml_header': fields.function(_get_rml_header, type='text', string='Briefkopf',readonly=True), | ||||
|         'rml_header2': fields.function(_get_rml_header2, type='text', string='RML Header',readonly=True), | ||||
|     }       | ||||
|  | @ -1,236 +0,0 @@ | |||
| <?xml version="1.0"?> | ||||
| <document filename="Rechnung.pdf"> | ||||
|   <template pageSize="(595.0,842.0)" title="Sale Order" author="Camadeus Consulting" allowSplitting="20"> | ||||
|     <pageTemplate id="first"> | ||||
|       <frame id="first" x1="15.0" y1="42.0" width="539" height="758"/> | ||||
|     </pageTemplate> | ||||
|   </template> | ||||
|    | ||||
|   <story> | ||||
|    | ||||
|     <para> | ||||
|       <seqReset id="L1"/> | ||||
|     </para> | ||||
|     <para>[[repeatIn(objects,'o')]] [[ setLang(o.partner_id.commercial_partner_id.lang)]]</para> | ||||
| 
 | ||||
| 	<blockTable colWidths="270,85,145" style="Struktur"> | ||||
| 		<tr> | ||||
| 			<td> | ||||
| 				<section>   | ||||
| 				    <para style="fett">[[ o.partner_id.commercial_partner_id.name ]]</para> | ||||
|                     <para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para> | ||||
| 				    <para style="normal">[[ (o.partner_id.street ) or '']]</para> | ||||
| 				    <para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id and o.partner_id.city) or '' ]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para> | ||||
| 				    <!-- Für Sichtfenster --> | ||||
| 				    <section>[[ not (o.partner_id.commercial_partner_id and o.partner_id.commercial_partner_id.ref) or removeParentNode('section') ]] | ||||
| 					    <para style="normal"> </para> | ||||
| 				    </section> 				     | ||||
| 				</section> | ||||
| 				<para></para>    				     | ||||
|     		</td> | ||||
|     		<td> | ||||
| 			    <para style="normal">Datum:</para> | ||||
| 			    <para style="normal">Quelldokument:</para> | ||||
| 			    <para style="normal">Kundenreferenz:</para> | ||||
| 			    <!--<para style="normal">Kundennummer:</para>--> | ||||
| 			    <para style="normal">Kunde UID Nr.:</para>    | ||||
| 				<para style="normal">Ansprechpartner:</para> | ||||
| 			</td> | ||||
|     		<td> | ||||
| 			    <para style="normal">[[ formatLang(o.date_invoice,date = True) ]] </para> | ||||
| 			    <para style="normal">[[ o.origin ]] </para> | ||||
| 			    <para style="normal">[[ o.name ]] </para> | ||||
| 			    <!--<para style="normal">[[ o.partner_id.commercial_partner_id.ref ]] </para>--> | ||||
| 			    <para style="normal">[[ o.partner_id.commercial_partner_id and o.partner_id.commercial_partner_id.vat or '' ]] </para>    | ||||
| 				<para style="normal">[[ (o.user_id and o.user_id.name) or '' ]] </para> | ||||
| 			</td> | ||||
| 		</tr>     | ||||
| 		<!--   | ||||
| 		<tr> | ||||
| 			<td> | ||||
|     			<section>[[ (o.partner_shipping_id and o.partner_shipping_id.id != o.partner_id.id) or removeParentNode('section')]]     | ||||
|                     <spacer length="0.5cm"/>  | ||||
| 				    <para style="normal">Lieferadresse:</para> | ||||
| 				    <para style="normal">[[ o.partner_shipping_id.commercial_partner_id.name ]]</para> | ||||
|                     <para style="normal">[[ (o.partner_shipping_id.commercial_partner_id.id != o.partner_shipping_id.id and o.partner_shipping_id.name) or '' ]] </para> | ||||
| 				    <para style="normal">[[ (o.partner_shipping_id.street ) or '']]</para> | ||||
| 				    <para style="normal">[[ (o.partner_shipping_id.street2) or removeParentNode('para') ]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_shipping_id.zip) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.city) or '' ]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name) or removeParentNode('para')]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name) or '' ]]</para>     | ||||
| 				</section> | ||||
| 				<para style="normal"> </para> | ||||
|     		</td> | ||||
|     		<td> | ||||
|             	<para style="normal"> </para> | ||||
| 			</td> | ||||
|     		<td> | ||||
|             	<para style="normal"> </para> | ||||
| 			</td> | ||||
| 		</tr>    | ||||
| 		-->		 | ||||
| 	</blockTable> | ||||
|      | ||||
|    <spacer length="1.0cm"/> | ||||
| 	 | ||||
|    <para style="ueberschrift2"><b>Rechnung [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para> | ||||
|    <para style="ueberschrift2"><b>PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]]</b></para> | ||||
|    <para style="ueberschrift2"><b>Rechnungsentwurf [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</b></para> | ||||
|    <para style="ueberschrift2"><b>Stornierte Rechnung [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para> | ||||
|    <para style="ueberschrift2"><b>Stornorechnung [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para> | ||||
|    <para style="ueberschrift2"><b>Stornorechnung [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para> | ||||
|    <para style="ueberschrift2"><b>Rechnung [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para> | ||||
|      | ||||
|     <spacer length="0.5cm"/> | ||||
|      | ||||
|     <blockTable colWidths="30,57,170,75,63,40,75" repeatRows="1" style="TabelleHaupt" hAlign="LEFT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="tabelle_header">Pos</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header">Art.nr.</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header_links">Bezeichnung</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header_links">Menge</para> | ||||
|         </td>  | ||||
|         <td> | ||||
|           <para style="tabelle_header_rechts">Einzelpreis</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header"></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header_rechts">Gesamtpreis</para> | ||||
|         </td> | ||||
|       </tr> | ||||
| 
 | ||||
|       <tr>[[repeatIn(o.invoice_line,'line')]] | ||||
|         <td> | ||||
|           <para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0"> | ||||
|             <seq id="L1"/> | ||||
|           </para>           | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_center">[[ line.product_id and line.product_id.default_code or '']]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|             <para style="tabelle_daten_links">[[ (line.name or '').split('\n\n')[0] ]]</para> | ||||
|             <section>[[ repeatIn((line.name or '').split('\n\n')[1:],'paragraphs') ]] | ||||
|                 <spacer length="0.4cm"/>             | ||||
|                 <para style="tabelle_daten_links">[[ paragraphs ]]</para>    | ||||
|             </section>            | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_links">[[formatLang(line.quantity, digits=2)[-2:]=='00' and formatLang(line.quantity, digits=0) or formatLang(line.quantity, digits=2)]] [[ line.uos_id.name ]]</para> | ||||
|         </td>    | ||||
|         <td> | ||||
|           <para style="tabelle_daten_rechts">[[ formatLang(line.price_unit,digits=2) ]]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_rechts">[[ line.discount <> 0 and (formatLang(line.discount) + '%') or '' ]]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_rechts">[[ formatLang(line.price_subtotal,digits=2 ) ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
|   | ||||
|     <blockTable colWidths="210,200,100" style="TabelleSchlussrechnung"> | ||||
|       <tr> | ||||
|         <td> | ||||
|             <para></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">Zwischensumme in €</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">[[ formatLang(o.amount_untaxed,digits=2 )]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr>[[ repeatIn(o.tax_line,'tax') ]] | ||||
|         <td> | ||||
|           <para style="schlussrechnung"></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">MwSt. [[tax.name.split(" ")[0] or ""]] in €</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">[[ formatLang(tax.tax_amount) ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr> | ||||
|         <td> | ||||
|             <para></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung_fett">Rechnungsbetrag in €</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung_fett">[[ formatLang(o.amount_total,digits=2 ) ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr> | ||||
|         <td> | ||||
|             <para></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">Rechnungsbetrag inkl. Skonto in €</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">[[ (o.skonto_betrag_inkl and formatLang(o.skonto_betrag_inkl,digits=2)) or removeParentNode('tr') ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
|      | ||||
|     <spacer length="0.5cm"/> | ||||
| 
 | ||||
|     <para style="normal">[[ (o.comment or '').split('\n\n')[0] ]]</para> | ||||
|     <section>[[ repeatIn((o.comment or '').split('\n\n')[1:],'paragraphs') ]] | ||||
|         <spacer length="0.4cm"/>             | ||||
|         <para style="normal">[[ paragraphs ]]</para>    | ||||
|     </section>  | ||||
| 
 | ||||
|     <spacer length="0.5cm"/> | ||||
|      | ||||
| 	<blockTable colWidths="110,390" style="Struktur" hAlign="LEFT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="normal">Zahlungsbedingungen:</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="normal">[[ (o.payment_term and o.payment_term.note) or removeParentNode('blockTable') ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
|      | ||||
|     <!--  | ||||
|     <spacer length="0.5cm"/> | ||||
| 
 | ||||
|     <blockTable colWidths="500" style="Struktur" hAlign="LEFT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="normal"></para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr>[[ o.date_due and o.payment_term and o.payment_term.skonto_prozent or removeParentNode('tr') ]] | ||||
|         <td> | ||||
|           <para style="normal">Zahlbar bis [[ formatLang(o.skonto_faelligkeit,date = True) ]] abzüglich [[ formatLang(o.payment_term.skonto_prozent,digits=2) ]]% beträgt [[ formatLang(o.skonto_betrag_inkl,digits=2) ]]€.</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr>[[ o.date_due or removeParentNode('tr') ]] | ||||
|         <td> | ||||
|           <para style="normal">Zahlbar bis [[ formatLang(o.date_due,date = True) ]] ohne Abzug.</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
|     --> | ||||
|      | ||||
|   </story> | ||||
| </document> | ||||
|  | @ -1,99 +0,0 @@ | |||
| <header> | ||||
|     <pageTemplate> | ||||
|         <frame id="first" x1="1.5cm" y1="4cm" height="21.1cm" width="18.5cm"/> | ||||
|          <stylesheet> | ||||
|             <!-- Set here the default font to use for all <para> tags --> | ||||
|             <paraStyle name='Normal' fontName="Helvetica"/> | ||||
|             <paraStyle name="footer"  fontName="Helvetica" leading="8" fontSize="7.0" alignment="LEFT"/> | ||||
|             <paraStyle name="footer_rechts"  fontName="Helvetica" leading="8" fontSize="7.0" alignment="RIGHT"/> | ||||
|             <paraStyle name="header_fett"  fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/> | ||||
|             <paraStyle name="header"  fontName="Helvetica" fontSize="7.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> | ||||
|             <paraStyle name="Absender"  fontName="Helvetica" fontSize="7.0" leading="8" alignment="LEFT" spaceAfter="0.0"/> | ||||
| 
 | ||||
|             <paraStyle name="normal" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" /> | ||||
|             <paraStyle name="fett" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/> | ||||
|             <paraStyle name="ueberschrift" fontName="Helvetica-Bold" fontSize="10.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/> | ||||
|              | ||||
|             <paraStyle name="tabelle_header" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER"/> | ||||
|             <paraStyle name="tabelle_header_links" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT"/> | ||||
|             <paraStyle name="tabelle_header_rechts" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/> | ||||
|             <paraStyle name="tabelle_daten_center" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER"/> | ||||
|             <paraStyle name="tabelle_daten_links" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/> | ||||
|             <paraStyle name="tabelle_daten_links_italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT"/> | ||||
|             <paraStyle name="tabelle_daten_rechts" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/> | ||||
|              | ||||
|             <paraStyle name="schlussrechnung" fontName="Helvetica" fontSize="9.0" leading="10" alignment="RIGHT"/> | ||||
|             <paraStyle name="schlussrechnung_fett" fontName="Helvetica-Bold" fontSize="9.0" leading="10" alignment="RIGHT"/> | ||||
|             <paraStyle name="skonto" fontName="Helvetica" fontSize="7.0" leading="10" alignment="RIGHT"/> | ||||
|              | ||||
|             <!--  Tabellen --> | ||||
|             <blockTableStyle id="Struktur"> | ||||
|               <blockAlignment value="LEFT"/> | ||||
|               <blockValign value="TOP"/> | ||||
|               <blockTopPadding length="0"/> | ||||
|               <blockBottomPadding length="0"/>       | ||||
|               <blockLeftPadding length="0"/>       | ||||
|               <blockRightPadding length="0"/>       | ||||
|             </blockTableStyle> | ||||
|          | ||||
|             <blockTableStyle id="TabelleHaupt"> | ||||
|               <blockAlignment value="LEFT"/> | ||||
|               <blockValign value="TOP"/> | ||||
|               <lineStyle kind="LINEBELOW" colorName="#000000" thickness="0.5"/> | ||||
|               <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0" thickness="1"/> | ||||
|               <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="-1,-1" thickness="1"/> | ||||
|             </blockTableStyle> | ||||
|          | ||||
|             <blockTableStyle id="TabelleSchlussrechnung"> | ||||
|               <blockValign value="MIDDLE"/>  | ||||
|             </blockTableStyle>             | ||||
|          </stylesheet> | ||||
|           | ||||
|         <pageGraphics> | ||||
|         	 | ||||
|         	<!-- Logo Oben 1 --> | ||||
|             <place x="1.75cm" y="24.75cm" height="3cm" width="7cm"> | ||||
|                 <para style="footer">[[ company.partner_id.name ]]</para> | ||||
|                 <para style="footer">[[ company.street ]]</para> | ||||
|                 <para style="footer">[[ company.zip ]] [[ company.city ]]</para> | ||||
|                 <para style="footer">[[ company.country_id.name ]]</para> | ||||
|             </place> | ||||
|              | ||||
| 			<!-- Logo Oben 2 --> | ||||
|             <place x="6.90cm" y="24.75cm" height="3cm" width="7cm"> | ||||
|                 <para style="footer">Telefon:</para> | ||||
|                 <para style="footer">Telefax:</para> | ||||
|                 <para style="footer">E-Mail:</para> | ||||
|                 <para style="footer">Web:</para> | ||||
|             </place> | ||||
|             <place x="8.10cm" y="24.75cm" height="3cm" width="7cm"> | ||||
|                 <para style="footer">[[ company.phone ]]</para> | ||||
|                 <para style="footer">[[ company.fax ]]</para> | ||||
|                 <para style="footer">[[ company.partner_id.email ]]</para> | ||||
|                 <para style="footer">[[ company.partner_id.website ]]</para> | ||||
|             </place> | ||||
| 			 | ||||
| 			<!-- Logo Oben --> | ||||
| 			<image x="13.80cm" y="26.60cm" height="1.5cm" preserveAspectRatio="1">[[ company.logo]]</image> | ||||
|         	 | ||||
|             <!-- Seperator --> | ||||
|             <rect x="1.70cm" y="26.40cm" width="18.00cm" height="0.01cm" fill="yes" stroke="no"/> | ||||
| 			 | ||||
|             <!-- Seperator --> | ||||
|             <rect x="1.70cm" y="1.85cm" width="18.00cm" height="0.01cm" fill="yes" stroke="no"/> | ||||
|             	 | ||||
|             <!-- Footer links --> | ||||
|             <place x="1.75cm" y="0cm" height="1.75cm" width="18cm"> | ||||
|                 <para style="footer">Bankverbindung: BANK, IBAN: AT000000000000000000, BIC: AAAAAAAA</para> | ||||
|                 <para style="footer">UID: [[company.vat ]], FN: [[ company.company_registry ]]</para> | ||||
|                 <para style="footer">Die Ware bleibt bis zur vollständigen Bezahlung unser Eigentum.</para> | ||||
|             </place>             | ||||
|              | ||||
|             <!-- Seitenzahl -->  | ||||
|             <setFont name="Helvetica" size="8"/>       | ||||
| 			<drawRightString x="561" y="58">Seite <pageNumber/> </drawRightString> | ||||
| 
 | ||||
|         </pageGraphics> | ||||
| 
 | ||||
|     </pageTemplate> | ||||
| </header> | ||||
|  | @ -1,123 +0,0 @@ | |||
| <?xml version="1.0"?> | ||||
| <document filename="Picking_Auftrag.pdf"> | ||||
|   <template pageSize="(595.0,842.0)" title="Picking Auftrag" author="www.camadeus.at" allowSplitting="20"> | ||||
|     <pageTemplate id="first"> | ||||
|       <frame id="first" x1="15.0" y1="42.0" width="539" height="758"/> | ||||
|     </pageTemplate> | ||||
|   </template> | ||||
|   | ||||
|   <story> | ||||
|   	 | ||||
|     <para> | ||||
|       <seqReset id="L1"/> | ||||
|     </para>   | ||||
|     | ||||
|     <para>[[ repeatIn(objects,'o') ]] [[ o.partner_id and setLang(o.partner_id.lang) ]]</para> | ||||
|   | ||||
|      <blockTable colWidths="260,260" style="Struktur" hAlign="RIGHT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|             <para style="normal">AUFTRAGSNUMMER: [[ o.origin or '' ]]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|             <para style="normal_rechts"></para> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable>      | ||||
|      | ||||
|      <blockTable colWidths="292,100,126" style="Struktur" hAlign="RIGHT"> | ||||
|       <tr> | ||||
|         <td>  | ||||
|         	<para style="fett"></para> | ||||
|         	<!-- | ||||
|         	<spacer length="0.5cm"/> | ||||
|         	<para style="fett">Fertigung für:</para> | ||||
|         	<para style="normal">KEINE partner_id in mrp.production!</para>	 | ||||
|             <spacer length="0.5cm"/> 	 | ||||
| 
 | ||||
|         	<spacer length="0.2cm"/> | ||||
| 		    <para style="normal">[[ o.partner_id.commercial_partner_id.name ]]</para> | ||||
| 		    <spacer length="0.1cm"/> | ||||
| 		    <para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para> | ||||
| 		    <spacer length="0.1cm"/> | ||||
| 		    <para style="normal">[[ (o.partner_id.street ) or '']]</para> | ||||
| 		    <spacer length="0.1cm"/> | ||||
| 		    <para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para> | ||||
| 		    <spacer length="0.1cm"/> | ||||
| 		    <para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id and o.partner_id.city) or '' ]]</para> | ||||
| 		    <spacer length="0.1cm"/> | ||||
| 		    <para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para> | ||||
| 		    <spacer length="0.1cm"/> | ||||
| 		    <para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para> | ||||
| 		    <spacer length="0.5cm"/>  | ||||
|         	--> | ||||
|         </td> | ||||
|         <td> | ||||
|         	<spacer length="1.0cm"/> | ||||
|             <para style="normal_center"></para> | ||||
|         </td> | ||||
|         <td> | ||||
|         	<spacer length="1.0cm"/> | ||||
| 		    <para style="normal_rechts"></para> | ||||
|         </td> | ||||
|       </tr> | ||||
|      </blockTable>  | ||||
|      <blockTable colWidths="292,226" style="Struktur" hAlign="RIGHT"> | ||||
|       <tr> | ||||
|         <td>  | ||||
| 		   <para style="normal_big"><b>FERTIGUNG: [[ o.name ]]</b></para> | ||||
| 		   <spacer length="0.2cm"/> | ||||
|         </td> | ||||
|         <td> | ||||
|         	<para style="normal_rechts_big">DATUM: [[ formatLang(o.date_planned,date=True) or formatLang(time.strftime('%Y-%m-%d'),date=True) ]]</para> | ||||
|         	<spacer length="0.2cm"/> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable>    | ||||
|      | ||||
|     <spacer length="0.5cm"/>      | ||||
|      | ||||
|     <blockTable colWidths="100, 210,210" style="Struktur" hAlign="RIGHT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_links"></para> | ||||
|         </td>	 | ||||
|         <td>  | ||||
|         	<para style="tabelle_daten_links"><b>Fertigungsartikel: [[ (o.product_id.default_code and '['+o.product_id.default_code+']') or '']] [[ o.product_id.name ]]</b></para> | ||||
|         </td> | ||||
|         <td> | ||||
|         	<para style="tabelle_daten_links"><b>Zu fertigende Menge: [[ o.product_qty ]]</b></para> | ||||
|         </td> | ||||
|       </tr> | ||||
|      </blockTable>    | ||||
|      | ||||
|     <spacer length="0.5cm"/>  		 | ||||
|     | ||||
|     <blockTable colWidths="100, 210,210" style="Struktur" hAlign="RIGHT"> | ||||
|        <tr> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_links">Bestandteile:</para> | ||||
|          <spacer length="0.2cm"/>    | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_links">Artikel</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_links">Menge</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr>[[repeatIn(o.move_lines,'line')]] | ||||
|         <td> | ||||
|           <para style="tabelle_daten_links"></para> | ||||
|         </td>	 | ||||
|         <td> | ||||
|           <para style="tabelle_daten_links">[[ (line.product_id.default_code and '['+line.product_id.default_code+']') or '']] [[ line.product_id.name]]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_links">[[ line.product_qty ]]</para> | ||||
|         </td>         | ||||
|       </tr> | ||||
|     </blockTable>   | ||||
| 
 | ||||
|   </story> | ||||
| </document> | ||||
|  | @ -1,53 +0,0 @@ | |||
| <header> | ||||
|     <pageTemplate> | ||||
|         <frame id="first" x1="1.5cm" y1="4cm" height="21.1cm" width="18.5cm"/> | ||||
|          <stylesheet> | ||||
|             <!-- Set here the default font to use for all <para> tags --> | ||||
|             <paraStyle name='Normal' fontName="Helvetica"/> | ||||
|             <paraStyle name="footer"  fontName="Helvetica" leading="8" fontSize="7.0" alignment="LEFT"/> | ||||
|             <paraStyle name="footer_rechts"  fontName="Helvetica" leading="8" fontSize="7.0" alignment="RIGHT"/> | ||||
|             <paraStyle name="header_fett"  fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/> | ||||
|             <paraStyle name="header"  fontName="Helvetica" fontSize="7.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> | ||||
|             <paraStyle name="Absender"  fontName="Helvetica" fontSize="7.0" leading="8" alignment="LEFT" spaceAfter="0.0"/> | ||||
| 
 | ||||
|             <paraStyle name="normal" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" /> | ||||
|             <paraStyle name="fett" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/> | ||||
|             <paraStyle name="ueberschrift" fontName="Helvetica-Bold" fontSize="10.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/> | ||||
|              | ||||
|             <paraStyle name="tabelle_header" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER"/> | ||||
|             <paraStyle name="tabelle_header_links" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT"/> | ||||
|             <paraStyle name="tabelle_header_rechts" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/> | ||||
|             <paraStyle name="tabelle_daten_center" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER"/> | ||||
|             <paraStyle name="tabelle_daten_links" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/> | ||||
|             <paraStyle name="tabelle_daten_links_italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT"/> | ||||
|             <paraStyle name="tabelle_daten_rechts" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/> | ||||
|              | ||||
|             <paraStyle name="schlussrechnung" fontName="Helvetica" fontSize="9.0" leading="10" alignment="RIGHT"/> | ||||
|             <paraStyle name="schlussrechnung_fett" fontName="Helvetica-Bold" fontSize="9.0" leading="10" alignment="RIGHT"/> | ||||
|             <paraStyle name="skonto" fontName="Helvetica" fontSize="7.0" leading="10" alignment="RIGHT"/> | ||||
|              | ||||
|             <!--  Tabellen --> | ||||
|             <blockTableStyle id="Struktur"> | ||||
|               <blockAlignment value="LEFT"/> | ||||
|               <blockValign value="TOP"/> | ||||
|               <blockTopPadding length="0"/> | ||||
|               <blockBottomPadding length="0"/>       | ||||
|               <blockLeftPadding length="0"/>       | ||||
|               <blockRightPadding length="0"/>       | ||||
|             </blockTableStyle> | ||||
|          | ||||
|             <blockTableStyle id="TabelleHaupt"> | ||||
|               <blockAlignment value="LEFT"/> | ||||
|               <blockValign value="TOP"/> | ||||
|               <lineStyle kind="LINEBELOW" colorName="#000000" thickness="0.5"/> | ||||
|               <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0" thickness="1"/> | ||||
|               <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="-1,-1" thickness="1"/> | ||||
|             </blockTableStyle> | ||||
|          | ||||
|             <blockTableStyle id="TabelleSchlussrechnung"> | ||||
|               <blockValign value="MIDDLE"/>  | ||||
|             </blockTableStyle>             | ||||
|          </stylesheet> | ||||
|           | ||||
|     </pageTemplate> | ||||
| </header> | ||||
|  | @ -1,225 +0,0 @@ | |||
| <?xml version="1.0"?> | ||||
| <!--   | ||||
|     <reports> | ||||
|         <report>purchase.report_purchaseorder</report> | ||||
|     </reports> | ||||
| --> | ||||
| <document filename="Purchase Quotation.pdf"> | ||||
|   <template pageSize="(595.0,842.0)" title="Purchase Order" author="andreas.brueckl@cmotion.eu" allowSplitting="20"> | ||||
|     <pageTemplate id="first"> | ||||
|       <frame id="first" x1="15.0" y1="42.0" width="539" height="758"/> | ||||
|     </pageTemplate> | ||||
|   </template> | ||||
| 
 | ||||
|   <story> | ||||
|     <para> | ||||
|       <seqReset id="L1"/> | ||||
|     </para>   | ||||
|     <para>[[repeatIn(objects,'o')]] [[ setLang(o.partner_id.commercial_partner_id.lang)]]</para> | ||||
|     | ||||
|     <para style="fett">[[ o.partner_id.commercial_partner_id.name ]]</para> | ||||
|     <para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para> | ||||
|     <para style="normal">[[ (o.partner_id.street ) or '']]</para> | ||||
|     <para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para> | ||||
|     <para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id.city) or '' ]]</para> | ||||
|     <para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para> | ||||
|     <para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para> | ||||
| 
 | ||||
|      | ||||
|     <blockTable colWidths="100,150" style="Struktur" hAlign="RIGHT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|         </td> | ||||
|         <td align="right"> | ||||
|             <para style="normal">Ihr Ansprechpartner</para> | ||||
|             <blockTable colWidths="65,165" style="Struktur"> | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <para style="normal">Name:</para> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <para style="normal">[[ (user.name) or '' ]]</para> | ||||
|                 </td> | ||||
|               </tr> | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <para style="normal">Telefon:</para> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <para style="normal">[[ user.partner_id.phone or '' ]]</para> | ||||
|                 </td> | ||||
|               </tr>   | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <para style="normal">E-Mail:</para> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <para style="normal">[[ user.partner_id.email or '' ]]</para> | ||||
|                 </td> | ||||
|               </tr>    | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <spacer length="0.5cm"/> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                    <spacer length="0.5cm"/> | ||||
|                 </td> | ||||
|               </tr>                                    | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <para style="normal">Datum:</para> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <para style="normal">[[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]]</para> | ||||
|                 </td> | ||||
|               </tr>                | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <para style="normal">Referenz:</para> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <para style="normal">[[ o.partner_ref or '' ]]</para> | ||||
|                 </td> | ||||
|               </tr>                                                                | ||||
|             </blockTable> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
|          | ||||
| 
 | ||||
|     <para style="ueberschrift">Bestellung [[ o.name ]]</para> | ||||
|    | ||||
|     <spacer length="0.5cm"/> | ||||
|      | ||||
|     <blockTable colWidths="30.0, 57, 213.0, 60, 45, 55.0, 60.0" repeatRows="1" style="TabelleHaupt" hAlign="LEFT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="tabelle_header">Pos</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header_links">Art.nr.</para> | ||||
|         </td>                                | ||||
|         <td> | ||||
|           <para style="tabelle_header_links">Bezeichnung</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header">gepl.</para> | ||||
|           <para style="tabelle_header">Lieferung</para> | ||||
|         </td>                 | ||||
|         <td> | ||||
|           <para style="tabelle_header">Menge</para> | ||||
|         </td>          | ||||
|         <td> | ||||
|           <para style="tabelle_header_rechts">E-Preis</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header_rechts">G-Preis</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|         <tr>[[repeatIn(o.order_line,'line')]] | ||||
| 	  <td> | ||||
| 	    <para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0"> | ||||
| 	      <seq id="L1"/> | ||||
| 	    </para> | ||||
| 	  </td> | ||||
| 	      <td> | ||||
|             <para style="tabelle_daten_links">[[ line.product_id and line.product_id.default_code ]]</para> | ||||
|           </td>  | ||||
|           <td> | ||||
|             <para style="tabelle_daten_links">[[ (line.name or '').split('\n\n')[0] ]]</para> | ||||
|             <section>[[ repeatIn((line.name or '').split('\n\n')[1:],'paragraphs') ]] | ||||
|                 <spacer length="0.4cm"/>             | ||||
|                 <para style="tabelle_daten_links">[[ paragraphs ]]</para>    | ||||
|             </section> | ||||
|               | ||||
|             <para style="tabelle_daten_links">Ihre Artikelnr.: [[ line.supplier_code or removeParentNode('para')]]</para> | ||||
|           </td>	   | ||||
|           <td> | ||||
|             <para style="tabelle_daten_center">[[ formatLang(line.date_planned,date=True) ]]</para> | ||||
|           </td>	           | ||||
|                                | ||||
|           <td> | ||||
|             <para style="tabelle_daten_center">[[ formatLang(line.product_qty, digits=2)[-2:]=='00' and formatLang(line.product_qty, digits=0) or formatLang(line.product_qty, digits=2) ]]</para> | ||||
|           </td>          | ||||
|           <td> | ||||
|             <para style="tabelle_daten_rechts">[[ formatLang(line.price_unit, digits=2) ]]</para> | ||||
|           </td> | ||||
|           <td> | ||||
|             <para style="tabelle_daten_rechts">[[ formatLang(line.price_subtotal, digits=2) ]]</para> | ||||
|           </td> | ||||
|         </tr> | ||||
|       </blockTable> | ||||
|        | ||||
|      | ||||
|      | ||||
|     <blockTable colWidths="180,205,70, 80" style="TabelleSchlussrechnung"> | ||||
|       <tr>[[ o.amount_tax > 0 or removeParentNode('tr') ]] | ||||
|         <td> | ||||
|           <para style="schlussrechnung"></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">Nettobetrag in €:</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">[[o.pricelist_id.currency_id.name]]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">[[ formatLang(o.amount_untaxed, digits=2)]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr>[[ o.amount_tax > 0 or removeParentNode('tr') ]] | ||||
|         <td> | ||||
|           <para style="schlussrechnung"></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">MwSt. in €:</para> | ||||
|         </td> | ||||
|          <td> | ||||
|           <para style="schlussrechnung">[[ o.pricelist_id.currency_id.name ]]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">[[ formatLang(o.amount_tax, digits=2) ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="schlussrechnung_fett"></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung_fett">Gesamt in €:</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung_fett">[[ o.pricelist_id.currency_id.name ]]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung_fett">[[ formatLang(o.amount_total,digits=2) ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
| 
 | ||||
|     <spacer length="0.5cm"/> | ||||
| 
 | ||||
|     <para style="normal">[[ (o.notes or '').split('\n\n')[0] ]]</para> | ||||
|     <section>[[ repeatIn((o.notes or '').split('\n\n')[1:],'paragraphs') ]] | ||||
|         <spacer length="0.4cm"/>             | ||||
|         <para style="normal">[[ paragraphs ]]</para>    | ||||
|     </section>  | ||||
| 
 | ||||
|     <spacer length="0.5cm"/> | ||||
|          | ||||
|     <blockTable colWidths="110,300" style="Struktur" hAlign="LEFT"> [[o.incoterm_id or removeParentNode('blockTable')  ]] | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="normal">Lieferbedingung:</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="normal">[[o.incoterm_id and o.incoterm_id.name or '' ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|      </blockTable> | ||||
| 
 | ||||
| 
 | ||||
|     <spacer length="0.5cm"/> | ||||
|      | ||||
|   </story> | ||||
| </document> | ||||
|  | @ -1,168 +0,0 @@ | |||
| <?xml version="1.0"?> | ||||
| <!--   | ||||
|     <reports> | ||||
|         <report>purchase.report_purchasequotation</report> | ||||
|     </reports> | ||||
| --> | ||||
| <document filename="Purchase Quotation.pdf"> | ||||
|   <template pageSize="(595.0,842.0)" title="Purchase Order" author="andreas.brueckl@cmotion.eu" allowSplitting="20"> | ||||
|     <pageTemplate id="first"> | ||||
|       <frame id="first" x1="15.0" y1="42.0" width="539" height="758"/> | ||||
|     </pageTemplate> | ||||
|   </template> | ||||
| 
 | ||||
|   <story> | ||||
|     <para> | ||||
|       <seqReset id="L1"/> | ||||
|     </para>   | ||||
|     <para>[[repeatIn(objects,'o')]] [[ setLang(o.partner_id.commercial_partner_id.lang)]]</para> | ||||
|     | ||||
|     <para style="fett">[[ o.partner_id.commercial_partner_id.name ]]</para> | ||||
|     <para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para> | ||||
|     <para style="normal">[[ (o.partner_id.street ) or '']]</para> | ||||
|     <para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para> | ||||
|     <para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id.city) or '' ]]</para> | ||||
|     <para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para> | ||||
|     <para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para> | ||||
| 
 | ||||
|      | ||||
|     <blockTable colWidths="100,150" style="Struktur" hAlign="RIGHT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|         </td> | ||||
|         <td align="right"> | ||||
|             <para style="normal">Ihr Ansprechpartner</para> | ||||
|             <blockTable colWidths="65,165" style="Struktur"> | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <para style="normal">Name:</para> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <para style="normal">[[ (user.name) or '' ]]</para> | ||||
|                 </td> | ||||
|               </tr> | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <para style="normal">Telefon:</para> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <para style="normal">[[ user.partner_id.phone or '' ]]</para> | ||||
|                 </td> | ||||
|               </tr>   | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <para style="normal">E-Mail:</para> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <para style="normal">[[ user.partner_id.email or '' ]]</para> | ||||
|                 </td> | ||||
|               </tr>    | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <spacer length="0.5cm"/> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                    <spacer length="0.5cm"/> | ||||
|                 </td> | ||||
|               </tr>                        | ||||
|              | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <para style="normal">Datum:</para> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <para style="normal">[[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]]</para> | ||||
|                 </td> | ||||
|               </tr>                | ||||
|               <tr> | ||||
|                 <td> | ||||
|                     <para style="normal">Referenz:</para> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <para style="normal">[[ o.partner_ref or '' ]]</para> | ||||
|                 </td> | ||||
|               </tr>                                                                | ||||
|             </blockTable> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
|          | ||||
| 
 | ||||
|     <para style="ueberschrift">Anfrage [[ o.name ]]</para> | ||||
|    | ||||
|     <spacer length="0.5cm"/> | ||||
|      | ||||
|     <blockTable colWidths="30.0, 57, 328.0, 60, 45" repeatRows="1" style="TabelleHaupt" hAlign="LEFT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="tabelle_header">Pos</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header_links">Art.nr.</para> | ||||
|         </td>                                | ||||
|         <td> | ||||
|           <para style="tabelle_header_links">Bezeichnung</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header">gepl.</para> | ||||
|           <para style="tabelle_header">Lieferung</para> | ||||
|         </td>                 | ||||
|         <td> | ||||
|           <para style="tabelle_header">Menge</para> | ||||
|         </td>          | ||||
|       </tr> | ||||
|         <tr>[[repeatIn(o.order_line,'line')]] | ||||
|       <td> | ||||
|         <para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0"> | ||||
|           <seq id="L1"/> | ||||
|         </para> | ||||
|       </td> | ||||
|           <td> | ||||
|             <para style="tabelle_daten_links">[[ line.product_id and line.product_id.default_code ]]</para> | ||||
|           </td>  | ||||
|           <td> | ||||
|             <para style="tabelle_daten_links">[[ (line.name or '').split('\n\n')[0] ]]</para> | ||||
|             <section>[[ repeatIn((line.name or '').split('\n\n')[1:],'paragraphs') ]] | ||||
|                 <spacer length="0.4cm"/>             | ||||
|                 <para style="tabelle_daten_links">[[ paragraphs ]]</para>    | ||||
|             </section> | ||||
|              | ||||
|             <para style="tabelle_daten_links">Ihre Artikelnr.: [[ line.supplier_code or removeParentNode('para')]]</para> | ||||
|           </td>    | ||||
|           <td> | ||||
|             <para style="tabelle_daten_center">[[ formatLang(line.date_planned,date=True) ]]</para> | ||||
|           </td>            | ||||
|                                | ||||
|           <td> | ||||
|             <para style="tabelle_daten_center">[[ formatLang(line.product_qty, digits=2)[-2:]=='00' and formatLang(line.product_qty, digits=0) or formatLang(line.product_qty, digits=2) ]]</para> | ||||
|           </td>          | ||||
|         </tr> | ||||
|       </blockTable> | ||||
|        | ||||
|     <spacer length="0.5cm"/> | ||||
| 
 | ||||
|     <para style="normal">[[ (o.notes or '').split('\n\n')[0] ]]</para> | ||||
|     <section>[[ repeatIn((o.notes or '').split('\n\n')[1:],'paragraphs') ]] | ||||
|         <spacer length="0.4cm"/>             | ||||
|         <para style="normal">[[ paragraphs ]]</para>    | ||||
|     </section>  | ||||
| 
 | ||||
|     <spacer length="0.5cm"/> | ||||
|          | ||||
|     <blockTable colWidths="110,300" style="Struktur" hAlign="LEFT"> [[o.incoterm_id or removeParentNode('blockTable')  ]] | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="normal">Lieferbedingung:</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="normal">[[o.incoterm_id and o.incoterm_id.name or '' ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|      </blockTable> | ||||
| 
 | ||||
| 
 | ||||
|     <spacer length="0.5cm"/> | ||||
| 
 | ||||
|      | ||||
|   </story> | ||||
| </document> | ||||
|  | @ -1,275 +0,0 @@ | |||
| <?xml version="1.0"?> | ||||
| <document filename="Auftrag.pdf"> | ||||
|   <template pageSize="(595.0,842.0)" title="Sale Order" author="Camadeus Consulting" allowSplitting="20"> | ||||
|     <pageTemplate id="first"> | ||||
|       <frame id="first" x1="15.0" y1="42.0" width="539" height="758"/> | ||||
|     </pageTemplate> | ||||
|   </template> | ||||
| 
 | ||||
|   <story> | ||||
|   	 | ||||
|     <para> | ||||
|       <seqReset id="L1"/> | ||||
|     </para> | ||||
|     <para>[[repeatIn(objects,'o')]] [[ setLang(o.partner_id.commercial_partner_id.lang)]]</para> | ||||
|      | ||||
| 	<blockTable colWidths="270,230" style="Struktur"> | ||||
| 		<tr> | ||||
| 			<td> | ||||
| 				<section>   | ||||
| 				    <para style="fett">[[ o.partner_id.commercial_partner_id.name ]]</para> | ||||
|                     <para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para> | ||||
| 				    <para style="normal">[[ (o.partner_id.street ) or '']]</para> | ||||
| 				    <para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id and o.partner_id.city) or '' ]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para> | ||||
| 				    <!-- Für Sichtfenster --> | ||||
| 				     | ||||
| 				    <section>[[ not (o.partner_id.commercial_partner_id and o.partner_id.commercial_partner_id.ref) or removeParentNode('section') ]] | ||||
| 					    <para style="normal"> </para> | ||||
| 				    </section> 	 | ||||
| 				     | ||||
| 	    			<section>[[ (o.partner_shipping_id and o.partner_shipping_id.id != o.partner_id.id) or removeParentNode('section')]]     | ||||
| 	                    <spacer length="1.5cm"/>  | ||||
| 					    <para style="normal">Lieferadresse:</para> | ||||
| 					    <para style="normal">[[ o.partner_shipping_id.commercial_partner_id.name ]]</para> | ||||
| 	                    <para style="normal">[[ (o.partner_shipping_id.commercial_partner_id.id != o.partner_shipping_id.id and o.partner_shipping_id.name) or '' ]] </para> | ||||
| 					    <para style="normal">[[ (o.partner_shipping_id.street ) or '']]</para> | ||||
| 					    <para style="normal">[[ (o.partner_shipping_id.street2) or removeParentNode('para') ]]</para> | ||||
| 					    <para style="normal">[[ (o.partner_shipping_id.zip) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.city) or '' ]]</para> | ||||
| 					    <para style="normal">[[ (o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name) or removeParentNode('para')]]</para> | ||||
| 					    <para style="normal">[[ (o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name) or '' ]]</para>     | ||||
| 					</section>		     | ||||
| 				</section> | ||||
| 				<para></para>    				     | ||||
|     		</td> | ||||
|     		<td> | ||||
|     		<blockTable colWidths="85,145" style="Struktur"> | ||||
| 	    		<tr> | ||||
| 		    		<td> | ||||
| 		            	<para style="normal">Angebotsdatum:[[ o.state not in ['draft','sent'] and removeParentNode('para') ]]</para> | ||||
| 		            	<para style="normal">Bestelldatum:[[ o.state in ['draft','sent'] and removeParentNode('para') ]]</para> | ||||
| 		    		</td> | ||||
| 		    		<td> | ||||
| 		    			<para style="normal">[[ formatLang(o.date_order,date = True) ]]</para> | ||||
| 		    		</td> | ||||
| 		    	</tr> | ||||
| 	    		<tr> | ||||
| 		    		<td> | ||||
| 		            	<para style="normal">Quelldokument:[[ o.state not in ['draft','sent'] and removeParentNode('tr') ]]</para> | ||||
| 		    		</td> | ||||
| 		    		<td> | ||||
| 		    			<para style="normal">[[ o.origin ]]</para> | ||||
| 		    		</td> | ||||
| 		    	</tr> | ||||
| 	    		<tr> | ||||
| 		    		<td> | ||||
| 		            	<para style="normal">Kundennummer:</para> | ||||
| 		    		</td> | ||||
| 		    		<td> | ||||
| 		    			<para style="normal">[[ o.client_order_ref ]]</para> | ||||
| 		    		</td> | ||||
| 		    	</tr> | ||||
| 	    		<tr> | ||||
| 		    		<td> | ||||
| 		            	<para style="normal">Kunde UID Nr.:</para> | ||||
| 		    		</td> | ||||
| 		    		<td> | ||||
| 		    			<para style="normal">[[ o.partner_id.commercial_partner_id and o.partner_id.commercial_partner_id.vat or '' ]]</para>  | ||||
| 		    		</td> | ||||
| 		    	</tr> | ||||
| 	    		<tr> | ||||
| 		    		<td> | ||||
| 		            	<para style="normal">Ansprechpartner:</para> | ||||
| 		    		</td> | ||||
| 		    		<td> | ||||
| 		    			<para style="normal">[[ (o.user_id and o.user_id.name) or '' ]]</para> | ||||
| 		    		</td> | ||||
| 		    	</tr> | ||||
| 			</blockTable> | ||||
| 			</td> | ||||
| 		</tr>     | ||||
| 		<!--   | ||||
| 		<tr> | ||||
| 			<td> | ||||
|     			<section>[[ (o.partner_shipping_id and o.partner_shipping_id.id != o.partner_id.id) or removeParentNode('section')]]     | ||||
|                     <spacer length="0.5cm"/>  | ||||
| 				    <para style="normal">Lieferadresse:</para> | ||||
| 				    <para style="normal">[[ o.partner_shipping_id.commercial_partner_id.name ]]</para> | ||||
|                     <para style="normal">[[ (o.partner_shipping_id.commercial_partner_id.id != o.partner_shipping_id.id and o.partner_shipping_id.name) or '' ]] </para> | ||||
| 				    <para style="normal">[[ (o.partner_shipping_id.street ) or '']]</para> | ||||
| 				    <para style="normal">[[ (o.partner_shipping_id.street2) or removeParentNode('para') ]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_shipping_id.zip) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.city) or '' ]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name) or removeParentNode('para')]]</para> | ||||
| 				    <para style="normal">[[ (o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name) or '' ]]</para>     | ||||
| 				</section> | ||||
| 				<para style="normal"> </para> | ||||
|     		</td> | ||||
|     		<td> | ||||
|             	<para style="normal"> </para> | ||||
| 			</td> | ||||
|     		<td> | ||||
|             	<para style="normal"> </para> | ||||
| 			</td> | ||||
| 		</tr>    | ||||
| 		-->		 | ||||
| 	</blockTable> | ||||
|      | ||||
|    <spacer length="1.0cm"/> | ||||
|     | ||||
|     <section> | ||||
|        <para style="ueberschrift2"><b>[[ o.state not in ['draft','sent'] and removeParentNode('para') ]] Angebot [[ o.name ]]</b></para> | ||||
|        <para style="ueberschrift2"><b>[[ o.state in ['draft','sent'] and removeParentNode('para') ]] Bestellbestätigung [[ o.name ]]</b></para> | ||||
|     </section> | ||||
| 
 | ||||
|     <spacer length="0.5cm"/> | ||||
|      | ||||
|     <blockTable colWidths="30,57,170,75,63,40,75" repeatRows="1" style="TabelleHaupt" hAlign="LEFT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="tabelle_header">Pos</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header">Art.nr.</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header_links">Bezeichnung</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header_links">Menge</para> | ||||
|         </td>  | ||||
|         <td> | ||||
|           <para style="tabelle_header_rechts">Einzelpreis</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header"></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header_rechts">Gesamtpreis</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|        | ||||
|       <tr>[[repeatIn(o.order_line,'line')]] | ||||
|         <td> | ||||
|           <para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0"> | ||||
|             <seq id="L1"/> | ||||
|           </para>           | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_center">[[ line.product_id and line.product_id.default_code or '']]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|             <para style="tabelle_daten_links">[[ (line.name or '').split('\n\n')[0] ]]</para> | ||||
|             <section>[[ repeatIn((line.name or '').split('\n\n')[1:],'paragraphs') ]] | ||||
|                 <spacer length="0.4cm"/>             | ||||
|                 <para style="tabelle_daten_links">[[ paragraphs ]]</para>    | ||||
|             </section>            | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_links">[[ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty, digits=0) ]] [[ line.product_uom.name ]]</para> | ||||
|         </td>    | ||||
|         <td> | ||||
|           <para style="tabelle_daten_rechts">[[ formatLang(line.price_unit,digits=2) ]]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_rechts">[[ line.discount <> 0 and (formatLang(line.discount) + '%') or '' ]]</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_rechts">[[ formatLang(line.price_subtotal,digits=2 ) ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
|     	 | ||||
|     <blockTable colWidths="210,200,100" style="TabelleSchlussrechnung"> | ||||
|       <tr> | ||||
|         <td> | ||||
|             <para></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">Zwischensumme in €</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">[[ formatLang(o.amount_untaxed,digits=2 )]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr> | ||||
|         <td> | ||||
|             <para></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">MwSt. in €</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">[[ formatLang(o.amount_tax,digits=2 ) ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr> | ||||
|         <td> | ||||
|             <para></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung_fett">Rechnungsbetrag in €</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung_fett">[[ formatLang(o.amount_total,digits=2 ) ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr> | ||||
|         <td> | ||||
|             <para></para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">Rechnungsbetrag inkl. Skonto in €</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="schlussrechnung">[[ (o.skonto_betrag_inkl and formatLang(o.skonto_betrag_inkl,digits=2)) or removeParentNode('tr') ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
| 
 | ||||
|     <spacer length="0.5cm"/> | ||||
| 
 | ||||
|     <para style="normal">[[ (o.note or '').split('\n\n')[0] ]]</para> | ||||
|     <section>[[ repeatIn((o.note or '').split('\n\n')[1:],'paragraphs') ]] | ||||
|         <spacer length="0.4cm"/>             | ||||
|         <para style="normal">[[ paragraphs ]]</para>    | ||||
|     </section>       | ||||
| 
 | ||||
|     <spacer length="0.5cm"/> | ||||
|      | ||||
| 	<blockTable colWidths="110,390" style="Struktur" hAlign="LEFT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="normal">Zahlungsbedingungen:</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="normal">[[ (o.payment_term and o.payment_term.note) or removeParentNode('blockTable') ]]</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
|      | ||||
|     <!--  | ||||
|     <spacer length="0.5cm"/> | ||||
| 
 | ||||
|     <blockTable colWidths="500" style="Struktur" hAlign="LEFT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="normal"></para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr>[[ o.date_due and o.payment_term and o.payment_term.skonto_prozent or removeParentNode('tr') ]] | ||||
|         <td> | ||||
|           <para style="normal">Zahlbar bis [[ formatLang(o.skonto_faelligkeit,date = True) ]] abzüglich [[ formatLang(o.payment_term.skonto_prozent,digits=2) ]]% beträgt [[ formatLang(o.skonto_betrag_inkl,digits=2) ]]€.</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr>[[ o.date_due or removeParentNode('tr') ]] | ||||
|         <td> | ||||
|           <para style="normal">Zahlbar bis [[ formatLang(o.date_due,date = True) ]] ohne Abzug.</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|     </blockTable> | ||||
|     --> | ||||
|      | ||||
|   </story> | ||||
| </document> | ||||
|  | @ -1,101 +0,0 @@ | |||
| <?xml version="1.0"?> | ||||
| <document filename="Lieferschein.pdf"> | ||||
|   <template pageSize="(595.0,842.0)" title="Sale Order" author="Camadeus Consulting" allowSplitting="20"> | ||||
|     <pageTemplate id="first"> | ||||
|       <frame id="first" x1="15.0" y1="42.0" width="539" height="758"/> | ||||
|     </pageTemplate> | ||||
|   </template> | ||||
|   | ||||
|   <story> | ||||
|   	 | ||||
|     <para> | ||||
|       <seqReset id="L1"/> | ||||
|     </para>   | ||||
|     <para>[[ repeatIn(objects,'picking') ]] [[ picking.partner_id and setLang(picking.partner_id.lang) ]]</para> | ||||
| 
 | ||||
| 	<blockTable colWidths="270,85,145" style="Struktur"> | ||||
| 		<tr> | ||||
| 			<td> | ||||
| 				<section>   | ||||
| 				    <para style="fett">[[ picking.partner_id.commercial_partner_id.name ]]</para> | ||||
|                     <para style="normal">[[ (picking.partner_id.commercial_partner_id.id != picking.partner_id.id and picking.partner_id.name) or '' ]] </para> | ||||
| 				    <para style="normal">[[ (picking.partner_id.street ) or '']]</para> | ||||
| 				    <para style="normal">[[ (picking.partner_id.street2) or removeParentNode('para') ]]</para> | ||||
| 				    <para style="normal">[[ (picking.partner_id.zip) or '' ]] [[ (picking.partner_id and picking.partner_id.city) or '' ]]</para> | ||||
| 				    <para style="normal">[[ (picking.partner_id.state_id and picking.partner_id.state_id.name) or removeParentNode('para')]]</para> | ||||
| 				    <para style="normal">[[ (picking.partner_id.country_id and picking.partner_id.country_id.name) or '' ]]</para> | ||||
| 				    <!-- Für Sichtfenster --> | ||||
| 				    <section>[[ not (picking.partner_id.commercial_partner_id and picking.partner_id.commercial_partner_id.ref) or removeParentNode('section') ]] | ||||
| 					    <para style="normal"> </para> | ||||
| 				    </section> 				     | ||||
| 				</section> | ||||
| 				<para></para>    				     | ||||
|     		</td> | ||||
|     		<td> | ||||
| 			    <para style="normal">Datum:</para> | ||||
| 			    <para style="normal">Bestellung:</para> | ||||
| 			    <para style="normal">Kundenreferenz:</para> | ||||
| 			    <para style="normal">Kundennr.:</para>    | ||||
| 			</td> | ||||
|     		<td> | ||||
| 			    <para style="normal">[[ formatLang(picking.date_done, date=True) or formatLang(time.strftime('%Y-%m-%d'),date=True) ]] </para> | ||||
| 			    <para style="normal">[[ picking.origin ]] </para> | ||||
| 			    <para style="normal">[[ picking.sale_id and picking.sale_id.client_order_ref or '' ]] </para> | ||||
| 			    <para style="normal">[[ picking.partner_id and picking.partner_id.commercial_partner_id and picking.partner_id.commercial_partner_id.ref or '' ]] </para>    | ||||
| 			</td> | ||||
| 		</tr>     | ||||
| 	</blockTable> | ||||
|        | ||||
|    <spacer length="1.0cm"/> | ||||
|       | ||||
|     <para style="ueberschrift">Lieferschein [[ picking.name ]]</para> | ||||
|   	 | ||||
| 	<spacer length="0.5cm"/> | ||||
| 	 | ||||
|     <blockTable colWidths="30,80,304,80" repeatRows="1" style="TabelleHaupt" hAlign="LEFT"> | ||||
|       <tr> | ||||
|         <td> | ||||
|           <para style="tabelle_header">Pos</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header">Art.nr.</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header_links">Bezeichnung</para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_header">Menge</para> | ||||
|         </td> | ||||
|       </tr> | ||||
|       <tr>[[ repeatIn([line for line in picking.move_lines if line.state <> 'cancel'],'move_lines') ]] | ||||
|         <td> | ||||
|           <para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0"> | ||||
|             <seq id="L1"/> | ||||
|           </para> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_center">[[ move_lines.product_id.default_code ]]</para> | ||||
|         </td>         | ||||
|         <td> | ||||
|             <para style="tabelle_daten_links">[[ (move_lines.name or '').split('\n\n')[0] ]]</para> | ||||
|             <section>[[ repeatIn((move_lines.name or '').split('\n\n')[1:],'paragraphs') ]] | ||||
|                 <spacer length="0.4cm"/>             | ||||
|                 <para style="tabelle_daten_links">[[ paragraphs ]]</para>    | ||||
|             </section> | ||||
|         </td> | ||||
|         <td> | ||||
|           <para style="tabelle_daten_center">[[ formatLang(move_lines.product_qty, digits=0) ]] </para> | ||||
|         </td>         | ||||
|       </tr> | ||||
|     </blockTable> | ||||
| 
 | ||||
|     <spacer length="0.5cm"/> | ||||
| 
 | ||||
|     <para style="normal">[[ (picking.note or '').split('\n\n')[0] ]]</para> | ||||
|     <section>[[ repeatIn((picking.note or '').split('\n\n')[1:],'paragraphs') ]] | ||||
|         <spacer length="0.4cm"/>             | ||||
|         <para style="normal">[[ paragraphs ]]</para>    | ||||
|     </section>  | ||||
|      | ||||
|   </story> | ||||
| </document> | ||||
|  | @ -1,34 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <openerp> | ||||
|     <data> | ||||
|         <record id="sale.report_sale_order" model="ir.actions.report.xml"> | ||||
|             <field name="report_rml">cam_reports/report/sale.order.rml</field> | ||||
|             <field name="report_type">pdf</field> | ||||
|         </record> | ||||
| 
 | ||||
|         <record id="stock.action_report_picking" model="ir.actions.report.xml"> | ||||
|             <field name="report_rml">cam_reports/report/stock.picking.rml</field> | ||||
|             <field name="report_type">pdf</field> | ||||
|         </record> | ||||
| 
 | ||||
|         <record id="account.account_invoices" model="ir.actions.report.xml"> | ||||
|             <field name="report_rml">cam_reports/report/account.invoice.rml</field> | ||||
|             <field name="report_type">pdf</field> | ||||
|         </record> | ||||
| 
 | ||||
|         <record id="purchase.report_purchase_quotation" model="ir.actions.report.xml"> | ||||
|             <field name="report_rml">cam_reports/report/purchase.quotation.rml</field> | ||||
|             <field name="report_type">pdf</field> | ||||
|         </record> | ||||
| 
 | ||||
|         <record id="purchase.action_report_purchase_order" model="ir.actions.report.xml"> | ||||
|             <field name="report_rml">cam_reports/report/purchase.order.rml</field> | ||||
|             <field name="report_type">pdf</field> | ||||
|         </record> | ||||
|          | ||||
|         <record id="mrp.action_report_production_order" model="ir.actions.report.xml"> | ||||
|             <field name="report_rml">cam_reports/report/mrp.production.rml</field> | ||||
|             <field name="report_type">pdf</field> | ||||
|         </record>           | ||||
|     </data> | ||||
| </openerp> | ||||
| Before Width: | Height: | Size: 2.8 KiB | 
| Before Width: | Height: | Size: 6.3 KiB | 
|  | @ -1,26 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution	 | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| import controllers | ||||
| import report | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
| 
 | ||||
|  | @ -1,46 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution     | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| 
 | ||||
| { | ||||
|     'name': 'Test Environment', | ||||
|     'version': '1.0', | ||||
|     'category': 'Custom', | ||||
|     'description': """ | ||||
| Test Environment  | ||||
| =========================== | ||||
| * Shows the message "Test" in the background if the database matches the regular expression of the config paramter "dbfilter_test" | ||||
| * Default filter: test* | ||||
| * Example: dbfilter_test = ['.*',] # for all Databases | ||||
| * Example: dbfilter_test = ['db1','db2'] # only for databases 'db1' and 'db2' | ||||
| 
 | ||||
|     """, | ||||
|     'author': 'camadeus Consulting GmbH', | ||||
|     'website': 'http://www.camadeus.at', | ||||
|     'depends': ['report', 'web', 'base'], | ||||
|     'data': [ | ||||
|         'views/cam_testenv.xml', | ||||
|     ], | ||||
|     'update_xml': [], | ||||
|     'demo_xml': [], | ||||
|     'installable': True, | ||||
|     'active': False, | ||||
| } | ||||
|  | @ -1,24 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution	 | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| import testenv_controller | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
| 
 | ||||
|  | @ -1,67 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| import re | ||||
| import openerp | ||||
| from openerp.tools.translate import _ | ||||
| from openerp.tools import config | ||||
| 
 | ||||
| from openerp.addons.web import http | ||||
| from openerp.addons.web.controllers.main import Home | ||||
| from openerp.http import request | ||||
| 
 | ||||
| 
 | ||||
| class Home_Debug(Home): | ||||
|     @http.route('/', type='http', auth="none") | ||||
|     def index(self, s_action=None, db=None, **kw): | ||||
| 
 | ||||
|         # Check arguments | ||||
|         if openerp.tools.config.get('show_debug', False): | ||||
|             return http.local_redirect('/web?debug=1', query=request.params, keep_hash=True) | ||||
|         else: | ||||
|             return http.local_redirect('/web', query=request.params, keep_hash=True) | ||||
| 
 | ||||
| 
 | ||||
| class WebClient(http.Controller): | ||||
|     _cp_path = "/web/testenv" | ||||
| 
 | ||||
|     @http.jsonrequest | ||||
|     def testmode(self, req, db=False): | ||||
|         if not db and req and req.session: | ||||
|             db = req.session._db | ||||
| 
 | ||||
|         if db: | ||||
|             h = req.httprequest.environ['HTTP_HOST'].split(':')[0] | ||||
|             d = h.split('.')[0] | ||||
|             r = openerp.tools.config.get('dbfilter_test', 'test.*').replace('%h', h).replace('%d', d) | ||||
|             try: | ||||
|                 pattern_list = eval(r) | ||||
|                 if not hasattr(pattern_list, '__iter__'): | ||||
|                     pattern_list = [pattern_list] | ||||
|             except: | ||||
|                 pattern_list = [r] | ||||
| 
 | ||||
|             for pattern in pattern_list: | ||||
|                 if isinstance(pattern, str) and re.match(pattern, db): | ||||
|                     return True | ||||
|         return False | ||||
| 
 | ||||
| # vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
|  | @ -1,49 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| # | ||||
| #    Odoo Extension Module | ||||
| #    Copyright (C) 2014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| import re | ||||
| import openerp | ||||
| from openerp import models | ||||
| import logging | ||||
| 
 | ||||
| _logger = logging.getLogger(__name__) | ||||
| 
 | ||||
| 
 | ||||
| class Report(models.Model): | ||||
|     _inherit = "report" | ||||
| 
 | ||||
|     def render(self, cr, uid, ids, template, values=None, context=None): | ||||
|         testmode = {'testmode': False} | ||||
| 
 | ||||
|         r = openerp.tools.config.get('dbfilter_test', 'test.*') | ||||
|         try: | ||||
|             pattern_list = eval(r) | ||||
|             if not hasattr(pattern_list, '__iter__'): | ||||
|                 pattern_list = [pattern_list] | ||||
|         except: | ||||
|             pattern_list = [r] | ||||
| 
 | ||||
|         for pattern in pattern_list: | ||||
|             if isinstance(pattern, str) and re.match(pattern, cr.dbname): | ||||
|                 testmode = {'testmode': True} | ||||
|                 _logger.info('testmode enabled for reports') | ||||
| 
 | ||||
|         if not values: | ||||
|             values = {} | ||||
|         values.update(testmode) | ||||
|         return super(Report, self).render(cr, uid, ids, template, values, context) | ||||
| Before Width: | Height: | Size: 2.8 KiB | 
|  | @ -1,20 +0,0 @@ | |||
| .test-mode-activated .oe_view_manager_wrapper { | ||||
| background-image: url("/cam_testenv/static/src/img/back-testenv.jpg"); | ||||
| background-size: cover; | ||||
| background-attachment: fixed; | ||||
| } | ||||
| .test-mode-activated .oe_view_manager_body, | ||||
| .test-mode-activated .oe_view_manager_wrapper > * { | ||||
| opacity: 0.9; | ||||
| background: rgba(255,255,255,.8) !important; | ||||
| } | ||||
| 
 | ||||
| .test-mode-activated .oe_list_field { | ||||
| opacity: 1; | ||||
| } | ||||
| 
 | ||||
| .test-mode-activated .oe_leftbar > * , | ||||
| .test-mode-activated .oe_view_manager_header > *{ | ||||
| background: lightblue; | ||||
| } | ||||
| 
 | ||||
| Before Width: | Height: | Size: 22 KiB | 
| Before Width: | Height: | Size: 25 KiB | 
|  | @ -1,69 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||||
| 
 | ||||
| <svg | ||||
|    xmlns:dc="http://purl.org/dc/elements/1.1/" | ||||
|    xmlns:cc="http://creativecommons.org/ns#" | ||||
|    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||||
|    xmlns:svg="http://www.w3.org/2000/svg" | ||||
|    xmlns="http://www.w3.org/2000/svg" | ||||
|    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||||
|    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||||
|    width="210mm" | ||||
|    height="297mm" | ||||
|    viewBox="0 0 744.09448819 1052.3622047" | ||||
|    id="svg2" | ||||
|    version="1.1" | ||||
|    inkscape:version="0.91 r13725" | ||||
|    sodipodi:docname="print_test.svg"> | ||||
|   <defs | ||||
|      id="defs4" /> | ||||
|   <sodipodi:namedview | ||||
|      id="base" | ||||
|      pagecolor="#ffffff" | ||||
|      bordercolor="#666666" | ||||
|      borderopacity="1.0" | ||||
|      inkscape:pageopacity="0.0" | ||||
|      inkscape:pageshadow="2" | ||||
|      inkscape:zoom="0.35" | ||||
|      inkscape:cx="-320.71429" | ||||
|      inkscape:cy="634.28571" | ||||
|      inkscape:document-units="px" | ||||
|      inkscape:current-layer="layer1" | ||||
|      showgrid="false" | ||||
|      inkscape:snap-text-baseline="false" | ||||
|      inkscape:window-width="1863" | ||||
|      inkscape:window-height="1176" | ||||
|      inkscape:window-x="57" | ||||
|      inkscape:window-y="24" | ||||
|      inkscape:window-maximized="1" /> | ||||
|   <metadata | ||||
|      id="metadata7"> | ||||
|     <rdf:RDF> | ||||
|       <cc:Work | ||||
|          rdf:about=""> | ||||
|         <dc:format>image/svg+xml</dc:format> | ||||
|         <dc:type | ||||
|            rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||||
|         <dc:title></dc:title> | ||||
|       </cc:Work> | ||||
|     </rdf:RDF> | ||||
|   </metadata> | ||||
|   <g | ||||
|      inkscape:label="Ebene 1" | ||||
|      inkscape:groupmode="layer" | ||||
|      id="layer1"> | ||||
|     <text | ||||
|        xml:space="preserve" | ||||
|        style="font-style:normal;font-weight:normal;font-size:334.50509644px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:0.20114942;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;" | ||||
|        x="-541.57294" | ||||
|        y="739.65405" | ||||
|        id="text3336" | ||||
|        sodipodi:linespacing="125%" | ||||
|        transform="matrix(0.57726416,-0.80650188,0.81188871,0.59801083,0,0)"><tspan | ||||
|          sodipodi:role="line" | ||||
|          id="tspan3338" | ||||
|          x="-541.57294" | ||||
|          y="739.65405">Test</tspan></text> | ||||
|   </g> | ||||
| </svg> | ||||
| Before Width: | Height: | Size: 2.2 KiB | 
|  | @ -1,70 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||||
| 
 | ||||
| <svg | ||||
|    xmlns:dc="http://purl.org/dc/elements/1.1/" | ||||
|    xmlns:cc="http://creativecommons.org/ns#" | ||||
|    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||||
|    xmlns:svg="http://www.w3.org/2000/svg" | ||||
|    xmlns="http://www.w3.org/2000/svg" | ||||
|    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||||
|    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||||
|    width="200mm" | ||||
|    height="234mm" | ||||
|    viewBox="0 0 708.66142 829.13385" | ||||
|    id="svg2" | ||||
|    version="1.1" | ||||
|    inkscape:version="0.91 r13725" | ||||
|    sodipodi:docname="print_test_n.svg"> | ||||
|   <defs | ||||
|      id="defs4" /> | ||||
|   <sodipodi:namedview | ||||
|      id="base" | ||||
|      pagecolor="#ffffff" | ||||
|      bordercolor="#666666" | ||||
|      borderopacity="1.0" | ||||
|      inkscape:pageopacity="0.0" | ||||
|      inkscape:pageshadow="2" | ||||
|      inkscape:zoom="0.35" | ||||
|      inkscape:cx="-320.71429" | ||||
|      inkscape:cy="634.28571" | ||||
|      inkscape:document-units="px" | ||||
|      inkscape:current-layer="layer1" | ||||
|      showgrid="false" | ||||
|      inkscape:snap-text-baseline="false" | ||||
|      inkscape:window-width="1863" | ||||
|      inkscape:window-height="1176" | ||||
|      inkscape:window-x="57" | ||||
|      inkscape:window-y="24" | ||||
|      inkscape:window-maximized="1" /> | ||||
|   <metadata | ||||
|      id="metadata7"> | ||||
|     <rdf:RDF> | ||||
|       <cc:Work | ||||
|          rdf:about=""> | ||||
|         <dc:format>image/svg+xml</dc:format> | ||||
|         <dc:type | ||||
|            rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||||
|         <dc:title></dc:title> | ||||
|       </cc:Work> | ||||
|     </rdf:RDF> | ||||
|   </metadata> | ||||
|   <g | ||||
|      inkscape:label="Ebene 1" | ||||
|      inkscape:groupmode="layer" | ||||
|      id="layer1" | ||||
|      transform="translate(0,-223.22835)"> | ||||
|     <text | ||||
|        xml:space="preserve" | ||||
|        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:252.86198425px;line-height:125%;font-family:'Arial Black';-inkscape-font-specification:'Arial Black, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#dddddf;fill-opacity:0.94117647;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||||
|        x="-639.02655" | ||||
|        y="739.08575" | ||||
|        id="text3336" | ||||
|        sodipodi:linespacing="125%" | ||||
|        transform="matrix(0.55246707,-0.84270113,0.77701305,0.62485212,0,0)"><tspan | ||||
|          sodipodi:role="line" | ||||
|          id="tspan3338" | ||||
|          x="-639.02655" | ||||
|          y="739.08575">TEST</tspan></text> | ||||
|   </g> | ||||
| </svg> | ||||
| Before Width: | Height: | Size: 2.4 KiB | 
|  | @ -1,32 +0,0 @@ | |||
| openerp.cam_testenv = function (openerp) { | ||||
| 	 | ||||
| 	openerp.web.WebClient = openerp.web.WebClient.extend({ | ||||
|     	/** | ||||
|     	 * Test env | ||||
|     	 */ | ||||
| 	    start: function() { | ||||
| 	        var self = this; | ||||
| 	         | ||||
| 	        return $.when(this._super()).then(function() { | ||||
| 		        //this._super();
 | ||||
| 		         | ||||
| 		        db = null | ||||
| 		        if (jQuery.param !== undefined && jQuery.deparam(jQuery.param.querystring()).db !== undefined) { | ||||
| 		        	db = jQuery.deparam(jQuery.param.querystring()).db | ||||
| 		        } | ||||
| 		         | ||||
| 		        self.rpc("/web/testenv/testmode", {'db': db}).done(function(result) { | ||||
| 		            // If immediately follows a login (triggered by trying to restore
 | ||||
| 		            // an invalid session or no session at all), refresh session data
 | ||||
| 		            // (should not change, but just in case...)
 | ||||
| 		           if (result) { | ||||
| 		        	   $("body").addClass("test-mode-activated"); | ||||
| 		               // $("body").css("background-image", "url(" + openerp.session.origin + "/cam_testenv/static/src/img/back-testenv.jpg" + ")");
 | ||||
| 		           } | ||||
| 		        }); | ||||
| 	        }); | ||||
| 	    }		 | ||||
| 		 | ||||
| 	}); | ||||
| 	 | ||||
| } | ||||
|  | @ -1,42 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <!-- vim:fdn=3: | ||||
| --> | ||||
| <openerp> | ||||
|     <data> | ||||
|         <template id="assets_backend" name="testenv_assets" inherit_id="web.assets_backend"> | ||||
|             <xpath expr="." position="inside"> | ||||
|                 <link rel="stylesheet" href="/cam_testenv/static/src/css/testenv.css"/> | ||||
|                 <script type="text/javascript" src="/cam_testenv/static/src/js/testenv.js"></script> | ||||
|             </xpath> | ||||
|         </template> | ||||
| 
 | ||||
|         <template id="report.style"> | ||||
|             body { | ||||
|             color: #000 !important; | ||||
|             word-wrap: break-word; | ||||
|             } | ||||
|             .border-black td { | ||||
|             border-top: 1px solid black !important; | ||||
|             } | ||||
|             .table-condensed > thead > tr > th { | ||||
|             border-bottom: 1px solid black !important; | ||||
|             } | ||||
|             .table-condensed > tbody > tr { | ||||
|             page-break-inside: avoid !important; | ||||
|             } | ||||
|             .zero_min_height { | ||||
|             min-height: 0px !important; | ||||
|             } | ||||
| 
 | ||||
|             <t t-if="testmode"> | ||||
|                 div.page { | ||||
|                 background-image: url("/cam_testenv/static/src/img/print_test_n.svg") !important; | ||||
|                 background-repeat: repeat-y; | ||||
|                 background-size: contain; | ||||
|                 background-position: center center; | ||||
|                 min-height: 234mm; | ||||
|                 } | ||||
|             </t> | ||||
|         </template> | ||||
|     </data> | ||||
| </openerp> | ||||
|  | @ -1,25 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| import cam_work_order | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
| 
 | ||||
|  | @ -1,40 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| 
 | ||||
| { | ||||
|     'name': 'Camadeus Produktionsschein', | ||||
|     'category': 'Custom',  | ||||
|     'version': '1.0', | ||||
|     'description': """Produktionsschein für die Arbeitsausführung""", | ||||
|     'author': 'camadeus GmbH', | ||||
|     'website': 'http://www.camadeus.at', | ||||
|     'depends': ['sale'], | ||||
|     'data': [          | ||||
|         'cam_work_order_view.xml', | ||||
|         'cam_work_order_data.xml', | ||||
|         'security/ir.model.access.csv', | ||||
|     ], | ||||
|     'installable': True, | ||||
|     'auto_install': False, | ||||
| } | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
|  | @ -1,162 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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 openerp.osv import fields, osv | ||||
| from openerp import api | ||||
| from openerp.tools.translate import _ | ||||
| from openerp import SUPERUSER_ID | ||||
| from openerp import tools | ||||
| from lxml import etree | ||||
|                    | ||||
| class sale_order(osv.osv): | ||||
|     _inherit = 'sale.order' | ||||
|      | ||||
|     _columns = { | ||||
|         'work_order_ids': fields.one2many('work.order','sale_id','Produktionsscheine'), | ||||
|     } | ||||
|      | ||||
|     def action_view_work_order(self, cr, uid, ids, context=None): | ||||
|          | ||||
|         mod_obj = self.pool.get('ir.model.data') | ||||
|         act_obj = self.pool.get('ir.actions.act_window') | ||||
| 
 | ||||
|         result = mod_obj.get_object_reference(cr, uid, 'cam_work_order', 'work_order_action') | ||||
|         id = result and result[1] or False | ||||
|         result = act_obj.read(cr, uid, [id], context=context)[0] | ||||
| 
 | ||||
|         #compute the number of work orders to display | ||||
|         work_ids = [] | ||||
|         for so in self.browse(cr, uid, ids, context=context): | ||||
|             work_ids += [order.id for order in so.work_order_ids] | ||||
|              | ||||
|         #choose the view_mode accordingly | ||||
|         if len(work_ids) > 1: | ||||
|             result['domain'] = "[('id','in',[" + ','.join(map(str, work_ids)) + "])]" | ||||
|         else: | ||||
|             res = mod_obj.get_object_reference(cr, uid, 'cam_custom', 'work_order_form') | ||||
|             result['views'] = [(res and res[1] or False, 'form')] | ||||
|             result['res_id'] = work_ids and work_ids[0] or False | ||||
|         return result     | ||||
|      | ||||
|     def button_work_order(self, cr, uid, ids, context=None): | ||||
|         assert len(ids) == 1 #'This option should only be used for a single id at a time.' | ||||
|         order = self.browse(cr, uid, ids[0], context=context) | ||||
|          | ||||
|         existing_ids = self.pool.get('work.order').search(cr, uid, [('sale_id','=',order.id)]) | ||||
|         if existing_ids: | ||||
|             work_id = existing_ids[0] | ||||
|         else:         | ||||
|             lines = [] | ||||
|             for l in order.order_line: | ||||
|                 line = { | ||||
|                     'name': l.name, | ||||
|                     'qty': l.product_uom_qty, | ||||
|                 } | ||||
|                 lines.append((0,0,line)) | ||||
|                  | ||||
|             vals = { | ||||
|                 'partner_id': order.partner_id.id, | ||||
|                 'sale_id': order.id, | ||||
|                 'line_ids': lines, | ||||
|             }  | ||||
|             work_id = self.pool.get('work.order').create(cr, uid, vals, context=context) | ||||
|         return { | ||||
|             'type': 'ir.actions.act_window', | ||||
|             'name': _('Produktionsschein'), | ||||
|             'res_model': 'work.order', | ||||
|             'res_id': work_id, | ||||
|             'view_type': 'form', | ||||
|             'view_mode': 'form', | ||||
|             'target': 'current', | ||||
|             'nodestroy': True, | ||||
|         } | ||||
| 
 | ||||
| class work_order_line(osv.Model): | ||||
|     _name = 'work.order.line' | ||||
|     _description = 'Arbeitsposition' | ||||
|     _order = 'seq, id' | ||||
|     _columns = { | ||||
|         'seq': fields.integer('Sequenz'), | ||||
|         'name': fields.text('Bezeichnung', size=30, required=True), | ||||
|         'qty': fields.float('Stück'), | ||||
|         'order_id': fields.many2one('work.order', required=True, ondelete='cascade'), | ||||
|     } | ||||
|      | ||||
| class work_order_stage(osv.osv): | ||||
|     _name = "work.order.stage" | ||||
|     _description = "Stage of work order" | ||||
|     _order = "sequence, id" | ||||
| 
 | ||||
|     _columns = { | ||||
|         'name': fields.char('Stage Name', required=True, translate=True), | ||||
|         'sequence': fields.integer('Sequence', help="Used to order stages. Lower is better."), | ||||
|         'fold': fields.boolean('Folded in Kanban View', help='This stage is folded in the kanban view when there are no records in that stage to display.'), | ||||
|     } | ||||
| 
 | ||||
|     _defaults = { | ||||
|         'sequence': 1, | ||||
|         'fold': False, | ||||
|     } | ||||
|      | ||||
| class work_order(osv.Model): | ||||
|     _name = 'work.order' | ||||
|     _description = 'Produktionsschein' | ||||
|     _inherit = ['mail.thread'] | ||||
|      | ||||
|     _columns = { | ||||
|         'name': fields.char('Bezeichnung', size=30, required=True), | ||||
|         'sale_id': fields.many2one('sale.order', 'Verkaufsauftrag', required=True), | ||||
|         'partner_id': fields.many2one('res.partner', 'Kunde', required=True), | ||||
|         'parter_id_street': fields.related('partner_id', 'street', type="char", relation="res.partner", string="Strasse", store=False), | ||||
|         'parter_id_zip': fields.related('partner_id', 'zip', type="char", relation="res.partner", string="Postleitzahl", store=False), | ||||
|         'parter_id_city': fields.related('partner_id', 'city', type="char", relation="res.partner", string="Stadt", store=False), | ||||
|         'user_id': fields.many2one('res.users', 'Bearbeiter'), | ||||
|         'stage_id': fields.many2one('work.order.stage', 'Status', track_visibility='onchange', select=True),         | ||||
|         'date_of_creation': fields.date('Erstellungsdatum'), | ||||
|         'line_ids': fields.one2many('work.order.line', 'order_id', 'Positionen', copy=True), | ||||
|         'work_date': fields.char('Produktionsstermin',size=120), | ||||
|         'work_address': fields.text('Produktionsadresse'), | ||||
|         'graphic_text': fields.text('Anmerkungen'), | ||||
|     } | ||||
|      | ||||
|     def _get_default_stage_id(self, cr, uid, context=None): | ||||
|         """ Gives default stage_id """ | ||||
|         return self.pool.get('work.order.stage').search(cr, uid, [], context=context)[0] | ||||
|      | ||||
|     _defaults = { | ||||
|         'name': '/', | ||||
|         'date_of_creation': fields.date.context_today, | ||||
|         'stage_id': lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c),  | ||||
|     } | ||||
|      | ||||
|     def create(self, cr, uid, vals, context=None): | ||||
|         if context is None: | ||||
|             context = {} | ||||
|         if vals.get('name', '/') == '/': | ||||
|             vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'work.order') or '/' | ||||
|         new_id = super(work_order, self).create(cr, uid, vals, context=context) | ||||
|         return new_id | ||||
|      | ||||
|     def print_quotation(self, cr, uid, ids, context=None): | ||||
|         ''' | ||||
|         This function prints the work order | ||||
|         ''' | ||||
|         return self.pool['report'].get_action(cr, uid, ids, 'cam_reports.report_workorder', context=context)  | ||||
|  | @ -1,49 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <openerp> | ||||
| 	<data noupdate="1"> | ||||
|         <!-- Sequences for work.order --> | ||||
|         <record id="seq_type_work_order" model="ir.sequence.type"> | ||||
|             <field name="name">Work Order</field> | ||||
|             <field name="code">work.order</field> | ||||
|         </record> | ||||
| 
 | ||||
|         <record id="seq_work_order" model="ir.sequence"> | ||||
|             <field name="name">Work Order</field> | ||||
|             <field name="code">work.order</field> | ||||
|             <field name="prefix">PS-</field> | ||||
|             <field name="padding">5</field> | ||||
|             <field name="company_id" eval="False"/> | ||||
|         </record> | ||||
|          | ||||
|         <!-- Status values for work order--> | ||||
|         <record id="work_order_stage_1" model="work.order.stage"> | ||||
|             <field name="name">Neu</field> | ||||
|             <field name="sequence">1</field> | ||||
|             <field name="fold">False</field> | ||||
|         </record> | ||||
| 
 | ||||
|         <record id="work_order_stage_2" model="work.order.stage"> | ||||
|             <field name="name">In Bearbeitung</field> | ||||
|             <field name="sequence">2</field> | ||||
|             <field name="fold">False</field> | ||||
|         </record> | ||||
|          | ||||
|         <record id="work_order_stage_3" model="work.order.stage"> | ||||
|             <field name="name">Bereit für Produktion</field> | ||||
|             <field name="sequence">3</field> | ||||
|             <field name="fold">False</field> | ||||
|         </record> | ||||
|          | ||||
|         <record id="work_order_stage_4" model="work.order.stage"> | ||||
|             <field name="name">Terminisiert</field> | ||||
|             <field name="sequence">4</field> | ||||
|             <field name="fold">False</field> | ||||
|         </record> | ||||
|          | ||||
|         <record id="work_order_stage_5" model="work.order.stage"> | ||||
|             <field name="name">Erledigt</field> | ||||
|             <field name="sequence">5</field> | ||||
|             <field name="fold">False</field> | ||||
|         </record> | ||||
| 	</data> | ||||
| </openerp> | ||||
|  | @ -1,211 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <openerp> | ||||
| 	<data> | ||||
|         	 | ||||
|        <!-- Form Arbeitschein-->	 | ||||
|        <record id="work_order_form" model="ir.ui.view"> | ||||
|             <field name="name">work_order_form</field> | ||||
|             <field name="model">work.order</field> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <form string="Produktionsschein" version="7.0"> | ||||
|                  | ||||
|                 <header> | ||||
|                 	<button name="print_quotation" string="Drucken" type="object"/> | ||||
|                 	<field name="stage_id" widget="statusbar" clickable="True"/> | ||||
|                 </header> | ||||
|                 <sheet> | ||||
|                     <h1> | ||||
|                         <field name="name" class="oe_inline" attrs="{'invisible': [('name','=','/')]}" readonly="1"/> | ||||
|                     </h1> | ||||
|                     <group> | ||||
|                         <group> | ||||
|                             <field name="partner_id" context="{'show_address': 1}" options="{"always_reload": True, "highlight_first_line": True}"/>    | ||||
| 							<field name="user_id"/>                             | ||||
|                         </group> | ||||
|                         <group> | ||||
| 							<field name="date_of_creation"/> | ||||
|                         	<field name="work_date"/>                          | ||||
|                             <field name="work_address"/> | ||||
| 							<field name="sale_id"/>                            | ||||
|                         </group> | ||||
|                     </group> | ||||
|                     <group string="Anmerkungen" colspan="2"> | ||||
|                         <field name="graphic_text" nolabel="1"/> | ||||
|                     </group> | ||||
|                      | ||||
|                     <notebook> | ||||
|                         <page string="Positionen"> | ||||
|                             <field name="line_ids"> | ||||
|                                 <tree editable="top"> | ||||
|                                     <field name="seq" widget="handle"/> | ||||
|                                     <field name="name"/> | ||||
|                                     <field name="qty"/> | ||||
|                                 </tree> | ||||
|                             </field> | ||||
|                          | ||||
|                         </page> | ||||
|                     </notebook> | ||||
|                 </sheet> | ||||
|                 <div class="oe_chatter"> | ||||
|                     <field name="message_follower_ids" widget="mail_followers"/> | ||||
|                     <field name="message_ids" widget="mail_thread"/> | ||||
|                 </div> | ||||
|                 </form> | ||||
|             </field> | ||||
|         </record> | ||||
|          | ||||
|         <!-- Arbeitschein Kanban --> | ||||
|         <record id="work_order_kanban" model="ir.ui.view"> | ||||
|             <field name="name">work_order_kanban</field> | ||||
|             <field name="model">work.order</field> | ||||
|             <field name="type">kanban</field> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <kanban default_group_by="stage_id"> | ||||
|                     <templates> | ||||
|                         <t t-name="kanban-box"> | ||||
|                             <div t-attf-class="oe_kanban_card oe_kanban_global_click"> | ||||
|                                 <div class="oe_dropdown_toggle oe_dropdown_kanban"> | ||||
|                                     <span class="oe_e">í</span> | ||||
|                                     <ul class="oe_dropdown_menu"> | ||||
|                                         <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t> | ||||
|                                         <t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t> | ||||
|                                     </ul> | ||||
|                                 </div> | ||||
|                                 <div class="oe_kanban_content"> | ||||
|                                     <div> | ||||
|                                         <b><field name="name"/></b> | ||||
|                                     </div> | ||||
|                                     <div> | ||||
|                                         <field name="partner_id"/><br/> | ||||
|                                          <field name="parter_id_street"/><br/> | ||||
| 										 <field name="parter_id_zip"/> <field name="parter_id_city"/>                                        | ||||
|                                     </div>  | ||||
|                                     <div> | ||||
|                                         <i><field name="work_date"/></i> | ||||
|                                     </div> | ||||
|                                 </div> | ||||
|                                 <div class="oe_clear"></div> | ||||
|                             </div> | ||||
|                         </t> | ||||
|                     </templates> | ||||
|                 </kanban> | ||||
|             </field> | ||||
|         </record>    | ||||
|         | ||||
|        <!-- Arbeitschein Search -->   | ||||
|        <record id="work_order_search" model="ir.ui.view"> | ||||
|             <field name="name">work_order_search</field> | ||||
|             <field name="model">work.order</field> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <search string="Produktionsschein"> | ||||
|                     <field name="name"/> | ||||
|                     <field name="partner_id"/> | ||||
|                     <field name="user_id"/> | ||||
|                     <separator/> | ||||
|                     <group expand="0" string="Group By"> | ||||
|                         <filter string="Kunden" domain="[]" context="{'group_by':'partner_id'}"/> | ||||
|                         <filter string="Bearbeiter" domain="[]" context="{'group_by':'user_id'}"/> | ||||
| 						<filter string="Status" domain="[]" context="{'group_by':'stage_id'}"/>                         | ||||
|                     </group> | ||||
|              </search> | ||||
|             </field> | ||||
|         </record> | ||||
|          | ||||
|        <!-- Arbeitschein Tree -->   | ||||
|        <record id="work_order_tree" model="ir.ui.view"> | ||||
|             <field name="name">work_order_tree</field> | ||||
|             <field name="model">work.order</field> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <tree string="Produktionsschein"> | ||||
|                         <field name="name"/> | ||||
|                         <field name="partner_id"/> | ||||
|                         <field name="sale_id"/> | ||||
|                         <field name="user_id"/> | ||||
|                         <field name="stage_id"/> | ||||
|                </tree> | ||||
|             </field> | ||||
|         </record> | ||||
|         | ||||
|        <!-- Action Arbeitsschein --> | ||||
|        <record id="work_order_action" model="ir.actions.act_window"> | ||||
|             <field name="name">Produktionsscheine</field> | ||||
|             <field name="type">ir.actions.act_window</field> | ||||
|             <field name="res_model">work.order</field> | ||||
|             <field name="view_type">form</field> | ||||
| 			<field name="view_mode">kanban,tree,form</field> | ||||
| 			<field name="help" type="html">            	 | ||||
|               <p class="oe_view_nocontent_create"> | ||||
|                 Hier klicken um einen neuen Produktionsschein zu erstellen. | ||||
|               </p><p> | ||||
|                 Verwaltung von Produktionsscheinen. | ||||
|               </p> | ||||
|             </field>             | ||||
|         </record> | ||||
|          | ||||
|        <!-- Form Arbeitschein Status -->	 | ||||
|        <record id="work_order_stages_form" model="ir.ui.view"> | ||||
|             <field name="name">work_order_stages_form</field> | ||||
|             <field name="model">work.order.stage</field> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <form string="Status" version="7.0"> | ||||
| 	                <header/> | ||||
| 	                <sheet> | ||||
| 	                    <h1> | ||||
| 	                        <field name="name" class="oe_inline"/> | ||||
| 	                    </h1> | ||||
| 	                    <group> | ||||
| 	                        <group> | ||||
| 								<field name="sequence"/>                             | ||||
| 	                        </group> | ||||
| 	                        <group> | ||||
| 								<field name="fold"/> | ||||
| 	                        </group> | ||||
| 	                    </group> | ||||
| 	                </sheet> | ||||
|                 </form> | ||||
|             </field> | ||||
|         </record>         | ||||
|          | ||||
|         <!-- Action Arbeitsschein Status --> | ||||
|        <record id="work_order_stages_action" model="ir.actions.act_window"> | ||||
|             <field name="name">Status</field> | ||||
|             <field name="type">ir.actions.act_window</field> | ||||
|             <field name="res_model">work.order.stage</field> | ||||
|             <field name="view_type">form</field> | ||||
| 			<field name="view_mode">tree,form</field> | ||||
| 			<field name="help" type="html">            	 | ||||
|               <p class="oe_view_nocontent_create"> | ||||
|                 Hier klicken um einen neuen Status für Produktionsschein zu erstellen. | ||||
|               </p><p> | ||||
|                 Verwaltung von Status von Produktionsscheinen. | ||||
|               </p> | ||||
|             </field>             | ||||
|         </record>         | ||||
|          | ||||
|         <!-- Menüeinträge --> | ||||
|         <menuitem id="work_order_main" name="Produktionsscheine" sequence="21"/> | ||||
|         <menuitem id="work_order_sub" parent="work_order_main" name="Produktionsscheine" sequence="10"/> | ||||
| 		<menuitem id="work_config" parent="work_order_main" name="Konfiguration" sequence="50"/>         | ||||
|          | ||||
|         <menuitem action="work_order_action" id="work_order_menu" parent="work_order_sub" sequence="10"/> | ||||
| 		<menuitem action="work_order_stages_action" id="work_stages_menu" parent="work_config" sequence="10"/>         | ||||
|          | ||||
|         <!--  Adaption for Sale order --> | ||||
|         <record id="view_order_work_form" model="ir.ui.view"> | ||||
|             <field name="name">view_order_work_form</field> | ||||
|             <field name="model">sale.order</field> | ||||
|             <field name="inherit_id" ref="sale.view_order_form"/> | ||||
|             <field name="arch" type="xml">  | ||||
|                 <button string="Create Invoice" position="after"> | ||||
|                     <field name="work_order_ids" invisible="1"/> | ||||
|                     <button name="action_view_work_order" string="Zeige Produktionsschein" type="object" class="oe_highlight" | ||||
|                             attrs="{'invisible': ['|',('work_order_ids','=',False),('work_order_ids','=',[])]}" groups="base.group_user"/> | ||||
|                     <button name="button_work_order" string="Erzeuge Produktionsschein" type="object" class="oe_highlight"  | ||||
|                     		attrs="{'invisible': ['|',('state','not in',['manual','progress']),('work_order_ids','!=',[])]}"/>  | ||||
|                 </button> | ||||
|             </field>                 | ||||
|             <field name="priority">17</field>              | ||||
|         </record>         	 | ||||
|         	 | ||||
| 	</data> | ||||
| </openerp> | ||||
|  | @ -1,5 +0,0 @@ | |||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||||
| modify_work_order,modify_order_sale_user,model_work_order,base.group_sale_salesman,1,1,1,1 | ||||
| modify_work_order_line,modify_order_line_sale_user,model_work_order_line,base.group_sale_salesman,1,1,1,1 | ||||
| access_work_category,work_category_user,model_work_category,base.group_sale_salesman,1,0,0,0 | ||||
| modify_work_category,work_category_manager,model_work_category,base.group_sale_manager,1,1,1,1 | ||||
| 
 | 
| Before Width: | Height: | Size: 2.8 KiB | 
							
								
								
									
										2
									
								
								ext/custom-addons/cam_max_width/__init__.py → ext/custom-addons/dp_custom/__init__.py
								
								
								
								
									
									
									Executable file → Normal file
								
							
							
						
						|  | @ -19,5 +19,7 @@ | |||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| import models | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
| 
 | ||||
|  | @ -1,8 +1,8 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.at>). | ||||
| #    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 | ||||
|  | @ -21,17 +21,16 @@ | |||
| 
 | ||||
| 
 | ||||
| { | ||||
|     'name': 'Camadeus Anpassungen', | ||||
|     'name': 'datenpol Anpassungen', | ||||
|     'category': 'Custom',  | ||||
|     'version': '1.0', | ||||
|     'description': """Individuelle Anpassungen""", | ||||
|     'author': 'camadeus GmbH', | ||||
|     'website': 'http://www.camadeus.at', | ||||
|     'depends': ['sale','mail','product','account','knowledge'], | ||||
|     'data': [          | ||||
|         'cam_custom_view.xml', | ||||
|         'cam_custom_data.xml', | ||||
|         'views/custom_theme.xml', | ||||
|     'author': 'datenpol gmbh', | ||||
|     'website': 'http://www.datenpol.at', | ||||
|     'depends': ['base'], | ||||
|     'data': [ | ||||
|         'data/dp_custom_data.xml', | ||||
|         'views/dp_custom_view.xml', | ||||
|         'security/ir.model.access.csv', | ||||
|     ],   | ||||
|     'installable': True, | ||||
|  | @ -0,0 +1,127 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <openerp> | ||||
| 	<data noupdate="0"> | ||||
| 	 | ||||
| 	 | ||||
| 		<!--  UNITS --> | ||||
| 
 | ||||
| 		<!-- Einheit in Stück umbenennen --> | ||||
| 		<record id="product.product_uom_unit" model="product.uom"> | ||||
|             <field name="name">Stück</field> | ||||
|         </record> | ||||
| 		<!-- 100 Stk. --> | ||||
|         <record id="product_uom_unit_100" model="product.uom"> | ||||
|             <field name="category_id" ref="product.product_uom_categ_unit"/> | ||||
|             <field name="name">100 Stk.</field> | ||||
|             <field name="factor_inv" eval="100"/> | ||||
|             <field name="uom_type">bigger</field> | ||||
|         </record> | ||||
| 		<!-- 1000 Stk. --> | ||||
|         <record id="product_uom_unit_1000" model="product.uom"> | ||||
|             <field name="category_id" ref="product.product_uom_categ_unit"/> | ||||
|             <field name="name">1000 Stk.</field> | ||||
|             <field name="factor_inv" eval="1000"/> | ||||
|             <field name="uom_type">bigger</field> | ||||
|         </record> | ||||
| 
 | ||||
| 		<!-- Rolle --> | ||||
|         <record id="product_uom_rolle" model="product.uom"> | ||||
|             <field name="category_id" ref="product.product_uom_categ_unit"/> | ||||
|             <field name="name">Rolle(n)</field> | ||||
|         </record> | ||||
| 
 | ||||
| 		<!-- Satz --> | ||||
|         <record id="product_uom_satz" model="product.uom"> | ||||
|             <field name="category_id" ref="product.product_uom_categ_unit"/> | ||||
|             <field name="name">Satz</field> | ||||
|         </record> | ||||
| 
 | ||||
| 		<!-- Arbeitstag --> | ||||
|         <record id="product_uom_arbeitstag" model="product.uom"> | ||||
|             <field name="category_id" ref="product.uom_categ_wtime"/> | ||||
|             <field name="name">Arbeitstag</field> | ||||
|         </record> | ||||
| 
 | ||||
| 	 | ||||
| 		<!-- MM --> | ||||
|         <record id="product_uom_mm" model="product.uom"> | ||||
|             <field name="category_id" ref="product.uom_categ_length"/> | ||||
|             <field name="name">mm</field> | ||||
|             <field name="factor" eval="0.001"/> | ||||
|             <field name="uom_type">smaller</field> | ||||
|         </record> | ||||
|          | ||||
| 		<!-- M2 Quadratmeter Category--> | ||||
|         <record id="uom_categ_m2" model="product.uom.categ"> | ||||
|             <field name="name">Quadratm.</field> | ||||
|         </record> | ||||
| 		<!-- M2, Quadratmeter --> | ||||
| 		<record id="product_uom_m2" model="product.uom"> | ||||
| 		    <field name="name">m²</field> | ||||
| 		    <field name="category_id" ref="uom_categ_m2"/> | ||||
| 		    <field name="factor" eval="1.0"/> | ||||
| 		    <field name="rounding" eval="1"/> | ||||
| 		</record> | ||||
| 
 | ||||
| 		<!-- M3 Quadratmeter Category--> | ||||
|         <record id="uom_categ_m3" model="product.uom.categ"> | ||||
|             <field name="name">Kubikm.</field> | ||||
|         </record> | ||||
| 		<!-- M3, Kubikmeter --> | ||||
| 		<record id="product_uom_m3" model="product.uom"> | ||||
| 		    <field name="name">Kubikm.</field> | ||||
| 		    <field name="category_id" ref="uom_categ_m3"/> | ||||
| 		    <field name="factor" eval="1.0"/> | ||||
| 		    <field name="rounding" eval="1"/> | ||||
| 		</record> | ||||
| 
 | ||||
| 		<!-- PKG -->		 | ||||
| 		<record id="product_uom_pkt" model="product.uom"> | ||||
| 		    <field name="name">Paket(e)</field> | ||||
| 		    <field name="category_id" ref="product.product_uom_categ_unit"/> | ||||
| 		    <field name="factor" eval="1.0"/> | ||||
| 		    <field name="rounding" eval="1"/> | ||||
| 		</record> | ||||
| 
 | ||||
| 		<!-- Paar -->		 | ||||
| 		<record id="product_uom_paar" model="product.uom"> | ||||
| 		    <field name="name">Paar(e)</field> | ||||
| 		    <field name="category_id" ref="product.product_uom_categ_unit"/> | ||||
| 		    <field name="factor" eval="1.0"/> | ||||
| 		    <field name="rounding" eval="1"/> | ||||
| 		</record> | ||||
| 
 | ||||
| 		<!-- Minuten --> | ||||
|         <record id="product_uom_min" model="product.uom"> | ||||
|             <field name="category_id" ref="product.uom_categ_wtime"/> | ||||
|             <field name="name">min</field> | ||||
|         </record> | ||||
|          | ||||
|          | ||||
|         <!-- Variantenattribut Größe --> | ||||
|         <record id="prod_attr_size" model="product.attribute"> | ||||
|         	<field name="name">Größe</field> | ||||
| 		    <field name="type">radio</field> | ||||
| 		    <field name="sequence" eval="10"/> | ||||
|         </record> | ||||
|          | ||||
|          | ||||
|         <!-- Verpackungseiheiten --> | ||||
|         <!-- TODO Rolle type in product_ul selection ergänzen --> | ||||
|         <!-- Ausprägungen hier...? --> | ||||
|         <!-- <record id="product_ul_box" model="product.ul"> | ||||
|             <field name="name">Box</field> | ||||
|             <field name="type">box</field> | ||||
|         </record> --> | ||||
|         <!--  | ||||
|         'name' : fields.char('Name', select=True, required=True, translate=True), | ||||
|         'type' : fields.selection([('unit','Unit'),('pack','Pack'),('box', 'Box'), ('pallet', 'Pallet')], 'Type', required=True), | ||||
|         'height': fields.float('Height', help='The height of the package'), | ||||
|         'width': fields.float('Width', help='The width of the package'), | ||||
|         'length': fields.float('Length', help='The length of the package'), | ||||
|         'weight': fields.float('Empty Package Weight'), --> | ||||
|          | ||||
|          | ||||
|         | ||||
| 	</data> | ||||
| </openerp> | ||||
|  | @ -6,8 +6,8 @@ | |||
| 
 | ||||
| msgid "" | ||||
| msgstr "" | ||||
| "Project-Id-Version: camadeus\n" | ||||
| "Report-Msgid-Bugs-To: Andreas Brueckl <andreas.brueckl@camadeus.at>\n" | ||||
| "Project-Id-Version: datenpol\n" | ||||
| "Report-Msgid-Bugs-To: Andreas Brueckl <andreas.brueckl@datenpol.at>\n" | ||||
| "POT-Creation-Date: 2014-09-23 16:26+0000\n" | ||||
| "PO-Revision-Date: 2014-08-14 16:14+0000\n" | ||||
| "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||||
|  | @ -18,8 +18,3 @@ msgstr "" | |||
| "X-Launchpad-Export-Date: 2014-09-24 09:44+0000\n" | ||||
| "X-Generator: Launchpad (build 17196)\n" | ||||
| 
 | ||||
| #. module: cam_custom | ||||
| #: field:product.product,default_code:0 | ||||
| #: field:product.template,default_code:0 | ||||
| msgid "Internal Reference" | ||||
| msgstr "Artikelnummer" | ||||
|  | @ -2,7 +2,7 @@ | |||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.at>). | ||||
| #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). | ||||
| # | ||||
| #    This program is free software: you can redistribute it and/or modify | ||||
| #    it under the terms of the GNU Affero General Public License as | ||||
|  | @ -19,7 +19,8 @@ | |||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| import cam_custom | ||||
| import ir_ui_menu | ||||
| 
 | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
| 
 | ||||
|  | @ -0,0 +1,54 @@ | |||
| # -*- 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 openerp import fields, models | ||||
| from openerp import api | ||||
| from openerp.tools.translate import _ | ||||
| from openerp import SUPERUSER_ID | ||||
| from openerp import tools | ||||
| from lxml import etree | ||||
| 
 | ||||
| DISABLED_MENUS = [ | ||||
| ] | ||||
| 
 | ||||
| class ir_ui_menu(models.Model): | ||||
|     _inherit = 'ir.ui.menu' | ||||
|      | ||||
|     @tools.ormcache(skiparg=2) | ||||
|     def get_disabled_menu_ids(self, cr, uid, context=None): | ||||
|         data_obj = self.pool.get('ir.model.data') | ||||
|           | ||||
|         menu_ids = [] | ||||
|         for menu in DISABLED_MENUS: | ||||
|             module,xml_id = menu.split('.') | ||||
|             menu = data_obj.get_object(cr, uid, module, xml_id) | ||||
|             if menu: | ||||
|                 menu_ids.append(menu.id) | ||||
|         return menu_ids   | ||||
| 
 | ||||
|     def _filter_visible_menus(self, cr, uid, ids, context=None):  | ||||
|         if uid != 1:        | ||||
|             disabled_ids = self.get_disabled_menu_ids(cr, uid) | ||||
|               | ||||
|             ids = [id for id in ids if id not in disabled_ids] | ||||
|   | ||||
|         ids = super(ir_ui_menu, self)._filter_visible_menus(cr, uid, ids, context) | ||||
|         return ids | ||||
|  | @ -0,0 +1,2 @@ | |||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||||
| 
 | ||||
| 
 | 
| After Width: | Height: | Size: 2.2 KiB | 
| After Width: | Height: | Size: 26 KiB | 
| After Width: | Height: | Size: 2.2 KiB | 
|  | @ -1,5 +1,10 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <openerp> | ||||
| 	<data> | ||||
| 
 | ||||
| 
 | ||||
| 	</data> | ||||
| </openerp> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  | @ -0,0 +1,3 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| from . import models | ||||
|  | @ -0,0 +1,23 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| { | ||||
|     'name': 'datepol Report Anpassungen', | ||||
|     'category': 'Custom', | ||||
|     'version': '1.0', | ||||
|     'summary': """Individuelle Report Anpassungen""", | ||||
|     'description': """Individuelle Report Anpassungen""", | ||||
|     'author': 'datenpol gmbh', | ||||
|     'website': 'http://www.datenpol.at', | ||||
|     'depends': ['base'], | ||||
|     'data': [ | ||||
|         # 'security/ir.model.access.csv', | ||||
|         'views/layouts.xml', | ||||
|         'views/saleorder.xml', | ||||
|         'views/invoice.xml', | ||||
|         'views/delivery.xml', | ||||
|     ], | ||||
|     # only loaded in demonstration mode | ||||
|     'demo': [], | ||||
|     'installable': True, | ||||
|     'auto_install': False, | ||||
| } | ||||
|  | @ -0,0 +1,19 @@ | |||
| # Translation of Odoo Server. | ||||
| # This file contains the translation of the following modules: | ||||
| # * dp_report | ||||
| #  | ||||
| msgid "" | ||||
| msgstr "" | ||||
| "Project-Id-Version: Odoo 10.0\n" | ||||
| "Report-Msgid-Bugs-To: \n" | ||||
| "POT-Creation-Date: 2015-10-12 09:17+0000\n" | ||||
| "PO-Revision-Date: 2016-10-13 11:58+0000\n" | ||||
| "Last-Translator: datenpol\n" | ||||
| "Language-Team: German (http://www.transifex.com/odoo/odoo-9/language/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" | ||||
| 
 | ||||
| 
 | ||||
|  | @ -0,0 +1 @@ | |||
| # -*- coding: utf-8 -*- | ||||
|  | @ -0,0 +1,75 @@ | |||
| <openerp> | ||||
|     <data> | ||||
|         <!-- Delivery Body --> | ||||
|         <template id="report_delivery_document" inherit_id="delivery.report_delivery_document2"> | ||||
|             <h2 position="replace"> | ||||
|                 <h2> | ||||
|                     LIEFERSCHEIN <span t-field="o.name"/> | ||||
|                 </h2> | ||||
|             </h2> | ||||
|             <table class="table table-condensed" position="replace"> | ||||
|                 <table class="table table-condensed"> | ||||
|                     <thead> | ||||
|                         <tr> | ||||
|                             <th name="td_sched_date_h"><strong>Scheduled Date</strong></th> | ||||
|                             <th><strong>Weight</strong></th> | ||||
|                         </tr> | ||||
|                     </thead> | ||||
|                     <tbody> | ||||
|                         <tr> | ||||
|                             <td name="td_sched_date"> | ||||
|                                <span t-field="o.min_date"/> | ||||
|                             </td> | ||||
|                             <td> | ||||
|                                 <span t-field="o.weight"/> kg | ||||
|                             </td> | ||||
|                         </tr> | ||||
|                     </tbody> | ||||
|                 </table> | ||||
|             </table> | ||||
|             <xpath expr="//table[@t-if='not o.pack_operation_ids']/thead" position="replace"> | ||||
|                 <thead> | ||||
|                     <tr> | ||||
|                         <th><strong>Product</strong></th> | ||||
|                         <th><strong>Location</strong></th> | ||||
|                         <th class="text-right"><strong>Quantity</strong></th> | ||||
|                     </tr> | ||||
|                 </thead> | ||||
|             </xpath> | ||||
|             <xpath expr="//table[@t-if='not o.pack_operation_ids']/tbody/tr/td/span[@t-field='move.state']" position="replace"/> | ||||
|             <xpath expr="//table[@t-if='o.pack_operation_ids']/thead" position="replace"> | ||||
|                 <thead> | ||||
|                     <tr> | ||||
|                         <th><strong>Product</strong></th> | ||||
|                         <th t-if="has_serial_number"><strong>Serial Number</strong></th> | ||||
|                         <th><strong>Location</strong></th> | ||||
|                         <th class="text-right"><strong>Quantity</strong></th> | ||||
|                     </tr> | ||||
|                 </thead> | ||||
|             </xpath> | ||||
|             <xpath expr="//table[@t-if='o.pack_operation_ids']/tbody/tr/td[2]" position="replace"/> | ||||
|         </template> | ||||
|         <!-- Render Report with Header --> | ||||
|         <template id="stock.report_deliveryslip"> | ||||
|             <t t-set="header" t-value="1"/> | ||||
|             <t t-foreach="docs" t-as="o"> | ||||
|                 <t t-call="dp_report.report_delivery_document" t-lang="o.partner_id.lang"/> | ||||
|             </t> | ||||
|         </template> | ||||
|         <!-- Render Report without Header --> | ||||
|         <template id="report_deliveryslip_blank"> | ||||
|             <t t-set="header" t-value="0"/> | ||||
|             <t t-foreach="docs" t-as="o"> | ||||
|                 <t t-call="dp_report.report_delivery_document" t-lang="o.partner_id.lang"/> | ||||
|             </t> | ||||
|         </template> | ||||
|         <!-- Create new Report --> | ||||
|         <report id="dp_report_deliveryslip_blank" | ||||
|             string="Lieferschein Ohne Logo" | ||||
|             model="stock.picking" | ||||
|             report_type="qweb-pdf" | ||||
|             name="dp_report.report_deliveryslip_blank" | ||||
|             file="dp_report.report_deliveryslip_blank"/> | ||||
| 
 | ||||
|     </data> | ||||
| </openerp> | ||||
|  | @ -0,0 +1,65 @@ | |||
| <openerp> | ||||
|     <data> | ||||
|         <!-- Invoice Body --> | ||||
|         <template id="report_invoice_document" inherit_id="account.report_invoice_document"> | ||||
|             <th t-if="display_discount" position="replace"> | ||||
|                 <th t-if="display_discount and o.sale_order_id.print_discount" class="text-right" groups="sale.group_discount_per_so_line">Disc.(%)</th> | ||||
|             </th> | ||||
|             <td t-if="display_discount" position="replace"> | ||||
|                 <td t-if="display_discount and o.sale_order_id.print_discount" class="text-right" groups="sale.group_discount_per_so_line"> | ||||
|                     <span t-field="l.discount"/> | ||||
|                 </td> | ||||
|             </td> | ||||
|             <div t-if="o.date_invoice" position="replace"> | ||||
|                 <div class="col-xs-2" t-if="o.date_invoice"> | ||||
|                     <strong>Invoice Date:</strong> | ||||
|                     <p t-field="o.date_invoice"/> | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div t-if="o.origin" position="replace"> | ||||
|                 <div class="col-xs-2" t-if="o.origin"> | ||||
|                     <strong>Source:</strong> | ||||
|                     <p t-field="o.origin"/> | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div t-if="o.date_due and o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')" position="replace"/> | ||||
|             <xpath expr="//table[@class='table table-condensed']/thead/tr/th" position='replace'> | ||||
|                 <th>Description</th> | ||||
|             </xpath> | ||||
|             <div t-if="o.tax_line_ids" position="replace"/> | ||||
|             <p t-if="o.payment_term_id" position="replace"> | ||||
|                 <p t-if="o.payment_term_id"> | ||||
|                     <strong><span t-field="o.payment_term_id.note"/></strong> | ||||
|                 </p> | ||||
|             </p> | ||||
|         </template> | ||||
|         <!-- Render Report with Header --> | ||||
|         <template id="account.report_invoice"> | ||||
|             <t t-call="report.html_container"> | ||||
|                 <t t-set="header" t-value="1"/> | ||||
|                 <t t-foreach="docs" t-as="o"> | ||||
|                     <t t-call="dp_report.report_invoice_document" t-lang="o.partner_id.lang"> | ||||
|                     </t> | ||||
|                 </t> | ||||
|             </t> | ||||
|         </template> | ||||
|         <!-- Render Report without Header --> | ||||
|         <template id="report_invoice_blank"> | ||||
|             <t t-call="report.html_container"> | ||||
|                 <t t-set="header" t-value="0"/> | ||||
|                 <t t-foreach="docs" t-as="o"> | ||||
|                     <t t-call="dp_report.report_invoice_document" t-lang="o.partner_id.lang"> | ||||
|                     </t> | ||||
|                 </t> | ||||
|             </t> | ||||
|         </template> | ||||
|         <!-- Create new Report --> | ||||
|         <report id="dp_report_invoice_blank" | ||||
|             string="Rechnung Ohne Logo" | ||||
|             model="account.invoice" | ||||
|             report_type="qweb-pdf" | ||||
|             name="dp_report.report_invoice_blank" | ||||
|             file="dp_report.report_invoice_blank"/> | ||||
| 
 | ||||
|     </data> | ||||
| </openerp> | ||||
|  | @ -0,0 +1,58 @@ | |||
| <openerp> | ||||
|     <data> | ||||
|         <template id="report.external_layout"> | ||||
|             <!-- Multicompany --> | ||||
|             <t t-if="not o and doc"> | ||||
|                 <t t-set="o" t-value="doc"/> | ||||
|             </t> | ||||
|             <t t-if="o and 'company_id' in o"> | ||||
|                 <t t-set="company" t-value="o.company_id"></t> | ||||
|             </t> | ||||
|             <t t-if="not o or not 'company_id' in o"> | ||||
|                 <t t-set="company" t-value="res_company"></t> | ||||
|             </t> | ||||
|             <t t-if="header == 1"> | ||||
|                 <t t-call="dp_report.external_layout_header" /> | ||||
|             </t> | ||||
|             <t t-if="header == 0"> | ||||
|                 <t t-call="dp_report.external_layout_header_blank" /> | ||||
|             </t> | ||||
|             <t t-raw="0" /> | ||||
|             <t t-call="report.external_layout_footer" /> | ||||
|             <t t-esc="header"/> | ||||
|         </template> | ||||
| 
 | ||||
|         <!-- Report Header Full --> | ||||
|         <template id="external_layout_header"> | ||||
|             <div class="header"> | ||||
|                 <div class="row"> | ||||
|                     <div class="col-xs-3" name="company_address"> | ||||
|                         <div t-field="company.partner_id" | ||||
|                             t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' | ||||
|                             style="border-bottom: 1px solid black;"/> | ||||
|                     </div> | ||||
|                     <div class="col-xs-9 text-right"> | ||||
|                         <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 105px;"/> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </template> | ||||
| 
 | ||||
|         <!-- Report Header Blank --> | ||||
|         <template id="external_layout_header_blank"> | ||||
|     	    <div class="header"> | ||||
|                 <div class="row"> | ||||
|                     <div class="col-xs-12" style="height: 45px;"> | ||||
|                     </div> | ||||
|                 </div> | ||||
|                 <div class="row"> | ||||
|                     <div class="col-xs-3" name="company_address"> | ||||
|                         <div t-field="company.partner_id" | ||||
|                             t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' | ||||
|                             style="border-bottom: 1px solid black;"/> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </template> | ||||
|     </data> | ||||
| </openerp> | ||||
|  | @ -0,0 +1,85 @@ | |||
| <openerp> | ||||
|     <data> | ||||
|         <!-- Sale Order Body --> | ||||
|         <template id="report_saleorder_document" inherit_id="sale.report_saleorder_document"> | ||||
|             <th t-if="display_discount" position="replace"> | ||||
|                 <th t-if="display_discount and doc.print_discount" class="text-right" groups="sale.group_discount_per_so_line">Disc.(%)</th> | ||||
|             </th> | ||||
|             <td t-if="display_discount" position="replace"> | ||||
|                 <td t-if="display_discount and doc.print_discount" class="text-right" groups="sale.group_discount_per_so_line"> | ||||
|                     <span t-field="l.discount"/> | ||||
|                 </td> | ||||
|             </td> | ||||
| 
 | ||||
|             <xpath expr="//div[@class='page']/h2" position='replace'> | ||||
|                 <h2> | ||||
|                     <span t-if="doc.state not in ['draft','sent']">Order # </span> | ||||
|                     <span t-if="doc.state in ['draft','sent']">Quotation # </span> | ||||
|                     <span t-field="doc.name"/> | ||||
|                 </h2> | ||||
|             </xpath> | ||||
| 
 | ||||
|             <xpath expr="//div[@t-if='doc.user_id.name']" position='replace'/> | ||||
|             <xpath expr="//div[@name='payment_term']" position='attributes'> | ||||
|                 <attribute name="style">display:none</attribute> | ||||
|             </xpath> | ||||
|             <div name="total" position="replace"> | ||||
|                 <div class="row" name="total"> | ||||
|                     <div class="col-xs-4 pull-right"> | ||||
|                         <table class="table table-condensed"> | ||||
|                             <tr class="border-black"> | ||||
|                                 <td><strong>Total Without Taxes</strong></td> | ||||
|                                 <td class="text-right"> | ||||
|                                     <span t-field="doc.amount_untaxed" | ||||
|                                         t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/> | ||||
|                                 </td> | ||||
|                             </tr> | ||||
|                             <tr> | ||||
|                                 <td>Taxes</td> | ||||
|                                 <td class="text-right"> | ||||
|                                     <span t-field="doc.amount_tax" | ||||
|                                         t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/> | ||||
|                                 </td> | ||||
|                             </tr> | ||||
|                             <tr class="border-black"> | ||||
|                                 <td><strong>Total</strong></td> | ||||
|                                 <td class="text-right"> | ||||
|                                     <span t-field="doc.amount_total" | ||||
|                                         t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/> | ||||
|                                 </td> | ||||
|                             </tr> | ||||
|                         </table> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </template> | ||||
|         <!-- Render Report with Header --> | ||||
|         <template id="sale.report_saleorder"> | ||||
|             <t t-call="report.html_container"> | ||||
|                 <t t-set="header" t-value="1"/> | ||||
|                 <t t-foreach="docs" t-as="doc"> | ||||
|                     <t t-call="dp_report.report_saleorder_document" t-lang="doc.partner_id.lang"> | ||||
|                     </t> | ||||
|                 </t> | ||||
|             </t> | ||||
|         </template> | ||||
|         <!-- Render Report without Header --> | ||||
|         <template id="report_saleorder_blank"> | ||||
|             <t t-call="report.html_container"> | ||||
|                 <t t-set="header" t-value="0"/> | ||||
|                 <t t-foreach="docs" t-as="doc"> | ||||
|                     <t t-call="dp_report.report_saleorder_document" t-lang="doc.partner_id.lang"> | ||||
|                     </t> | ||||
|                 </t> | ||||
|             </t> | ||||
|         </template> | ||||
|         <!-- Create new Report --> | ||||
|         <report id="dp_report_saleorder_blank" | ||||
|             string="Angebot / Bestellung Ohne Logo" | ||||
|             model="sale.order" | ||||
|             report_type="qweb-pdf" | ||||
|             name="dp_report.report_saleorder_blank" | ||||
|             file="dp_report.report_saleorder_blank"/> | ||||
| 
 | ||||
|     </data> | ||||
| </openerp> | ||||
|  | @ -1,20 +0,0 @@ | |||
| # mail_follower_control | ||||
| 
 | ||||
| This addon allows better control over follower handling for the chatter view. | ||||
| 
 | ||||
| ## Goals: | ||||
| 
 | ||||
| - Checkbox "Do not automatically add as follower" for res.partner | ||||
| - Set this new Checkbox to True by default | ||||
| - Show the followers and additional recipients that will receive an email (notify always + email) | ||||
| - Show a warning when adding additional recipients if the new recipient will not receive an email | ||||
| - Show followers that will not receive Messages in Red | ||||
| - Write the followers that received an email to mail.message in a new field to view them in message thread views | ||||
| 
 | ||||
| - ToDo: Always show all the followers when writing a message in full message composer | ||||
|     - ToDo: Allow to remove some followers just for the current mail | ||||
| - ToDo: BCC Field for all Chatter E-Mails | ||||
|     - ToDo: Do NOT add BCC Recipients as followers regardless of the checkbox "Do not automatically ad as follower" | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  | @ -1,24 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| import mail_follower_control | ||||
| 
 | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
| 
 | ||||
|  | @ -1,60 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| 
 | ||||
| { | ||||
|     'name': 'Mail Follower Control', | ||||
|     'version': '1.0', | ||||
|     'category': 'Custom', | ||||
|     'author': 'DataDialog, Michael Karrer (original version for v7 by camadeus)', | ||||
|     'website': 'http://www.datadialog.net', | ||||
|     'installable': True, | ||||
|     'description': """ | ||||
| mail_follower_control | ||||
| ===================== | ||||
| 
 | ||||
| This addon allows better control over follower handling for the chatter view. | ||||
| 
 | ||||
| Goals: | ||||
| ------ | ||||
| 
 | ||||
| - Checkbox "Do not automatically add as follower" for res.partner | ||||
| - Set this new Checkbox to True by default | ||||
| - Show the followers and additional recipients that will receive an email (notify always + email) | ||||
| - Show a warning when adding additional recipients if the new recipient will not receive an email | ||||
| - Show followers that will not receive Messages in Red | ||||
| - Write the followers that received an email to mail.message in a new field to view them in message thread views | ||||
| 
 | ||||
| - ToDo: Always show all the followers when writing a message in full message composer | ||||
|     - ToDo: Allow to remove some followers just for the current mail | ||||
| - ToDo: BCC Field for all Chatter E-Mails | ||||
|     - ToDo: Do NOT add BCC Recipients as followers regardless of the checkbox "Do not automatically ad as follower" | ||||
| 
 | ||||
|     """, | ||||
|     'depends': ['web', 'mail'], | ||||
|     'qweb': [ | ||||
|         'views/templates.xml', | ||||
|     ], | ||||
|     'data': [ | ||||
|         'views/views.xml', | ||||
|     ], | ||||
| 
 | ||||
| } | ||||
|  | @ -1,84 +0,0 @@ | |||
| # Translation of Odoo Server. | ||||
| # This file contains the translation of the following modules: | ||||
| #	* mail_follower_control | ||||
| # | ||||
| msgid "" | ||||
| msgstr "" | ||||
| "Project-Id-Version: Odoo Server 8.0\n" | ||||
| "Report-Msgid-Bugs-To: \n" | ||||
| "POT-Creation-Date: 2015-04-29 12:25+0000\n" | ||||
| "PO-Revision-Date: 2015-04-29 12:25+0000\n" | ||||
| "Last-Translator: <>\n" | ||||
| "Language-Team: \n" | ||||
| "MIME-Version: 1.0\n" | ||||
| "Content-Type: text/plain; charset=UTF-8\n" | ||||
| "Content-Transfer-Encoding: \n" | ||||
| "Plural-Forms: \n" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: field:res.partner,no_subscribe:0 | ||||
| msgid "Do not add as Follower automatically" | ||||
| msgstr "Nicht automatisch als Follower hinzufügen" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_mail_thread | ||||
| msgid "Email Thread" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_mail_compose_message | ||||
| msgid "Email composition wizard" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_mail_wizard_invite | ||||
| msgid "Invite wizard" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_mail_message | ||||
| msgid "Message" | ||||
| msgstr "Nachricht" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: view:mail.compose.message:mail_follower_control.mail_message_wizard_form_view | ||||
| #: field:mail.compose.message,follower_ids:0 | ||||
| msgid "Notified by eMail" | ||||
| msgstr "Benachrichtigt per E-Mail" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_mail_mail | ||||
| msgid "Outgoing Mails" | ||||
| msgstr "Ausgehende E-Mails" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_res_partner | ||||
| msgid "Partner" | ||||
| msgstr "Kontakt" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: field:mail.message,notified_by_email_ids:0 | ||||
| msgid "Partners notified by e-mail" | ||||
| msgstr "Benachrichtigt per E-Mail" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: code:addons/mail_follower_control/mail_follower_control.py:261 | ||||
| #, python-format | ||||
| msgid "Some partners will not be notified by e-mail!" | ||||
| msgstr "Einige Kontakte werden nicht per E-Mail benachrichtigt!" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: code:addons/mail_follower_control/mail_follower_control.py:262 | ||||
| #, python-format | ||||
| msgid "The following partners will not be notified by e-mail but they will still get a message in odoo (if they have a login):\n" | ||||
| "\n" | ||||
| "%s" | ||||
| msgstr "Folgende Kontakte werden keine Benachrichtigung per E-Mail bekommen. Diese Kontakte bekommen jedoch zumindest eine Benachrichtigung in Ihren odoo Posteingang sofern sie sich einloggen können.: \n" | ||||
| "\n" | ||||
| "%s" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: view:mail.compose.message:mail_follower_control.mail_message_wizard_form_view | ||||
| msgid "onchange_partner_ids(partner_ids, follower_ids, model, res_id, context)" | ||||
| msgstr "" | ||||
| 
 | ||||
|  | @ -1,82 +0,0 @@ | |||
| # Translation of Odoo Server. | ||||
| # This file contains the translation of the following modules: | ||||
| #	* mail_follower_control | ||||
| # | ||||
| msgid "" | ||||
| msgstr "" | ||||
| "Project-Id-Version: Odoo Server 8.0\n" | ||||
| "Report-Msgid-Bugs-To: \n" | ||||
| "POT-Creation-Date: 2015-04-29 12:25+0000\n" | ||||
| "PO-Revision-Date: 2015-04-29 12:25+0000\n" | ||||
| "Last-Translator: <>\n" | ||||
| "Language-Team: \n" | ||||
| "MIME-Version: 1.0\n" | ||||
| "Content-Type: text/plain; charset=UTF-8\n" | ||||
| "Content-Transfer-Encoding: \n" | ||||
| "Plural-Forms: \n" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: field:res.partner,no_subscribe:0 | ||||
| msgid "Do not add as Follower automatically" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_mail_thread | ||||
| msgid "Email Thread" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_mail_compose_message | ||||
| msgid "Email composition wizard" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_mail_wizard_invite | ||||
| msgid "Invite wizard" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_mail_message | ||||
| msgid "Message" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: view:mail.compose.message:mail_follower_control.mail_message_wizard_form_view | ||||
| #: field:mail.compose.message,follower_ids:0 | ||||
| msgid "Notified by eMail" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_mail_mail | ||||
| msgid "Outgoing Mails" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: model:ir.model,name:mail_follower_control.model_res_partner | ||||
| msgid "Partner" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: field:mail.message,notified_by_email_ids:0 | ||||
| msgid "Partners notified by e-mail" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: code:addons/mail_follower_control/mail_follower_control.py:261 | ||||
| #, python-format | ||||
| msgid "Some partners will not be notified by e-mail!" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: code:addons/mail_follower_control/mail_follower_control.py:262 | ||||
| #, python-format | ||||
| msgid "The following partners will not be notified by e-mail but they will still get a message in odoo (if they have a login):\n" | ||||
| "\n" | ||||
| "%s" | ||||
| msgstr "" | ||||
| 
 | ||||
| #. module: mail_follower_control | ||||
| #: view:mail.compose.message:mail_follower_control.mail_message_wizard_form_view | ||||
| msgid "onchange_partner_ids(partner_ids, follower_ids, model, res_id, context)" | ||||
| msgstr "" | ||||
| 
 | ||||
|  | @ -1,296 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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 openerp.osv import fields, osv | ||||
| from openerp.tools.translate import _ | ||||
| from openerp import SUPERUSER_ID | ||||
| 
 | ||||
| 
 | ||||
| class res_partner(osv.Model): | ||||
|     _inherit = "res.partner" | ||||
| 
 | ||||
|     _columns = { | ||||
|         'no_subscribe': fields.boolean("Do not add as Follower automatically"), | ||||
|     } | ||||
|     _defaults = { | ||||
|         'no_subscribe': True, | ||||
|     } | ||||
|      | ||||
|     def get_partners_notify_by_email(self, cr, uid, ids, message_type, context): | ||||
|         """ Return the list of partners which will be notified per mail, based on their preferences. | ||||
|             :param message_type: type of message | ||||
| 
 | ||||
|         """ | ||||
|         notify_pids = [] | ||||
|         user = self.pool.get('res.users').browse(cr,uid,uid) | ||||
|         for partner in self.browse(cr, uid, ids): | ||||
|             # Do not send to partners without email address defined | ||||
|             if not partner.email: | ||||
|                 continue | ||||
|             # Partner does not want to receive any emails | ||||
|             if partner.notify_email == 'none': | ||||
|                 continue | ||||
| 
 | ||||
|             # Exclude own partner | ||||
|             if partner.email == user.email: | ||||
|                 continue | ||||
| 
 | ||||
|             notify_pids.append(partner.id) | ||||
|         return notify_pids | ||||
| res_partner() | ||||
| 
 | ||||
| 
 | ||||
| class mail_thread(osv.AbstractModel): | ||||
|     _inherit = "mail.thread" | ||||
| 
 | ||||
|     # Add data for JS to mark follower in red that will not receive an email | ||||
|     # | ||||
|     # FULL OVERWRITE of function to add 'notify_email': --> stupid but needed | ||||
|     # (this function will be called by the java script mail_followers.js to get the follower data) | ||||
|     # we need to know notify_email in the qweb template to mark followers in red that will not receive an email | ||||
|     # we alter mail_followers.js in addons-own/mail_follower_control/static/src/js/mail_follower_control.js to add | ||||
|     # notify_email to the display_followers function | ||||
|     def read_followers_data(self, cr, uid, follower_ids, context=None): | ||||
|         result = [] | ||||
|         technical_group = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'group_no_one', context=context) | ||||
|         for follower in self.pool.get('res.partner').browse(cr, uid, follower_ids, context=context): | ||||
|             is_editable = uid in map(lambda x: x.id, technical_group.users) | ||||
|             is_uid = uid in map(lambda x: x.id, follower.user_ids) | ||||
|             data = (follower.id, | ||||
|                     follower.name, | ||||
|                     {'is_editable': is_editable, 'is_uid': is_uid, 'notify_email': follower.notify_email, }, | ||||
|                     ) | ||||
|             result.append(data) | ||||
|         return result | ||||
| 
 | ||||
|     # Do not subscript followers with no_subscribe=True (except force_subscription is in the context) | ||||
|     # | ||||
|     # message_post will call message_subscribe to add followers | ||||
|     # we alter this method to take our new field no_subscribe into account | ||||
|     def message_subscribe(self, cr, uid, ids, partner_ids, subtype_ids=None, context=None): | ||||
|         if context is None: | ||||
|             context = {} | ||||
| 
 | ||||
|         # 1.) Filter all mail_post_autofollow_partner_ids if they exists to respect the no_subscribe setting | ||||
|         if context.get('mail_post_autofollow') and context.get('mail_post_autofollow_partner_ids'): | ||||
|             context['mail_post_autofollow_partner_ids'] = self.pool.get('res.partner').search(cr, uid, [ | ||||
|                 ('no_subscribe', '=', False), | ||||
|                 ('id', 'in', context.get('mail_post_autofollow_partner_ids'), ) | ||||
|             ]) | ||||
|          | ||||
|         # 2.) Filter partner_ids: to respect the no_subscribe setting (except 'force_subscription' is set) | ||||
|         # HINT: force_subscription is set by java script to allow adding a follower with no_subscribe=True by the | ||||
|         #       add followers links in the chatter window - without this the follower could not be added by any method. | ||||
|         if not context.get('force_subscription'): | ||||
|             partner_ids = self.pool.get('res.partner').search(cr, uid, [ | ||||
|                 ('no_subscribe', '=', False), | ||||
|                 ('id', 'in', partner_ids), | ||||
|             ]) | ||||
| 
 | ||||
|         # Remove force_subscription from the context after the filtering is done | ||||
|         if context.get('force_subscription'): | ||||
|             context.pop('force_subscription') | ||||
| 
 | ||||
|         res = super(mail_thread, self).message_subscribe(cr, uid, ids, partner_ids, subtype_ids, context) | ||||
|         return res | ||||
| mail_thread() | ||||
| 
 | ||||
| 
 | ||||
| # Allow to add followers with no_subscribe=True at least with the invite wizard (Add Followers Link) | ||||
| class invite_wizard(osv.osv_memory): | ||||
|     _inherit = 'mail.wizard.invite' | ||||
| 
 | ||||
|     # Add force Subscription to the context so that followers can be added even if no_subscribe=True | ||||
|     def add_followers(self, cr, uid, ids, context=None): | ||||
|         if context is None: | ||||
|             context = {} | ||||
|         context['force_subscription'] = True | ||||
|          | ||||
|         return super(invite_wizard, self).add_followers(cr, uid, ids, context) | ||||
| invite_wizard() | ||||
| 
 | ||||
| 
 | ||||
| class mail_message(osv.Model): | ||||
|     _inherit = "mail.message" | ||||
|     # Add field notified_by_email_ids to store this data from mail.mail if a mail was sent | ||||
|     # WARNING: do not use relation= for old style many2many fields - will be ignored!!!! | ||||
|     # WARNING: always use a custom name for the relation table e.g.: mail_message_res_partner_notified_by_email_rel | ||||
|     #          if you use none the system may generate one that is already in use and both fields will have | ||||
|     #          the related fields - which is very hard to debug. | ||||
|     _columns = { | ||||
|         'notified_by_email_ids': fields.many2many('res.partner', | ||||
|                                                   'mail_message_res_partner_notified_by_email_rel', | ||||
|                                                   'mail_message_id', 'res_partner_id', | ||||
|                                                   string='Partners notified by e-mail'), | ||||
|     } | ||||
| 
 | ||||
|     # Update Dict for JS rendering of messages with field notified_by_email_ids | ||||
|     # HINT: _message_read_dict returns a dict representation of the message. This representation is | ||||
|     #       used in the JS client code, to display the messages. Partners and | ||||
|     #       attachments related stuff will be done in post-processing in batch. | ||||
|     def _message_read_dict(self, cr, uid, message, parent_id=False, context=None): | ||||
|         res = super(mail_message, self)._message_read_dict(cr, uid, message, parent_id, context) | ||||
| 
 | ||||
|         # ToDo: Create a dict wich holds name and id for each id in ids (partner) - needed in template! | ||||
|         vals = {'notified_by_email_ids': [[p.id, p.name] for p in message.notified_by_email_ids]} | ||||
|         # print 'vals: %s' % vals | ||||
|         res.update(vals) | ||||
|         return res | ||||
| 
 | ||||
| mail_message() | ||||
| 
 | ||||
| 
 | ||||
| # Check Receipients while composing a mail (Full composing dialog not quick dialogue) and give a warning | ||||
| # if the added recipients will not receive an e-mail by setting | ||||
| class mail_compose_message(osv.TransientModel): | ||||
|     _inherit = "mail.compose.message" | ||||
| 
 | ||||
|     _columns = { | ||||
|         'follower_ids': fields.many2many('res.partner', | ||||
|                                          'mail_compose_message_followers_rel', | ||||
|                                          'wizard_id', | ||||
|                                          'partner_id', | ||||
|                                          string='Notified by eMail', readonly=True), | ||||
|     } | ||||
| 
 | ||||
|     # This will recalculate/set the field follower_ids for the current mail_compose_message (which is a transient model | ||||
|     # so its not a problem to recalculate it here on the fly) | ||||
|     def get_record_data(self, cr, uid, values, context=None): | ||||
| 
 | ||||
|         res = super(mail_compose_message, self).get_record_data(cr, uid, values, context) | ||||
| 
 | ||||
|         # if this message belongs to a resource add follower ids that will receieve an email to the result dict | ||||
|         if values.get('model') and values.get('res_id'): | ||||
|             p_obj = self.pool.get('res.partner') | ||||
|             fol_obj = self.pool.get("mail.followers") | ||||
| 
 | ||||
|             # get all followers for the current resource (= model and res_id) | ||||
|             fol_ids = fol_obj.search(cr, SUPERUSER_ID, [ | ||||
|                     ('res_model', '=', values.get('model')), | ||||
|                     ('res_id', '=', values.get('res_id')), | ||||
|                     ('subtype_ids', 'in', 1)    # ID 1 is always the subtyp "Discussion" | ||||
|                     ], context=context) | ||||
| 
 | ||||
|             # get the res.partner objects of the followers (mail.followers) of this resource | ||||
|             followers = set(fo.partner_id for fo in fol_obj.browse(cr, SUPERUSER_ID, fol_ids, context=context)) | ||||
| 
 | ||||
|             # get the res.partner ids for the objects in followers | ||||
|             follower_ids = [f.id for f in followers] | ||||
| 
 | ||||
|             # filter out all followers without an email or with notify_email set to none | ||||
|             notify_pids = p_obj.get_partners_notify_by_email(cr, uid, follower_ids, 'comment', context) | ||||
| 
 | ||||
|             # add follower_ids tp the result dict | ||||
|             # This result dict is used by the ??? - I DONT KNOW TILL NOW! | ||||
|             res.update({'follower_ids': notify_pids}) | ||||
| 
 | ||||
|         return res | ||||
| 
 | ||||
|     def onchange_partner_ids(self, cr, uid, ids, partner_ids, follower_ids, model, res_id, context=None): | ||||
| 
 | ||||
|         # We unwrap the variable partner_ids which most likely has a form of e.g. [(6, 0, [7]), ] | ||||
|         # see https://doc.odoo.com/v6.0/developer/2_5_Objects_Fields_Methods/methods.html/#osv.osv.osv.write | ||||
|         p_ids = [] | ||||
|         # Unwrap: Only take the first list or tuble | ||||
|         if isinstance(partner_ids, (list, tuple)): | ||||
|             partner_ids = partner_ids[0] | ||||
|         # 4 means "link to existing record with id = ID" so we add new links which in fact is nonsense since | ||||
|         # p_ids is empty at this time anyway. | ||||
|         if isinstance(partner_ids, (list, tuple)) and partner_ids[0] == 4 and len(partner_ids) == 2: | ||||
|             p_ids.add(partner_ids[1]) | ||||
|         # 6 means "replace the list of linked IDs" so we replace the partner ids | ||||
|         if isinstance(partner_ids, (list, tuple)) and partner_ids[0] == 6 and len(partner_ids) == 3 and partner_ids[2]: | ||||
|             p_ids = partner_ids[2] | ||||
|         elif isinstance(partner_ids, (int, long)): | ||||
|             p_ids.add(partner_ids) | ||||
|         else: | ||||
|             pass  # we do not manage anything else | ||||
| 
 | ||||
|         p_obj = self.pool.get('res.partner') | ||||
| 
 | ||||
|         # get all partners that have an email and also notify_email is not none | ||||
|         parterns_to_notify = p_obj.get_partners_notify_by_email(cr, uid, p_ids, "comment", context) | ||||
| 
 | ||||
|         # find any partners in p_ids that are not in parterns_to_notify | ||||
|         partners_not_to_notify = [p for p in p_ids if p not in parterns_to_notify] | ||||
| 
 | ||||
|         # get the names of the partners that will not get an email | ||||
|         partners = p_obj.name_get(cr, uid, partners_not_to_notify, context=context)         | ||||
|         partner_names = [p[1] for p in partners] | ||||
| 
 | ||||
|         # Update follower_ids | ||||
|         # Update the values for the wizzard (found in addons/email_template/wizard/mail_compose_message.py) | ||||
|         # HINT: There was no docu in how to update the wizard but at least i found an example - i have no idea | ||||
|         #       If this is the same for all wizards | ||||
|         p_obj = self.pool.get('res.partner') | ||||
|         fol_obj = self.pool.get("mail.followers") | ||||
| 
 | ||||
|         # get all followers for the current resource (= model and res_id) | ||||
|         fol_ids = fol_obj.search(cr, SUPERUSER_ID, [ | ||||
|                 ('res_model', '=', model), | ||||
|                 ('res_id', '=', res_id), | ||||
|                 ('subtype_ids', 'in', 1)    # ID 1 is always the subtyp "Discussion" | ||||
|                 ], context=context) | ||||
| 
 | ||||
|         # get the res.partner objects of the followers (mail.followers) of this resource | ||||
|         followers = set(fo.partner_id for fo in fol_obj.browse(cr, SUPERUSER_ID, fol_ids, context=context)) | ||||
| 
 | ||||
|         # get the res.partner ids for the objects in followers | ||||
|         follower_ids = [f.id for f in followers] | ||||
| 
 | ||||
|         # filter out all followers without an email or with notify_email set to none | ||||
|         follower_partner_ids = p_obj.get_partners_notify_by_email(cr, uid, follower_ids, 'comment', context) | ||||
| 
 | ||||
|         # update the follower_ids to reflect the newly added partners to notify by mail if any | ||||
|         values = {'follower_ids': list(set(follower_partner_ids + parterns_to_notify)), } | ||||
| 
 | ||||
| 
 | ||||
|         # Warn if any partners found that will not get an email | ||||
|         if partner_names: | ||||
|             warning = { | ||||
|                 'title': _('Some partners will not be notified by e-mail!'), | ||||
|                 'message': _('The following partners will not be notified by e-mail but they will still get a message in odoo (if they have a login):\n\n%s') % ('\n'.join(partner_names)) | ||||
|             } | ||||
|             res = {'warning': warning, 'value': values} | ||||
|         else: | ||||
|             res = {'value': values} | ||||
|         return res | ||||
| mail_compose_message() | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| # This will update the new custom field mail_sent for the model mail.notification - seems useless ... because | ||||
| # it will be true if the smtp server takes over the mail which des not guarantee sending was successful | ||||
| class mail_mail(osv.Model): | ||||
|     _inherit = 'mail.mail' | ||||
| 
 | ||||
|     def _postprocess_sent_message(self, cr, uid, mail, context=None, mail_sent=True): | ||||
| 
 | ||||
|         # Copy the notified_by_email_ids to the mail.message | ||||
|         # Hint: It seems that notified_by_email_ids of mail.message is already there but in the state of the initial | ||||
|         #       setting so we have to update it here after we send the message to inculde the right notified_by_email_ids | ||||
|         if mail_sent and mail.recipient_ids and mail.mail_message_id: | ||||
|             mail.mail_message_id.notified_by_email_ids = mail.recipient_ids | ||||
| 
 | ||||
| 
 | ||||
|         return super(mail_mail, self)._postprocess_sent_message(cr=cr, uid=uid, mail=mail, | ||||
|                                                                 context=context, mail_sent=mail_sent) | ||||
|  | @ -1,15 +0,0 @@ | |||
| 
 | ||||
| .oe_follower_red {  | ||||
|     color: red !important; | ||||
| } | ||||
| 
 | ||||
| .oe_follower_orange { | ||||
|     color: orange !important; | ||||
| } | ||||
| 
 | ||||
| .oe_msg_notify_mail { | ||||
|     margin-left: 4px; | ||||
|     overflow: hidden; | ||||
|     margin-top: -4px; | ||||
|     font-size: 11px; | ||||
| } | ||||
|  | @ -1,82 +0,0 @@ | |||
| openerp.mail_follower_control = function (session) { | ||||
| 	 | ||||
| 	session.mail_followers.Followers = session.mail_followers.Followers.extend({ | ||||
| 
 | ||||
|         /** FULL OVERWRITE: because we need to add more data to the records: 'notify_email' | ||||
|          *  Do not forget to update the python function "read_followers_data" in "mail_follower_control.py" | ||||
|          *  ("read_followers_data" is called by JS function "fetch_followers" which then calls "display_followers") | ||||
|          * | ||||
|          * */ | ||||
|         display_followers: function (records) { | ||||
|             var self = this; | ||||
|             this.message_is_follower = false; | ||||
|             console.log('RECORDS:'); | ||||
|             console.log(records); | ||||
|             this.followers = records || this.followers; | ||||
|             // clean and display title
 | ||||
|             var node_user_list = this.$('.oe_follower_list').empty(); | ||||
|             this.$('.oe_follower_title').html(this._format_followers(this.followers.length)); | ||||
|             self.message_is_follower = _.indexOf(this.followers.map(function (rec) { return rec[2]['is_uid']}), true) != -1; | ||||
|             // truncate number of displayed followers
 | ||||
|             var truncated = this.followers.slice(0, this.displayed_nb); | ||||
|             _(truncated).each(function (record) { | ||||
|                 partner = { | ||||
|                     'id': record[0], | ||||
|                     'name': record[1], | ||||
|                     'is_uid': record[2]['is_uid'], | ||||
|                     'is_editable': record[2]['is_editable'], | ||||
|                     'notify_email': record[2]['notify_email'], | ||||
|                     'avatar_url': session.mail.ChatterUtils.get_image(self.session, 'res.partner', 'image_small', record[0]) | ||||
|                 }; | ||||
|                 console.log('partner'); | ||||
|                 console.log(partner); | ||||
|                 $(session.web.qweb.render('mail.followers.partner', {'record': partner, 'widget': self})).appendTo(node_user_list); | ||||
|                 // On mouse-enter it will show the edit_subtype pencil.
 | ||||
|                 if (partner.is_editable) { | ||||
|                     self.$('.oe_follower_list').on('mouseenter mouseleave', function(e) { | ||||
|                         self.$('.oe_edit_subtype').toggleClass('oe_hidden', e.type == 'mouseleave'); | ||||
|                         self.$('.oe_follower_list').find('.oe_partner').toggleClass('oe_partner_name', e.type == 'mouseenter'); | ||||
|                     }); | ||||
|                 } | ||||
|             }); | ||||
|             // FVA note: be sure it is correctly translated
 | ||||
|             if (truncated.length < this.followers.length) { | ||||
|                 $(session.web.qweb.render('mail.followers.show_more', {'number': (this.followers.length - truncated.length)} )).appendTo(node_user_list); | ||||
|             } | ||||
|         }, | ||||
| 	 | ||||
| 	    do_follow: function () { | ||||
| 	        /** | ||||
| 	         * Add this context value to force subscription | ||||
| 	         */	    	 | ||||
| 	        var context = new session.web.CompoundContext(this.build_context(), {'force_subscription': 1}); | ||||
|             console.log('do_follow'); | ||||
| 
 | ||||
| 	        this.ds_model.call('message_subscribe_users', [[this.view.datarecord.id], [this.session.uid], undefined, context]) | ||||
| 	            .then(this.proxy('read_value')); | ||||
| 	 | ||||
| 	        _.each(this.$('.oe_subtype_list input'), function (record) { | ||||
| 	            $(record).attr('checked', 'checked'); | ||||
| 	        }); | ||||
| 	 | ||||
| 	    } | ||||
|      | ||||
|     }); | ||||
| 
 | ||||
|     // HINT: Add recipient_ids to MessageCommon - message common is extended by:
 | ||||
|     //       mail.ThreadMessage AND
 | ||||
|     //       mail.ThreadComposeMessage so both should have recipients_ids now for ThreadComposeMessage it will be
 | ||||
|     //       useless for now because this is updated after we post the message.
 | ||||
|     // session.mail.MessageCommon = session.mail.MessageCommon.extend({
 | ||||
|     // HINT2: mail.MessageCommon did not work ?!?
 | ||||
|     openerp.mail.ThreadMessage = openerp.mail.ThreadMessage.extend({ | ||||
|     	template: 'mail.thread.message', | ||||
| 
 | ||||
|     	init: function (parent, datasets, options) { | ||||
|     		this._super(parent, datasets, options); | ||||
| 
 | ||||
|     		this.notified_by_email_ids = datasets.notified_by_email_ids || []; | ||||
|     	} | ||||
|     }); | ||||
| 
 | ||||
| }; | ||||
|  | @ -1,52 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <templates id="template" xml:space="preserve"> | ||||
| 
 | ||||
|     <!-- Chatter widget on left side with followers of thread: show partners in red that will not receive an email --> | ||||
|     <t t-extend="mail.followers.partner"> | ||||
|         <t t-jquery="a" t-operation="replace"> | ||||
|             <t t-if="record.notify_email == 'none'"> | ||||
|                 <a class="oe_follower_red" t-attf-href="#model=res.partner&id=#{record.id}" t-att-title="record.name" t-att-data-partner="record.id"><t t-esc="record.name"/></a> | ||||
|             </t> | ||||
|             <t t-if="record.notify_email != 'none'"> | ||||
|                 <a t-attf-href="#model=res.partner&id=#{record.id}" t-att-title="record.name" t-att-data-partner="record.id"><t t-esc="record.name"/></a> | ||||
|             </t> | ||||
|         </t> | ||||
|     </t> | ||||
| 
 | ||||
|     <!-- Add recipients.ids for the Mail sent to message - this is not a guarantee that the partner got an email! | ||||
|          HINT: This template is called by mail.js mail.ThreadMessage which extends mail.MessageCommon | ||||
|                All relevant fields of mail.message should be available - if needed can be extended in | ||||
|                mail_follower_control/static/src/js/mail_follower_control.js | ||||
|     --> | ||||
|     <t t-extend="mail.thread.message"> | ||||
|         <t t-jquery=".oe_msg_footer" t-operation="append"> | ||||
|             <div class="oe_msg_notify_mail"> | ||||
|                 <span>By e-mail to:</span> | ||||
|                     <t t-if="widget.type == 'notification' or ( (widget.type == 'email' or widget.type == 'comment') and widget.subtype)"> | ||||
| 
 | ||||
|                         <t t-foreach="widget.notified_by_email_ids" t-as="partner"> | ||||
|                             <span t-attf-class="oe_partner_follower"> | ||||
|                                 <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&id=#{partner[0]}"> | ||||
|                                     <t t-raw="partner[1]"/> | ||||
|                                 </a> | ||||
|                                 <t t-if="!widget.options.show_link" t-raw="partner[1]"/> | ||||
|                             </span> | ||||
|                             <t t-if="!partner_last">,</t> | ||||
|                         </t> | ||||
| 
 | ||||
|                     </t> | ||||
|             </div> | ||||
|         </t> | ||||
|     </t> | ||||
| 
 | ||||
|     <!-- Todo: Extend the Quick mail composer with recipients_ids --> | ||||
|     <!-- HINT: This template for the quick mail composer is called by mail.js mail.ThreadComposeMessage which | ||||
|                extends mail.MessageCommon -> all relevant fields from mail.message should be available! | ||||
|                if not add them in mail_follower_control/static/src/js/mail_follower_control.js | ||||
|     --> | ||||
|     <!--<t t-extend="mail.compose_message">--> | ||||
|         <!--<t t-jquery=".oe_full" t-operation="after">--> | ||||
|             <!--<div>Notified by eMail: <t t-esc="widget.partner_ids"/></div>--> | ||||
|         <!--</t>--> | ||||
|     <!--</t>--> | ||||
| </templates> | ||||
|  | @ -1,64 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <openerp> | ||||
|     <data> | ||||
| 
 | ||||
|         <!-- Load CSS and JS into the Backend--> | ||||
|         <template id="assets_backend" name="mail_follower_control assets" inherit_id="web.assets_backend"> | ||||
|             <xpath expr="." position="inside"> | ||||
|                 <link rel="stylesheet" href="/mail_follower_control/static/src/css/mail_follower_control.css"/> | ||||
|                 <script type="text/javascript" src="/mail_follower_control/static/src/js/mail_follower_control.js"></script> | ||||
|             </xpath> | ||||
|         </template> | ||||
| 
 | ||||
|         <!-- Add no_subscribe checkbox to partner form --> | ||||
|         <record id="res_partner_form_view" model="ir.ui.view"> | ||||
|             <field name="name">chatterimprovments.res_partner.form</field> | ||||
|             <field name="model">res.partner</field> | ||||
|             <field name="inherit_id" ref="mail.view_emails_partner_info_form"/> | ||||
|             <field name="arch" type="xml"> | ||||
|                 <field name="notify_email" position="after"> | ||||
|                     <field name="no_subscribe"/> | ||||
|                 </field> | ||||
|             </field> | ||||
|         </record> | ||||
| 
 | ||||
|         <!-- Add follower_ids and an onchange event for partner_ids to mail compose wizard form | ||||
|              To warn if the notification setting of a partner would prevent to send an e-mail | ||||
|              and to show which res.partner will receive an e-mail --> | ||||
|         <record id="mail_message_wizard_form_view" model="ir.ui.view"> | ||||
|             <field name="name">chatterimprovments.mail_message_wizard.form</field> | ||||
|             <field name="model">mail.compose.message</field> | ||||
|             <field name="inherit_id" ref="mail.email_compose_message_wizard_form"/> | ||||
|             <field name="arch" type="xml"> | ||||
| 
 | ||||
|                 <!-- ADD field follower_ids which hold the res.partner ids that will get an eMail --> | ||||
|                 <field name="notify" position="before"> | ||||
|                     <label for="follower_ids" string="Notified by eMail"/> | ||||
|                     <div> | ||||
|                         <field name="follower_ids" widget="many2many_tags_email"/> | ||||
|                     </div> | ||||
|                 </field> | ||||
| 
 | ||||
|                 <!-- ADD attribute onchange to partner_ids field--> | ||||
|                 <xpath expr="//field[@name='partner_ids']" position="attributes"> | ||||
|                     <attribute name="on_change">onchange_partner_ids(partner_ids, follower_ids, model, res_id, context)</attribute> | ||||
|                 </xpath> | ||||
|             </field> | ||||
|         </record> | ||||
| 
 | ||||
|         <!-- Show recipient_ids in mail_message form --> | ||||
|         <record id="mail_view_message_form_extended" model="ir.ui.view"> | ||||
|             <field name="name">mail_view_message_form_extended</field> | ||||
|             <field name="model">mail.message</field> | ||||
|             <field name="inherit_id" ref="mail.view_message_form"/> | ||||
|             <field name="arch" type="xml"> | ||||
| 
 | ||||
|                 <!-- ADD field recipient_ids which hold the res.partner ids that got an eMail --> | ||||
|                 <field name="notified_partner_ids" position="after"> | ||||
|                     <field name="notified_by_email_ids" widget="many2many_tags"/> | ||||
|                 </field> | ||||
|             </field> | ||||
|         </record> | ||||
| 
 | ||||
|     </data> | ||||
| </openerp> | ||||
|  | @ -1,15 +0,0 @@ | |||
| Stop Phoning Home Feature from OpenERP | ||||
| ====================================== | ||||
| 
 | ||||
| Note: | ||||
| ----- | ||||
| 
 | ||||
| * For V8 checkout master branch | ||||
| * for V7 checkout 7.0 branch | ||||
| 
 | ||||
| Remove Few Phoning home feature effect from Core OpenERP. | ||||
| --------------------------------------------------------- | ||||
| 
 | ||||
| * Stop Scheduler for Sending Company/Database information to Odoo/OpenERP company. | ||||
| * Remove ``Your OpenERP is not supported.``. | ||||
| * Change sequence of the ``Apps`` and ``Update`` menu and arrange ``Installed Modules`` at first position. | ||||
|  | @ -1 +0,0 @@ | |||
| import mail | ||||
|  | @ -1,29 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| { | ||||
|     'name': 'Stop Phoning Home', | ||||
|     'version': '1.0', | ||||
|     'category': '', | ||||
|     "sequence": 14, | ||||
|     'complexity': "easy", | ||||
|     'category': 'Hidden', | ||||
|     'description': """ | ||||
|         Remove Few Phoning home feature effect from Core OpenERP. | ||||
|     """, | ||||
|     'author': 'Ruchir Shukla', | ||||
|     'website': 'www.bizzappdev.com', | ||||
|     'depends': ["mail",'web'], | ||||
|     'init_xml': [], | ||||
|     'data': [ | ||||
|         "base_view.xml", | ||||
|         "mail_data.xml", | ||||
|     ], | ||||
|     'demo_xml': [], | ||||
|     'test': [ | ||||
|     ], | ||||
|     'qweb' : [ | ||||
|         "static/src/xml/base.xml", | ||||
|     ], | ||||
|     'installable': True, | ||||
|     'auto_install': True, | ||||
| } | ||||
| # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||||
|  | @ -1,7 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <openerp> | ||||
|     <data> | ||||
|         <menuitem id="base.menu_module_tree" parent="base.menu_management" name="Installed Modules" sequence="10" action="base.open_module_tree" /> | ||||
|         <menuitem id="base.module_mi" parent="base.menu_management" sequence="100" action="base.modules_act_cl"/> | ||||
|     </data> | ||||
| </openerp> | ||||
|  | @ -1,25 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| from openerp.osv import osv | ||||
| import logging | ||||
| 
 | ||||
| _logger = logging.getLogger(__name__) | ||||
| 
 | ||||
| from openerp.tools import config | ||||
| 
 | ||||
| config['publisher_warranty_url'] = '' | ||||
| 
 | ||||
| 
 | ||||
| class publisher_warranty_contract(osv.osv): | ||||
|     _inherit = 'publisher_warranty.contract' | ||||
| 
 | ||||
|     def update_notification(self, cr, uid, ids, cron_mode=True, | ||||
|                             context=None): | ||||
| 
 | ||||
|         _logger.info("NO More Spying Stuff") | ||||
| 
 | ||||
|         return True | ||||
| 
 | ||||
| 
 | ||||
| publisher_warranty_contract() | ||||
| 
 | ||||
|  | @ -1,26 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <openerp> | ||||
|     <data> | ||||
| 
 | ||||
| 
 | ||||
|         <record id="mail.ir_cron_module_update_notification" model="ir.cron"> | ||||
|             <field name="name">Update Notification</field> | ||||
|             <field eval="False" name="active" /> | ||||
|             <field name="user_id" ref="base.user_root" /> | ||||
|             <field name="interval_number">1</field> | ||||
|             <field name="interval_type">weeks</field> | ||||
|             <field name="numbercall">-1</field> | ||||
|             <field eval="False" name="doall" /> | ||||
|             <field eval="'publisher_warranty.contract'" name="model" /> | ||||
|             <field eval="'update_notification'" name="function" /> | ||||
|             <field eval="'(None,)'" name="args" /> | ||||
|             <field name="priority">1000</field> | ||||
|         </record> | ||||
|          | ||||
|         <template id="assets_backend" name="oerp_no_phoning_home assets" inherit_id="web.assets_backend"> | ||||
|             <xpath expr="." position="inside"> | ||||
|                 <script type="text/javascript" src="/oerp_no_phoning_home/static/src/js/announcement.js"></script> | ||||
|             </xpath> | ||||
|         </template> | ||||
|     </data> | ||||
| </openerp> | ||||
| Before Width: | Height: | Size: 11 KiB | 
|  | @ -1,13 +0,0 @@ | |||
| openerp.oerp_no_phoning_home = function(instance) { | ||||
|      instance.web.WebClient.include({ | ||||
|         show_application: function() { | ||||
|             return $.when(this._super.apply(this, arguments)); | ||||
|         }, | ||||
|         _ab_location: function(dbuuid) { | ||||
|            // return _.str.sprintf('https://services.openerp.com/openerp-enterprise/ab/css/%s.css', dbuuid);
 | ||||
|         }, | ||||
|         show_annoucement_bar: function() { | ||||
|             return; | ||||
|         } | ||||
|     }); | ||||
| }; | ||||
|  | @ -1,17 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <templates id="template" xml:space="preserve"> | ||||
|     <t t-extend="UserMenu" > | ||||
|         <t t-jquery="ul.dropdown-menu" t-operation="replace"> | ||||
|             <ul class="dropdown-menu"> | ||||
|                 <li><a href="#" data-menu="settings">Preferences</a></li> | ||||
|                 <li><a href="#" data-menu="about">About OpenERP</a></li> | ||||
|                 <li><a href="#" data-menu="help">Help</a></li> | ||||
|                 <li><a href="#" data-menu="logout">Log out</a></li> | ||||
|             </ul> | ||||
|         </t> | ||||
|     </t> | ||||
|     <t t-extend="WebClient.announcement_bar" > | ||||
|         <t t-jquery="table.oe_webclient" t-operation="replace"> | ||||
|         </t> | ||||
|     </t> | ||||
| </templates> | ||||
|  | @ -1,22 +0,0 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| ############################################################################## | ||||
| # | ||||
| #    OpenERP, Open Source Management Solution | ||||
| #    Copyright (C) 20014-2016 Camadeus GmbH (<http://www.camadeus.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/>. | ||||
| # | ||||
| ############################################################################## | ||||
| 
 | ||||
| import sale_order_optional | ||||