Skip to content
Extraits de code Groupes Projets
Valider 85d4f3ef rédigé par Benjamin's avatar Benjamin
Parcourir les fichiers

initiaisation module scopea

parent
Branches 10.0
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
.*
*.pyc
!.gitignore
# -*- encoding: utf-8 -*-
##############################################################################
#
# Aquilog - Open Source Solutions
# Copyright (C) 2005 - 2016 Aquilog <http://www.aquilog.fr>
#
# 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 models
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
{
'name': "Pylote - Imprimé",
'version': "10.0.003",
'author': "Scopea",
'website': 'http://scopea.fr',
'category': "Misc",
'depends': ['account','sale','purchase', 'product'],
'init_xml': [],
'demo_xml': [],
'description': """
Custom printed report
""",
'data': [
# 'security/ir.model.access.csv',
'views/report_purchase_order.xml',
'views/report_invoice.xml',
'views/view_purchase_order.xml',
],
'installable': True,
'auto_install': False,
}
from . import purchase
# -*- encoding: utf-8 -*-
##############################################################################
#
# Aquilog - Open Source Solutions
# Copyright (C) 2005 - 2015 Aquilog <http://www.aquilog.fr>
#
# 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 api, models, fields, _
class PylotePurchaseOrder(models.Model):
_inherit = 'purchase.order'
s_contact = fields.Many2one('res.partner', string='Contact interne', domain=[('parent_id.id','=',1)])
s_summary = fields.Char(string='Objet')
class PylotePurchaseOrderLine(models.Model):
_inherit = 'purchase.order.line'
def get_ref(self):
fournisseurs = self.product_id.seller_ids.filtered(lambda s: s.name.id == self.order_id.partner_id.id or s.name.id == self.order_id.partner_id.parent_id.id)
if len(fournisseurs) >= 1:
return fournisseurs[0].product_code
return ""
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
static/description/Signature-loic.jpg

23 ko

static/description/icon.png

14,2 ko

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_invoice_pylote" inherit_id="sale.report_invoice_layouted">
<xpath expr="//div[@class='page']" position="replace">
<div class="page">
<div class="row">
<div name="invoice_address" class="col-xs-6">
<strong t-if="o.type == 'in_invoice' or o.type == 'in_refund'">Adresse de Facturation:</strong>
<span t-field="o.company_id.partner_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;], &quot;no_marker&quot;: true}"/>
</div>
<div name="invoice_address" class="col-xs-6">
<strong t-if="o.type == 'in_invoice' or o.type == 'in_refund'"> Adresse Fournisseur:</strong>
<strong t-if="o.type != 'in_invoice'"> Adresse client:</strong>
<address t-field="o.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>
<span t-if="o.partner_id.vat">TIN: <span t-field="o.partner_id.vat"/></span>
</div>
</div>
<h2>
<span t-if="o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">Facture</span>
<span t-if="o.type == 'out_invoice' and o.state == 'proforma2'">PRO-FORMA</span>
<span t-if="o.type == 'out_invoice' and o.state == 'draft'">Facture Brouillon</span>
<span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Facture Annulée</span>
<span t-if="o.type == 'out_refund'">Avoir</span>
<span t-if="o.type == 'in_refund'">Avoir Fournisseur</span>
<span t-if="o.type == 'in_invoice'">Facture Fournisseur</span>
<span t-field="o.number"/>
</h2>
<div class="row mt32 mb32">
<div class="col-xs-2" t-if="o.name">
<strong>Description:</strong>
<p t-field="o.name"/>
</div>
<div class="col-xs-2" t-if="o.date_invoice">
<strong>Date de facturation:</strong>
<p t-field="o.date_invoice"/>
</div>
<div class="col-xs-2" t-if="o.date_due and o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">
<strong>Échéance:</strong>
<p t-field="o.date_due"/>
</div>
<div class="col-xs-2" t-if="o.origin">
<strong>Origine:</strong>
<p t-field="o.origin"/>
</div>
<div class="col-xs-2" t-if="o.partner_id.ref">
<strong>Votre Reference:</strong>
<p t-field="o.partner_id.ref"/>
</div>
<div name="reference" class="col-xs-2" t-if="o.reference and o.type == 'in_invoice'">
<strong>Notre Reference:</strong>
<p t-field="o.reference"/>
</div>
</div>
<!-- Is there a discount on at least one line? -->
<t t-set="display_discount" t-value="any([l.discount for l in o.invoice_line_ids])"/>
<table class="table table-condensed">
<thead>
<tr>
<th>Description</th>
<th class="hidden">Document Source</th>
<th class="text-right">Quantité</th>
<th class="text-right">Prix unitaire</th>
<th t-if="display_discount" class="text-right">Remise (%)</th>
<th class="text-right">Taxes</th>
<th class="text-right">Prix HT</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.invoice_line_ids" t-as="l">
<td><span t-field="l.name"/></td>
<td class="hidden"><span t-field="l.origin"/></td>
<td class="text-right">
<span t-field="l.quantity"/>
<span t-field="l.uom_id" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td t-if="display_discount" class="text-right">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.invoice_line_tax_ids))"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed">
<tr class="border-black">
<td><strong>Total HT</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
<t t-foreach="o._get_tax_amount_by_group()" t-as="amount_by_group">
<tr>
<td><span t-esc="amount_by_group[0] if len(o.tax_line_ids) &gt; 1 else (o.tax_line_ids.tax_id.description or o.tax_line_ids.tax_id.name)"/></td>
<td class="text-right">
<span t-esc="amount_by_group[1]" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
</t>
<tr class="border-black">
<td><strong>Total</strong></td>
<td class="text-right">
<span t-field="o.amount_total" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
</table>
</div>
</div>
<div class="row" t-if="len(o.tax_line_ids) &gt; 1">
<div class="col-xs-6">
<table class="table table-condensed">
<thead>
<tr>
<th>Taxes</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.tax_line_ids" t-as="t">
<td><span t-field="t.tax_id.description"/></td>
<td class="text-right">
<span t-field="t.amount" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p t-if="o.comment">
<strong>Commentaire:</strong>
<span t-field="o.comment"/>
</p>
<p><strong>Approuvé par :</strong> Loic MARCHIN (CEO)</p>
<p t-if="o.payment_term_id">
<span t-field="o.payment_term_id.note"/>
</p>
<p t-if="o.fiscal_position_id.note">
<strong>Remarque sur les conditions de paiement:</strong>
<span t-field="o.fiscal_position_id.note"/>
</p>
<p>
<strong>IBAN</strong>: FR76 1780 7000 1495 3218 5744 266<br/>
<strong>BIC</strong>: CCBPFRPPTLS
</p>
</div>
</xpath>
</template>
</data>
</openerp>
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_purchase_pylote" inherit_id="purchase.report_purchaseorder_document">
<xpath expr="//div[@class='page']" position="replace">
<div class="page">
<div class="oe_structure"/>
<div class="row">
<div class="col-xs-6">
<!-- <strong>Adresse de livraison:</strong>
<div t-if="o.dest_address_id">
<div t-field="o.dest_address_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;, &quot;fax&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
</div> -->
<!-- <div t-if="not o.dest_address_id and o.picking_type_id and o.picking_type_id.warehouse_id">
<span t-field="o.picking_type_id.warehouse_id.name"/>
<div t-field="o.picking_type_id.warehouse_id.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;phone&quot;, &quot;fax&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
</div> -->
</div>
<div class="col-xs-5 col-xs-offset-1">
<div t-field="o.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;, &quot;fax&quot;, &quot;email&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
<p t-if="o.partner_id.vat">TVA: <span t-field="o.partner_id.vat"/></p>
</div>
</div>
<h2 t-if="o.state != 'draft'">Confirmation du Bon de commande #<span t-field="o.name"/></h2>
<h2 t-if="o.state == 'draft'">Demande de devis #<span t-field="o.name"/></h2>
<div class="row mt32 mb32">
<div t-if="o.s_summary" class="col-xs-3">
<strong>Objet:</strong>
<p t-field="o.s_summary"/>
</div>
<div t-if="o.s_contact" class="col-xs-3">
<strong>Contact:</strong>
<p t-field="o.s_contact" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;name&quot;, &quot;phone&quot;, &quot;fax&quot;, &quot;email&quot;], &quot;no_marker&quot;: True, &quot;phone_icons&quot;: True}"/>
</div>
<div t-if="o.name" class="col-xs-3">
<strong>Notre référence:</strong>
<p t-field="o.name"/>
</div>
<div t-if="o.partner_ref" class="col-xs-3">
<strong>Votre référence:</strong>
<p t-field="o.partner_ref"/>
</div>
<div t-if="o.date_order" class="col-xs-3">
<strong>Date de commande:</strong>
<p t-field="o.date_order" t-field-options="{&quot;format&quot;: &quot;yyyy-MM-dd&quot;}"/>
</div>
</div>
<table class="table table-condensed">
<thead>
<tr>
<th><strong>Nom</strong></th>
<th><strong>Description</strong></th>
<!-- <th><strong>Reférence</strong></th> -->
<th><strong>Taxes</strong></th>
<th class="text-center"><strong>Date demandée.</strong></th>
<th class="text-right"><strong>Qté</strong></th>
<th class="text-right"><strong>Prix unitaire</strong></th>
<th class="text-right"><strong>Prix net</strong></th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.order_line" t-as="line">
<td>
<span t-esc="line.product_id.name"/>
</td>
<td>
<span t-field="line.name"/>
</td>
<!-- <td>
<span t-esc="line.get_ref()"/>
</td> -->
<td>
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/>
</td>
<td class="text-center">
<span t-field="line.date_planned" t-field-options="{&quot;format&quot;: &quot;yyyy-MM-dd&quot;}"/>
</td>
<td class="text-right">
<span t-field="line.product_qty"/>
<span t-field="line.product_uom.name" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="line.price_unit" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
<td class="text-right">
<span t-field="line.price_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed">
<tr class="border-black">
<td><strong>Total HT</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
<tr>
<td>Taxes</td>
<td class="text-right">
<span t-field="o.amount_tax" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
<tr class="border-black">
<td><strong>Total</strong></td>
<td class="text-right">
<span t-field="o.amount_total" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
</table>
</div>
</div>
<p t-field="o.notes"/>
<p>
<table style="width: 100%; table-layout: fixed;">
<tbody>
<tr>
<td style="border: 1px solid black !important;height: 20px; padding: 5px">
<strong>Approuvé par : Loic MARCHIN (CEO)</strong>
</td>
</tr>
<tr>
<td style="border: 1px solid black !important;height: 20px; padding: 5px">
Date : <span t-if="o.state == 'purchase'" t-field="o.date_order" t-field-options="{&quot;format&quot;: &quot;yyyy-MM-dd&quot;}"/>
</td>
</tr>
<tr>
<td style="border: 1px solid black !important;height: 100px; padding: 5px">
Signature :
<img t-if="o.state == 'purchase'" src="pylote_imprime/static/description/Signature-loic.jpg" style="height:150px;"/>
</td>
</tr>
</tbody>
</table>
</p>
<div>
<center><p style="font-size:10px;">Modèle Bon de Commande - version 01</p></center>
</div>
<div class="oe_structure"/>
</div>
</xpath>
</template>
</data>
</openerp>
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<record model="ir.ui.view" id="pylote_purchase_order">
<field type="xml" name="arch">
<xpath expr="//field[@name='partner_ref']" position="after">
<field name="s_contact"/>
<field name="s_summary"/>
</xpath>
</field>
<field ref="purchase.purchase_order_form" name="inherit_id"/>
<field name="mode">extension</field>
<field name="model">purchase.order</field>
<field name="name">Pylote purchase order</field>
<field name="priority">90</field>
</record>
</odoo>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter