Skip to content

Commit 30e899d

Browse files
author
resteve
committed
[ADD] OpenERP e-sale Attachment
1 parent 1f47391 commit 30e899d

12 files changed

+1024
-0
lines changed

zoook_attachment/__init__.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# -*- encoding: utf-8 -*-
2+
##############################################################################
3+
#
4+
# OpenERP, Open Source Management Solution
5+
# Copyright (c) 2012 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
6+
# Raimon Esteve <[email protected]>
7+
# $Id$
8+
#
9+
# This program is free software: you can redistribute it and/or modify
10+
# it under the terms of the GNU Affero General Public License as
11+
# published by the Free Software Foundation, either version 3 of the
12+
# License, or (at your option) any later version.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU Affero General Public License for more details.
18+
#
19+
# You should have received a copy of the GNU Affero General Public License
20+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
#
22+
##############################################################################
23+
24+
import attachment
25+
import sale
26+
import wizard

zoook_attachment/__openerp__.py

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# -*- encoding: utf-8 -*-
2+
##############################################################################
3+
#
4+
# OpenERP, Open Source Management Solution
5+
# Copyright (c) 2012 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
6+
# Raimon Esteve <[email protected]>
7+
# $Id$
8+
#
9+
# This program is free software: you can redistribute it and/or modify
10+
# it under the terms of the GNU Affero General Public License as
11+
# published by the Free Software Foundation, either version 3 of the
12+
# License, or (at your option) any later version.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU Affero General Public License for more details.
18+
#
19+
# You should have received a copy of the GNU Affero General Public License
20+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
#
22+
##############################################################################
23+
24+
{
25+
"name" : "ZoooK - OpenERP e-sale - Attachment",
26+
"version" : "1.0",
27+
"author" : "Zikzakmedia SL",
28+
"website" : "www.zikzakmedia.com",
29+
"category" : "Generic Modules",
30+
"description": """
31+
e-commerce management 100% integration by OpenERP.
32+
Product Attachment Files. Download File (manuals, drivers, ...)
33+
""",
34+
"license" : "AGPL-3",
35+
"depends" : [
36+
"zoook",
37+
"document",
38+
],
39+
"init_xml" : [],
40+
"demo_xml" : [],
41+
"update_xml" : [
42+
"attachment_view.xml",
43+
"sale_view.xml",
44+
"wizard/wizard_attachment.xml",
45+
],
46+
"active": False,
47+
"installable": True
48+
}

zoook_attachment/attachment.py

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# -*- encoding: utf-8 -*-
2+
##############################################################################
3+
#
4+
# OpenERP, Open Source Management Solution
5+
# Copyright (c) 2012 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
6+
# Raimon Esteve <[email protected]>
7+
# $Id$
8+
#
9+
# This program is free software: you can redistribute it and/or modify
10+
# it under the terms of the GNU Affero General Public License as
11+
# published by the Free Software Foundation, either version 3 of the
12+
# License, or (at your option) any later version.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU Affero General Public License for more details.
18+
#
19+
# You should have received a copy of the GNU Affero General Public License
20+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
#
22+
##############################################################################
23+
24+
from osv import osv, fields
25+
from tools.translate import _
26+
27+
class ir_attachment(osv.osv):
28+
_inherit = "ir.attachment"
29+
30+
_columns = {
31+
'esale_exportable':fields.boolean('Available e-sale', change_default=True,),
32+
'esale_visibility': fields.selection([
33+
('public', 'Public'),
34+
('register', 'Register'),
35+
('none', 'None'),
36+
], 'Visibility'),
37+
'esale_saleshop_ids': fields.many2many('sale.shop', 'zoook_attachment_sale_shop_rel', 'attachment_id', 'sale_shop_id', 'Websites', help='Select yours Sale Shops available this attachment'),
38+
}
39+
40+
_defaults = {
41+
'esale_visibility': lambda *a: 'public',
42+
}
43+
44+
def unlink(self, cr, uid, ids, context=None):
45+
"""Dissable unlink attachment available esale export"""
46+
47+
for attach in self.read(cr, uid, ids, ['esale_exportable']):
48+
esale = attach.get('esale_exportable', False)
49+
if esale:
50+
raise osv.except_osv(_("Alert"), _("To Unlink this attachment mark visibility is none"))
51+
52+
return super(ir_attachment, self).unlink(cr, uid, ids, context)
53+
54+
ir_attachment()

zoook_attachment/attachment_view.xml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<openerp>
3+
<data>
4+
<!-- Ir Attachment-->
5+
<record id="ir_attachment_esale" model="ir.ui.view">
6+
<field name="name">ir.attachment.esale</field>
7+
<field name="model">ir.attachment</field>
8+
<field name="inherit_id" ref="document.view_document_file_form" />
9+
<field name="type">form</field>
10+
<field name="arch" type="xml">
11+
<xpath expr="/form/group/field[@name='company_id']" position="after">
12+
<field name="esale_exportable" attrs="{'invisible':[('esale_exportable','==',True)]}"/>
13+
</xpath>
14+
<notebook position="inside">
15+
<page string="e-sale" attrs="{'invisible':[('esale_exportable','==',False)]}">
16+
<field name="esale_visibility"/>
17+
<separator colspan="4" string="Websites"/>
18+
<field name="esale_saleshop_ids" colspan="4" nolabel="1"/>
19+
</page>
20+
</notebook>
21+
</field>
22+
</record>
23+
</data>
24+
</openerp>

zoook_attachment/i18n/ca.po

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Translation of OpenERP Server.
2+
# This file contains the translation of the following modules:
3+
# * zoook_attachment
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: OpenERP Server 6.0.3\n"
8+
"Report-Msgid-Bugs-To: [email protected]\n"
9+
"POT-Creation-Date: 2012-05-04 09:11+0000\n"
10+
"PO-Revision-Date: 2012-05-04 11:26+0100\n"
11+
"Last-Translator: Raimon Esteve <[email protected]>\n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: 8bit\n"
16+
"Plural-Forms: \n"
17+
18+
#. module: zoook_attachment
19+
#: field:sale.shop,esale_last_export_attachment:0
20+
msgid "Last Export Attachment"
21+
msgstr "Últims adjunts exportats"
22+
23+
#. module: zoook_attachment
24+
#: field:esale.sync.attachment.wizard,state:0
25+
msgid "State"
26+
msgstr "Estat"
27+
28+
#. module: zoook_attachment
29+
#: view:esale.sync.attachment.wizard:0
30+
msgid "Exportation is running.... This action is in background. See logs server process"
31+
msgstr "La sincronització s'està execuntant-se. Aquesta acció es realitza en paral·lel. Reviseu el historial del servidor per més informació."
32+
33+
#. module: zoook_attachment
34+
#: selection:ir.attachment,esale_visibility:0
35+
msgid "Public"
36+
msgstr "Públic"
37+
38+
#. module: zoook_attachment
39+
#: code:addons/zoook_attachment/wizard/wizard_attachment.py:75
40+
#, python-format
41+
msgid "Not available some e-Sale Attachments to export"
42+
msgstr "No es troba disponible adjunts per sincronitzar"
43+
44+
#. module: zoook_attachment
45+
#: view:esale.sync.attachment.wizard:0
46+
msgid "Export Attachment"
47+
msgstr "Exporta adjunts"
48+
49+
#. module: zoook_attachment
50+
#: field:ir.attachment,esale_exportable:0
51+
msgid "Available e-sale"
52+
msgstr "Disponible e-sale"
53+
54+
#. module: zoook_attachment
55+
#: field:ir.attachment,esale_visibility:0
56+
msgid "Visibility"
57+
msgstr "Visibilitat"
58+
59+
#. module: zoook_attachment
60+
#: code:addons/zoook_attachment/attachment.py:50
61+
#, python-format
62+
msgid "Alert"
63+
msgstr "Alerta"
64+
65+
#. module: zoook_attachment
66+
#: code:addons/zoook_attachment/wizard/wizard_attachment.py:54
67+
#, python-format
68+
msgid "Select attachments to export"
69+
msgstr "Selecciona adjunts per sincronitzar"
70+
71+
#. module: zoook_attachment
72+
#: model:ir.model,name:zoook_attachment.model_ir_attachment
73+
msgid "ir.attachment"
74+
msgstr "ir.attachment"
75+
76+
#. module: zoook_attachment
77+
#: model:ir.model,name:zoook_attachment.model_sale_shop
78+
msgid "Sales Shop"
79+
msgstr "Botigues"
80+
81+
#. module: zoook_attachment
82+
#: view:esale.sync.attachment.wizard:0
83+
msgid "Export"
84+
msgstr "Export"
85+
86+
#. module: zoook_attachment
87+
#: view:sale.shop:0
88+
msgid "Export Attachments"
89+
msgstr "Exporta adjunts"
90+
91+
#. module: zoook_attachment
92+
#: selection:ir.attachment,esale_visibility:0
93+
msgid "None"
94+
msgstr "Cap lloc"
95+
96+
#. module: zoook_attachment
97+
#: view:esale.sync.attachment.wizard:0
98+
msgid "Attachments to sync..."
99+
msgstr "Adjunts a sincronitzar..."
100+
101+
#. module: zoook_attachment
102+
#: selection:ir.attachment,esale_visibility:0
103+
msgid "Register"
104+
msgstr "Registrat"
105+
106+
#. module: zoook_attachment
107+
#: view:ir.attachment:0
108+
#: field:ir.attachment,esale_saleshop_ids:0
109+
msgid "Websites"
110+
msgstr "Websites"
111+
112+
#. module: zoook_attachment
113+
#: code:addons/zoook_attachment/wizard/wizard_attachment.py:54
114+
#, python-format
115+
msgid "Error!"
116+
msgstr "Error!"
117+
118+
#. module: zoook_attachment
119+
#: code:addons/zoook_attachment/attachment.py:50
120+
#, python-format
121+
msgid "To Unlink this attachment mark visibility is none"
122+
msgstr "Per eliminar aquest adjunt marqui la visibilitat a \"Cap lloc\""
123+
124+
#. module: zoook_attachment
125+
#: selection:esale.sync.attachment.wizard,state:0
126+
msgid "First"
127+
msgstr "Primer"
128+
129+
#. module: zoook_attachment
130+
#: view:ir.attachment:0
131+
msgid "e-sale"
132+
msgstr "e-sale"
133+
134+
#. module: zoook_attachment
135+
#: view:esale.sync.attachment.wizard:0
136+
msgid "Are you sure to export this attachment?"
137+
msgstr "Esteu segurs d'exportar aquest adjunt?"
138+
139+
#. module: zoook_attachment
140+
#: help:ir.attachment,esale_saleshop_ids:0
141+
msgid "Select yours Sale Shops available this attachment"
142+
msgstr "Selecciona les botigues disponibles aquest adjunt"
143+
144+
#. module: zoook_attachment
145+
#: view:sale.shop:0
146+
msgid "Export Attachments. This operation is longer. Are you sure to continue? See logs server process"
147+
msgstr "Exporta adjunts. Aquesta operació pot durar un cert temps. Esteu segurs de continuar? Reviseu historial del servidor."
148+
149+
#. module: zoook_attachment
150+
#: constraint:ir.attachment:0
151+
msgid "File name must be unique!"
152+
msgstr "El nom ha de ser únic."
153+
154+
#. module: zoook_attachment
155+
#: selection:esale.sync.attachment.wizard,state:0
156+
msgid "Done"
157+
msgstr "Fet"
158+
159+
#. module: zoook_attachment
160+
#: field:esale.sync.attachment.wizard,result:0
161+
msgid "Result"
162+
msgstr "Resultat"
163+
164+
#. module: zoook_attachment
165+
#: field:esale.sync.attachment.wizard,esale_sale_shop:0
166+
msgid "Sale Shop"
167+
msgstr "Botigues"
168+
169+
#. module: zoook_attachment
170+
#: model:ir.model,name:zoook_attachment.model_esale_sync_attachment_wizard
171+
msgid "esale.sync.attachment.wizard"
172+
msgstr "esale.sync.attachment.wizard"
173+
174+
#. module: zoook_attachment
175+
#: view:esale.sync.attachment.wizard:0
176+
msgid "Cancel"
177+
msgstr "Cancel·la"
178+
179+
#. module: zoook_attachment
180+
#: view:esale.sync.attachment.wizard:0
181+
msgid "Close"
182+
msgstr "Tanca"
183+
184+
#. module: zoook_attachment
185+
#: model:ir.actions.act_window,name:zoook_attachment.act_esale_sync_attachment
186+
msgid "Export e-Sale"
187+
msgstr "Exporta a e-Sale"
188+

0 commit comments

Comments
 (0)