Skip to content
Extraits de code Groupes Projets
Valider bf9d380b rédigé par Juliana's avatar Juliana
Parcourir les fichiers

[MIG] Migration 12.0

parent 05a5a5b4
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -18,6 +18,7 @@ Credits ...@@ -18,6 +18,7 @@ Credits
Contributors ------------ Contributors ------------
* Benjamin Rivier <benjamin@le-filament.com> * Benjamin Rivier <benjamin@le-filament.com>
* Juliana Poudou <juliana@le-filament.com>
Maintainer ---------- Maintainer ----------
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2019 Le Filament - <maintenance@le-filament.com> # Copyright 2021 Le Filament - <maintenance@le-filament.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
'name': "Export Boxtal", 'name': "Export Boxtal",
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
'contributors': [ 'contributors': [
'Benjamin Rivier <benjamin@le-filament.com>', 'Benjamin Rivier <benjamin@le-filament.com>',
], ],
'depends': ['sale', 'partner_firstname'], 'depends': ['sale'],
'data': [ 'data': [
# 'security/ir.model.access.csv', # 'security/ir.model.access.csv',
'views/sale.xml', 'views/sale.xml',
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2019 Le Filament - <maintenance@le-filament.com> # Copyright 2021 Le Filament - <maintenance@le-filament.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import re import re
from cStringIO import StringIO from io import BytesIO
from odoo import http, fields from odoo import http, fields
from odoo.http import request from odoo.http import request
...@@ -35,7 +35,7 @@ class BoxtalExporter(http.Controller): ...@@ -35,7 +35,7 @@ class BoxtalExporter(http.Controller):
worksheet.write(row_index + 1, cell_index, worksheet.write(row_index + 1, cell_index,
cell_value, cell_style) cell_value, cell_style)
fp = StringIO() fp = BytesIO()
workbook.save(fp) workbook.save(fp)
fp.seek(0) fp.seek(0)
data = fp.read() data = fp.read()
......
...@@ -10,9 +10,10 @@ class BoxtalSale(models.Model): ...@@ -10,9 +10,10 @@ class BoxtalSale(models.Model):
@api.multi @api.multi
def get_export_boxtal(self): def get_export_boxtal(self):
for rec in self:
return { return {
'type': 'ir.actions.act_url', 'type': 'ir.actions.act_url',
'url': '/web/export_boxtal?sale_id=%s' % (self.id,), 'url': '/web/export_boxtal?sale_id=%s' % (rec.id,),
'context': '{ active_id: %s, }' % (self.id,), 'context': '{ active_id: %s, }' % (rec.id,),
'target': 'new' 'target': 'new'
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<field name="model">sale.order</field> <field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/> <field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//button[@name='action_done']" position="after" > <xpath expr="//button[@name='action_draft']" position="after" >
<button name="get_export_boxtal" states="sale" type="object" string="Export Boxtal" /> <button name="get_export_boxtal" states="sale" type="object" string="Export Boxtal" />
</xpath> </xpath>
</field> </field>
......
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