Merge lp:~sandi-dirntis/openerpsl/account_journal_clause into lp:openerpsl

Proposed by Aleksander Dirntiš
Status: Merged
Merged at revision: 20
Proposed branch: lp:~sandi-dirntis/openerpsl/account_journal_clause
Merge into: lp:openerpsl
Diff against target: 1046 lines (+714/-201)
24 files modified
account_fiscal_position_clause/__init__.py (+0/-25)
account_fiscal_position_clause/__openerp__.py (+0/-42)
account_fiscal_position_clause/account_fiscal_position.py (+0/-33)
account_fiscal_position_clause/account_fiscal_position_view.xml (+0/-17)
account_fiscal_position_clause/i18n/account_fiscal_position_clause.pot (+0/-28)
account_fiscal_position_clause/i18n/en_US.po (+0/-28)
account_fiscal_position_clause/i18n/sl.po (+0/-28)
clause/__init__.py (+29/-0)
clause/__openerp__.py (+48/-0)
clause/account_fiscal_position.py (+41/-0)
clause/account_fiscal_position_view.xml (+15/-0)
clause/account_invoice.py (+51/-0)
clause/account_invoice_view.xml (+17/-0)
clause/clause.py (+35/-0)
clause/clause_view.xml (+49/-0)
clause/data/clause.xml (+9/-0)
clause/i18n/clause.po (+101/-0)
clause/i18n/en_US.po (+101/-0)
clause/i18n/sl.po (+101/-0)
clause/res_partner.py (+32/-0)
clause/res_partner_view.xml (+15/-0)
clause/sale_order.py (+50/-0)
clause/sale_order_view.xml (+17/-0)
clause/security/ir.model.access.csv (+3/-0)
To merge this branch: bzr merge lp:~sandi-dirntis/openerpsl/account_journal_clause
Reviewer Review Type Date Requested Status
Dušan Laznik (Mentis) Pending
Review via email: mp+141046@code.launchpad.net

Description of the change

[ADD] New module "Clauses"

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed directory 'account_fiscal_position_clause'
2=== removed file 'account_fiscal_position_clause/__init__.py'
3--- account_fiscal_position_clause/__init__.py 2012-12-11 11:23:50 +0000
4+++ account_fiscal_position_clause/__init__.py 1970-01-01 00:00:00 +0000
5@@ -1,25 +0,0 @@
6-# -*- coding: utf-8 -*-
7-##############################################################################
8-#
9-# OpenERP, Open Source Management Solution
10-# Copyright (C) 2004-2012 OpenERP s.a. (<http://www.openerp.com>).
11-# Copyright (C) 2012 Mentis d.o.o. (<http://www.mentis.si>)
12-#
13-# This program is free software: you can redistribute it and/or modify
14-# it under the terms of the GNU Affero General Public License as
15-# published by the Free Software Foundation, either version 3 of the
16-# License, or (at your option) any later version.
17-#
18-# This program is distributed in the hope that it will be useful,
19-# but WITHOUT ANY WARRANTY; without even the implied warranty of
20-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21-# GNU Affero General Public License for more details.
22-#
23-# You should have received a copy of the GNU Affero General Public License
24-# along with this program. If not, see <http://www.gnu.org/licenses/>.
25-#
26-##############################################################################
27-
28-import account_fiscal_position
29-
30-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
31
32=== removed file 'account_fiscal_position_clause/__openerp__.py'
33--- account_fiscal_position_clause/__openerp__.py 2012-12-11 11:23:50 +0000
34+++ account_fiscal_position_clause/__openerp__.py 1970-01-01 00:00:00 +0000
35@@ -1,42 +0,0 @@
36-# -*- coding: utf-8 -*-
37-##############################################################################
38-#
39-# OpenERP, Open Source Management Solution
40-# Copyright (C) 2004-2012 OpenERP s.a. (<http://www.openerp.com>).
41-# Copyright (C) 2012 Mentis d.o.o. (<http://www.mentis.si>)
42-#
43-# This program is free software: you can redistribute it and/or modify
44-# it under the terms of the GNU Affero General Public License as
45-# published by the Free Software Foundation, either version 3 of the
46-# License, or (at your option) any later version.
47-#
48-# This program is distributed in the hope that it will be useful,
49-# but WITHOUT ANY WARRANTY; without even the implied warranty of
50-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51-# GNU Affero General Public License for more details.
52-#
53-# You should have received a copy of the GNU Affero General Public License
54-# along with this program. If not, see <http://www.gnu.org/licenses/>.
55-#
56-##############################################################################
57-
58-
59-{
60- 'name': 'Invoice Clause On Fiscal Position',
61- 'version': '1.0',
62- 'category': 'Accounting',
63- 'description': """
64- This module adds new text field on fiscal position.
65-
66- New field 'Clause' on fiscal position is used to write additional text on invoice.
67- """,
68- 'author': 'Mentis d.o.o.',
69- 'depends': ['account'],
70- 'init_xml': [],
71- 'update_xml': ['account_fiscal_position_view.xml',
72- ],
73- 'demo_xml': [],
74- 'installable': True,
75- 'active': False,
76-}
77-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
78
79=== removed file 'account_fiscal_position_clause/account_fiscal_position.py'
80--- account_fiscal_position_clause/account_fiscal_position.py 2012-12-11 11:23:50 +0000
81+++ account_fiscal_position_clause/account_fiscal_position.py 1970-01-01 00:00:00 +0000
82@@ -1,33 +0,0 @@
83-# -*- coding: utf-8 -*-
84-##############################################################################
85-#
86-# OpenERP, Open Source Management Solution
87-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
88-# Copyright (C) 2012 Mentis d.o.o.
89-#
90-# This program is free software: you can redistribute it and/or modify
91-# it under the terms of the GNU Affero General Public License as
92-# published by the Free Software Foundation, either version 3 of the
93-# License, or (at your option) any later version.
94-#
95-# This program is distributed in the hope that it will be useful,
96-# but WITHOUT ANY WARRANTY; without even the implied warranty of
97-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98-# GNU Affero General Public License for more details.
99-#
100-# You should have received a copy of the GNU Affero General Public License
101-# along with this program. If not, see <http://www.gnu.org/licenses/>.
102-#
103-##############################################################################
104-
105-from osv import fields, osv
106-from tools.translate import _
107-
108-class account_fiscal_position(osv.osv):
109- _inherit = 'account.fiscal.position'
110-
111- _columns = {
112- 'clause': fields.text('Clause', translate=True),
113- }
114-
115-account_fiscal_position()
116\ No newline at end of file
117
118=== removed file 'account_fiscal_position_clause/account_fiscal_position_view.xml'
119--- account_fiscal_position_clause/account_fiscal_position_view.xml 2012-12-11 11:23:50 +0000
120+++ account_fiscal_position_clause/account_fiscal_position_view.xml 1970-01-01 00:00:00 +0000
121@@ -1,17 +0,0 @@
122-<?xml version="1.0" encoding="utf-8"?>
123-<openerp>
124- <data>
125- <record id="view_account_position_form" model="ir.ui.view">
126- <field name="name">account.fiscal.position.clause.form</field>
127- <field name="model">account.fiscal.position</field>
128- <field name="inherit_id" ref="account.view_account_position_form"/>
129- <field name="type">form</field>
130- <field name="arch" type="xml">
131- <field name="note" position="after">
132- <separator string="Clause" colspan="4"/>
133- <field name="clause" colspan="4" nolabel="1"/>
134- </field>
135- </field>
136- </record>
137- </data>
138-</openerp>
139
140=== removed directory 'account_fiscal_position_clause/i18n'
141=== removed file 'account_fiscal_position_clause/i18n/account_fiscal_position_clause.pot'
142--- account_fiscal_position_clause/i18n/account_fiscal_position_clause.pot 2012-12-11 11:23:50 +0000
143+++ account_fiscal_position_clause/i18n/account_fiscal_position_clause.pot 1970-01-01 00:00:00 +0000
144@@ -1,28 +0,0 @@
145-# Translation of OpenERP Server.
146-# This file contains the translation of the following modules:
147-# * account_fiscal_position_clause
148-#
149-msgid ""
150-msgstr ""
151-"Project-Id-Version: OpenERP Server 6.1\n"
152-"Report-Msgid-Bugs-To: \n"
153-"POT-Creation-Date: 2012-10-09 12:12+0000\n"
154-"PO-Revision-Date: 2012-10-09 12:12+0000\n"
155-"Last-Translator: <>\n"
156-"Language-Team: \n"
157-"MIME-Version: 1.0\n"
158-"Content-Type: text/plain; charset=UTF-8\n"
159-"Content-Transfer-Encoding: \n"
160-"Plural-Forms: \n"
161-
162-#. module: account_fiscal_position_clause
163-#: view:account.fiscal.position:0
164-#: field:account.fiscal.position,clause:0
165-msgid "Clause"
166-msgstr ""
167-
168-#. module: account_fiscal_position_clause
169-#: model:ir.model,name:account_fiscal_position_clause.model_account_fiscal_position
170-msgid "Fiscal Position"
171-msgstr ""
172-
173
174=== removed file 'account_fiscal_position_clause/i18n/en_US.po'
175--- account_fiscal_position_clause/i18n/en_US.po 2012-12-11 11:23:50 +0000
176+++ account_fiscal_position_clause/i18n/en_US.po 1970-01-01 00:00:00 +0000
177@@ -1,28 +0,0 @@
178-# Translation of OpenERP Server.
179-# This file contains the translation of the following modules:
180-# * account_fiscal_position_clause
181-#
182-msgid ""
183-msgstr ""
184-"Project-Id-Version: OpenERP Server 6.1\n"
185-"Report-Msgid-Bugs-To: \n"
186-"POT-Creation-Date: 2012-10-09 12:12+0000\n"
187-"PO-Revision-Date: 2012-10-09 12:12+0000\n"
188-"Last-Translator: <>\n"
189-"Language-Team: \n"
190-"MIME-Version: 1.0\n"
191-"Content-Type: text/plain; charset=UTF-8\n"
192-"Content-Transfer-Encoding: \n"
193-"Plural-Forms: \n"
194-
195-#. module: account_fiscal_position_clause
196-#: view:account.fiscal.position:0
197-#: field:account.fiscal.position,clause:0
198-msgid "Clause"
199-msgstr "Clause"
200-
201-#. module: account_fiscal_position_clause
202-#: model:ir.model,name:account_fiscal_position_clause.model_account_fiscal_position
203-msgid "Fiscal Position"
204-msgstr "Fiscal Position"
205-
206
207=== removed file 'account_fiscal_position_clause/i18n/sl.po'
208--- account_fiscal_position_clause/i18n/sl.po 2012-12-11 11:23:50 +0000
209+++ account_fiscal_position_clause/i18n/sl.po 1970-01-01 00:00:00 +0000
210@@ -1,28 +0,0 @@
211-# Translation of OpenERP Server.
212-# This file contains the translation of the following modules:
213-# * account_fiscal_position_clause
214-#
215-msgid ""
216-msgstr ""
217-"Project-Id-Version: OpenERP Server 6.1\n"
218-"Report-Msgid-Bugs-To: \n"
219-"POT-Creation-Date: 2012-10-09 12:12+0000\n"
220-"PO-Revision-Date: 2012-10-09 12:12+0000\n"
221-"Last-Translator: <>\n"
222-"Language-Team: \n"
223-"MIME-Version: 1.0\n"
224-"Content-Type: text/plain; charset=UTF-8\n"
225-"Content-Transfer-Encoding: \n"
226-"Plural-Forms: \n"
227-
228-#. module: account_fiscal_position_clause
229-#: view:account.fiscal.position:0
230-#: field:account.fiscal.position,clause:0
231-msgid "Clause"
232-msgstr "Klavzula"
233-
234-#. module: account_fiscal_position_clause
235-#: model:ir.model,name:account_fiscal_position_clause.model_account_fiscal_position
236-msgid "Fiscal Position"
237-msgstr "Davčno območje"
238-
239
240=== added directory 'clause'
241=== added file 'clause/__init__.py'
242--- clause/__init__.py 1970-01-01 00:00:00 +0000
243+++ clause/__init__.py 2012-12-21 09:51:22 +0000
244@@ -0,0 +1,29 @@
245+# -*- coding: utf-8 -*-
246+##############################################################################
247+#
248+# OpenERP, Open Source Management Solution
249+# Copyright (C) 2004-2012 OpenERP s.a. (<http://www.openerp.com>).
250+# Copyright (C) 2012 Mentis d.o.o. (<http://www.mentis.si>)
251+#
252+# This program is free software: you can redistribute it and/or modify
253+# it under the terms of the GNU Affero General Public License as
254+# published by the Free Software Foundation, either version 3 of the
255+# License, or (at your option) any later version.
256+#
257+# This program is distributed in the hope that it will be useful,
258+# but WITHOUT ANY WARRANTY; without even the implied warranty of
259+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
260+# GNU Affero General Public License for more details.
261+#
262+# You should have received a copy of the GNU Affero General Public License
263+# along with this program. If not, see <http://www.gnu.org/licenses/>.
264+#
265+##############################################################################
266+
267+import clause
268+import account_fiscal_position
269+import res_partner
270+import account_invoice
271+import sale_order
272+
273+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
274
275=== added file 'clause/__openerp__.py'
276--- clause/__openerp__.py 1970-01-01 00:00:00 +0000
277+++ clause/__openerp__.py 2012-12-21 09:51:22 +0000
278@@ -0,0 +1,48 @@
279+# -*- coding: utf-8 -*-
280+##############################################################################
281+#
282+# OpenERP, Open Source Management Solution
283+# Copyright (C) 2004-2012 OpenERP s.a. (<http://www.openerp.com>).
284+# Copyright (C) 2012 Mentis d.o.o. (<http://www.mentis.si>)
285+#
286+# This program is free software: you can redistribute it and/or modify
287+# it under the terms of the GNU Affero General Public License as
288+# published by the Free Software Foundation, either version 3 of the
289+# License, or (at your option) any later version.
290+#
291+# This program is distributed in the hope that it will be useful,
292+# but WITHOUT ANY WARRANTY; without even the implied warranty of
293+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
294+# GNU Affero General Public License for more details.
295+#
296+# You should have received a copy of the GNU Affero General Public License
297+# along with this program. If not, see <http://www.gnu.org/licenses/>.
298+#
299+##############################################################################
300+
301+
302+{
303+ 'name': 'Clauses',
304+ 'version': '1.0',
305+ 'category': 'General',
306+ 'description': """
307+ This module adds clauses to documents.
308+
309+ """,
310+ 'author': 'Mentis d.o.o.',
311+ 'depends': ['account','sale'],
312+ 'init_xml': [
313+ 'data/clause.xml',
314+ ],
315+ 'data': [
316+ 'clause_view.xml',
317+ 'account_fiscal_position_view.xml',
318+ 'res_partner_view.xml',
319+ 'account_invoice_view.xml',
320+ 'sale_order_view.xml',
321+ 'security/ir.model.access.csv',
322+ ],
323+ 'installable': True,
324+ 'active': False,
325+}
326+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
327
328=== added file 'clause/account_fiscal_position.py'
329--- clause/account_fiscal_position.py 1970-01-01 00:00:00 +0000
330+++ clause/account_fiscal_position.py 2012-12-21 09:51:22 +0000
331@@ -0,0 +1,41 @@
332+# -*- coding: utf-8 -*-
333+##############################################################################
334+#
335+# OpenERP, Open Source Management Solution
336+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
337+# Copyright (C) 2012 Mentis d.o.o.
338+#
339+# This program is free software: you can redistribute it and/or modify
340+# it under the terms of the GNU Affero General Public License as
341+# published by the Free Software Foundation, either version 3 of the
342+# License, or (at your option) any later version.
343+#
344+# This program is distributed in the hope that it will be useful,
345+# but WITHOUT ANY WARRANTY; without even the implied warranty of
346+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
347+# GNU Affero General Public License for more details.
348+#
349+# You should have received a copy of the GNU Affero General Public License
350+# along with this program. If not, see <http://www.gnu.org/licenses/>.
351+#
352+##############################################################################
353+
354+from osv import fields, osv
355+from tools.translate import _
356+
357+class account_fiscal_position(osv.osv):
358+ _inherit = 'account.fiscal.position'
359+
360+ def _get_clause_id(self, cr, uid, *args):
361+ cr.execute('select id from clause order by id limit 1')
362+ res = cr.fetchone()
363+ return res and res[0] or False
364+
365+ _columns = {
366+ 'default_clause': fields.many2one('clause', 'Default Clause', required=True, help="Clause to be written on output documents when there is no other clause set on partner."),
367+ }
368+ _defaults = {
369+ 'default_clause': _get_clause_id,
370+ }
371+
372+account_fiscal_position()
373
374=== added file 'clause/account_fiscal_position_view.xml'
375--- clause/account_fiscal_position_view.xml 1970-01-01 00:00:00 +0000
376+++ clause/account_fiscal_position_view.xml 2012-12-21 09:51:22 +0000
377@@ -0,0 +1,15 @@
378+<?xml version="1.0" encoding="utf-8"?>
379+<openerp>
380+ <data>
381+ <record id="view_account_position_clause_form" model="ir.ui.view">
382+ <field name="name">account.fiscal.position.clause.form</field>
383+ <field name="model">account.fiscal.position</field>
384+ <field name="inherit_id" ref="account.view_account_position_form"/>
385+ <field name="arch" type="xml">
386+ <field name="active" position="after">
387+ <field name="default_clause"/>
388+ </field>
389+ </field>
390+ </record>
391+ </data>
392+</openerp>
393
394=== added file 'clause/account_invoice.py'
395--- clause/account_invoice.py 1970-01-01 00:00:00 +0000
396+++ clause/account_invoice.py 2012-12-21 09:51:22 +0000
397@@ -0,0 +1,51 @@
398+# -*- coding: utf-8 -*-
399+##############################################################################
400+#
401+# OpenERP, Open Source Management Solution
402+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
403+# Copyright (C) 2012 Mentis d.o.o.
404+#
405+# This program is free software: you can redistribute it and/or modify
406+# it under the terms of the GNU Affero General Public License as
407+# published by the Free Software Foundation, either version 3 of the
408+# License, or (at your option) any later version.
409+#
410+# This program is distributed in the hope that it will be useful,
411+# but WITHOUT ANY WARRANTY; without even the implied warranty of
412+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
413+# GNU Affero General Public License for more details.
414+#
415+# You should have received a copy of the GNU Affero General Public License
416+# along with this program. If not, see <http://www.gnu.org/licenses/>.
417+#
418+##############################################################################
419+
420+from osv import fields, osv
421+from tools.translate import _
422+
423+class account_invoice(osv.osv):
424+ _inherit = "account.invoice"
425+
426+ def onchange_partner_id(self, cr, uid, ids, type, partner_id, date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
427+ result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id, company_id)
428+ if 'out_invoice' in type or 'out_refund' in type:
429+ clause_id = False;
430+ partner = self.pool.get('res.partner').browse(cr, uid, [partner_id])[0]
431+ if partner.default_clause:
432+ clause_id = partner.default_clause.id
433+ else:
434+ if result['value']['fiscal_position']:
435+ fiscal_position = self.pool.get('account.fiscal.position').browse(cr, uid, [result['value']['fiscal_position']])[0]
436+ if fiscal_position.default_clause:
437+ clause_id = fiscal_position.default_clause.id
438+ if clause_id:
439+ result['value']['clause_ids'] = [clause_id]
440+ else:
441+ result['value']['clause_ids'] = []
442+ return result
443+
444+ _columns = {
445+ 'clause_ids': fields.many2many('clause', 'account_invoice_clause', 'invoice_id', 'clause_id', 'Clauses'),
446+ }
447+
448+account_invoice()
449\ No newline at end of file
450
451=== added file 'clause/account_invoice_view.xml'
452--- clause/account_invoice_view.xml 1970-01-01 00:00:00 +0000
453+++ clause/account_invoice_view.xml 2012-12-21 09:51:22 +0000
454@@ -0,0 +1,17 @@
455+<?xml version="1.0" encoding="utf-8"?>
456+<openerp>
457+ <data>
458+ <record id="invoice_clause_form_view" model="ir.ui.view">
459+ <field name="name">account.invoice.clause.form</field>
460+ <field name="model">account.invoice</field>
461+ <field name="inherit_id" ref="account.invoice_form"/>
462+ <field name="arch" type="xml">
463+ <page string="Invoice Lines" position="after">
464+ <page string="Clauses" attrs="{'readonly':[('state','=','done')]}">
465+ <field name="clause_ids"/>
466+ </page>
467+ </page>
468+ </field>
469+ </record>
470+ </data>
471+</openerp>
472
473=== added file 'clause/clause.py'
474--- clause/clause.py 1970-01-01 00:00:00 +0000
475+++ clause/clause.py 2012-12-21 09:51:22 +0000
476@@ -0,0 +1,35 @@
477+# -*- coding: utf-8 -*-
478+##############################################################################
479+#
480+# OpenERP, Open Source Management Solution
481+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
482+# Copyright (C) 2012 Mentis d.o.o.
483+#
484+# This program is free software: you can redistribute it and/or modify
485+# it under the terms of the GNU Affero General Public License as
486+# published by the Free Software Foundation, either version 3 of the
487+# License, or (at your option) any later version.
488+#
489+# This program is distributed in the hope that it will be useful,
490+# but WITHOUT ANY WARRANTY; without even the implied warranty of
491+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
492+# GNU Affero General Public License for more details.
493+#
494+# You should have received a copy of the GNU Affero General Public License
495+# along with this program. If not, see <http://www.gnu.org/licenses/>.
496+#
497+##############################################################################
498+
499+from osv import fields, osv
500+from tools.translate import _
501+
502+class clause(osv.osv):
503+ _name = "clause"
504+ _description = "Clause"
505+ _order = "name"
506+ _columns = {
507+ 'name': fields.char('Name', size=64, required=True, select=True, help="Short Clause Description"),
508+ 'text': fields.text('Text on report', translate=True, help="Text printed on documents."),
509+ }
510+
511+clause()
512\ No newline at end of file
513
514=== added file 'clause/clause_view.xml'
515--- clause/clause_view.xml 1970-01-01 00:00:00 +0000
516+++ clause/clause_view.xml 2012-12-21 09:51:22 +0000
517@@ -0,0 +1,49 @@
518+<?xml version="1.0" encoding="utf-8"?>
519+<openerp>
520+ <data>
521+ <record id="clause_tree_view" model="ir.ui.view">
522+ <field name="name">clause.tree</field>
523+ <field name="model">clause</field>
524+ <field name="arch" type="xml">
525+ <tree string="Clauses" editable="bottom">
526+ <field name="name"/>
527+ <field name="text"/>
528+ </tree>
529+ </field>
530+ </record>
531+
532+ <record id="clause_form_view" model="ir.ui.view">
533+ <field name="name">clause.form</field>
534+ <field name="model">clause</field>
535+ <field name="arch" type="xml">
536+ <form string="Clauses" version="7.0">
537+ <group>
538+ <field name="name"/>
539+ <field name="text"/>
540+ </group>
541+ </form>
542+ </field>
543+ </record>
544+
545+ <record id="clause_search_view" model="ir.ui.view">
546+ <field name="name">clause.search</field>
547+ <field name="model">clause</field>
548+ <field name="arch" type="xml">
549+ <search string="Clauses">
550+ <field name="name" string="Clause"/>
551+ </search>
552+ </field>
553+ </record>
554+
555+ <record id="action_clause_form" model="ir.actions.act_window">
556+ <field name="name">Clauses</field>
557+ <field name="res_model">clause</field>
558+ <field name="view_type">form</field>
559+ <field name="view_mode">tree,form</field>
560+ <field name="search_view_id" ref="clause_search_view"/>
561+ </record>
562+ <menuitem action="action_clause_form" id="menu_action_account_clause_form" parent="account.menu_configuration_misc"/>
563+ <menuitem action="action_clause_form" id="menu_action_sale_clause_form" parent="base.menu_base_config"/>
564+
565+ </data>
566+</openerp>
567\ No newline at end of file
568
569=== added directory 'clause/data'
570=== added file 'clause/data/clause.xml'
571--- clause/data/clause.xml 1970-01-01 00:00:00 +0000
572+++ clause/data/clause.xml 2012-12-21 09:51:22 +0000
573@@ -0,0 +1,9 @@
574+<?xml version="1.0" encoding="utf-8"?>
575+<openerp>
576+ <data noupdate="1">
577+ <record model="clause">
578+ <field name="name">Default</field>
579+ <field name="text"></field>
580+ </record>
581+ </data>
582+</openerp>
583
584=== added directory 'clause/i18n'
585=== added file 'clause/i18n/clause.po'
586--- clause/i18n/clause.po 1970-01-01 00:00:00 +0000
587+++ clause/i18n/clause.po 2012-12-21 09:51:22 +0000
588@@ -0,0 +1,101 @@
589+# Translation of OpenERP Server.
590+# This file contains the translation of the following modules:
591+# * clause
592+#
593+msgid ""
594+msgstr ""
595+"Project-Id-Version: OpenERP Server 7.0alpha\n"
596+"Report-Msgid-Bugs-To: \n"
597+"POT-Creation-Date: 2012-12-21 07:47+0000\n"
598+"PO-Revision-Date: 2012-12-21 07:47+0000\n"
599+"Last-Translator: <>\n"
600+"Language-Team: \n"
601+"MIME-Version: 1.0\n"
602+"Content-Type: text/plain; charset=UTF-8\n"
603+"Content-Transfer-Encoding: \n"
604+"Plural-Forms: \n"
605+
606+#. module: clause
607+#: help:clause,text:0
608+msgid "Text printed on documents."
609+msgstr ""
610+
611+#. module: clause
612+#: model:ir.model,name:clause.model_sale_order
613+msgid "Sales Order"
614+msgstr ""
615+
616+#. module: clause
617+#: field:clause,name:0
618+msgid "Name"
619+msgstr ""
620+
621+#. module: clause
622+#: view:clause:0
623+#: model:ir.model,name:clause.model_clause
624+msgid "Clause"
625+msgstr ""
626+
627+#. module: clause
628+#: help:account.fiscal.position,default_clause:0
629+msgid "Clause to be written on output documents when there is no other clause set on partner."
630+msgstr ""
631+
632+#. module: clause
633+#: help:clause,name:0
634+msgid "Short Clause Description"
635+msgstr ""
636+
637+#. module: clause
638+#: field:clause,text:0
639+msgid "Text on report"
640+msgstr ""
641+
642+#. module: clause
643+#: model:ir.model,name:clause.model_account_fiscal_position
644+msgid "Fiscal Position"
645+msgstr ""
646+
647+#. module: clause
648+#: model:ir.model,name:clause.model_account_invoice
649+msgid "Invoice"
650+msgstr ""
651+
652+#. module: clause
653+#: model:ir.model,name:clause.model_res_partner
654+msgid "Partner"
655+msgstr ""
656+
657+#. module: clause
658+#: field:account.fiscal.position,default_clause:0
659+#: field:res.partner,default_clause:0
660+msgid "Default Clause"
661+msgstr ""
662+
663+#. module: clause
664+#: view:account.invoice:0
665+#: field:account.invoice,clause_ids:0
666+#: view:clause:0
667+#: model:ir.actions.act_window,name:clause.action_clause_form
668+#: model:ir.ui.menu,name:clause.menu_action_account_clause_form
669+#: model:ir.ui.menu,name:clause.menu_action_sale_clause_form
670+#: view:sale.order:0
671+#: field:sale.order,clause_ids:0
672+msgid "Clauses"
673+msgstr ""
674+
675+#. module: clause
676+#: view:sale.order:0
677+msgid "Order Lines"
678+msgstr ""
679+
680+#. module: clause
681+#: help:res.partner,default_clause:0
682+msgid "Clause to be written on output documents for this partner."
683+msgstr ""
684+
685+#. module: clause
686+#: view:account.invoice:0
687+msgid "Invoice Lines"
688+msgstr ""
689+
690
691=== added file 'clause/i18n/en_US.po'
692--- clause/i18n/en_US.po 1970-01-01 00:00:00 +0000
693+++ clause/i18n/en_US.po 2012-12-21 09:51:22 +0000
694@@ -0,0 +1,101 @@
695+# Translation of OpenERP Server.
696+# This file contains the translation of the following modules:
697+# * clause
698+#
699+msgid ""
700+msgstr ""
701+"Project-Id-Version: OpenERP Server 7.0alpha\n"
702+"Report-Msgid-Bugs-To: \n"
703+"POT-Creation-Date: 2012-12-21 07:47+0000\n"
704+"PO-Revision-Date: 2012-12-21 07:47+0000\n"
705+"Last-Translator: <>\n"
706+"Language-Team: \n"
707+"MIME-Version: 1.0\n"
708+"Content-Type: text/plain; charset=UTF-8\n"
709+"Content-Transfer-Encoding: \n"
710+"Plural-Forms: \n"
711+
712+#. module: clause
713+#: help:clause,text:0
714+msgid "Text printed on documents."
715+msgstr ""
716+
717+#. module: clause
718+#: model:ir.model,name:clause.model_sale_order
719+msgid "Sales Order"
720+msgstr ""
721+
722+#. module: clause
723+#: field:clause,name:0
724+msgid "Name"
725+msgstr ""
726+
727+#. module: clause
728+#: view:clause:0
729+#: model:ir.model,name:clause.model_clause
730+msgid "Clause"
731+msgstr ""
732+
733+#. module: clause
734+#: help:account.fiscal.position,default_clause:0
735+msgid "Clause to be written on output documents when there is no other clause set on partner."
736+msgstr ""
737+
738+#. module: clause
739+#: help:clause,name:0
740+msgid "Short Clause Description"
741+msgstr ""
742+
743+#. module: clause
744+#: field:clause,text:0
745+msgid "Text on report"
746+msgstr ""
747+
748+#. module: clause
749+#: model:ir.model,name:clause.model_account_fiscal_position
750+msgid "Fiscal Position"
751+msgstr ""
752+
753+#. module: clause
754+#: model:ir.model,name:clause.model_account_invoice
755+msgid "Invoice"
756+msgstr ""
757+
758+#. module: clause
759+#: model:ir.model,name:clause.model_res_partner
760+msgid "Partner"
761+msgstr ""
762+
763+#. module: clause
764+#: field:account.fiscal.position,default_clause:0
765+#: field:res.partner,default_clause:0
766+msgid "Default Clause"
767+msgstr ""
768+
769+#. module: clause
770+#: view:account.invoice:0
771+#: field:account.invoice,clause_ids:0
772+#: view:clause:0
773+#: model:ir.actions.act_window,name:clause.action_clause_form
774+#: model:ir.ui.menu,name:clause.menu_action_account_clause_form
775+#: model:ir.ui.menu,name:clause.menu_action_sale_clause_form
776+#: view:sale.order:0
777+#: field:sale.order,clause_ids:0
778+msgid "Clauses"
779+msgstr ""
780+
781+#. module: clause
782+#: view:sale.order:0
783+msgid "Order Lines"
784+msgstr ""
785+
786+#. module: clause
787+#: help:res.partner,default_clause:0
788+msgid "Clause to be written on output documents for this partner."
789+msgstr ""
790+
791+#. module: clause
792+#: view:account.invoice:0
793+msgid "Invoice Lines"
794+msgstr ""
795+
796
797=== added file 'clause/i18n/sl.po'
798--- clause/i18n/sl.po 1970-01-01 00:00:00 +0000
799+++ clause/i18n/sl.po 2012-12-21 09:51:22 +0000
800@@ -0,0 +1,101 @@
801+# Translation of OpenERP Server.
802+# This file contains the translation of the following modules:
803+# * clause
804+#
805+msgid ""
806+msgstr ""
807+"Project-Id-Version: OpenERP Server 7.0alpha\n"
808+"Report-Msgid-Bugs-To: \n"
809+"POT-Creation-Date: 2012-12-21 07:47+0000\n"
810+"PO-Revision-Date: 2012-12-21 07:47+0000\n"
811+"Last-Translator: <>\n"
812+"Language-Team: \n"
813+"MIME-Version: 1.0\n"
814+"Content-Type: text/plain; charset=UTF-8\n"
815+"Content-Transfer-Encoding: \n"
816+"Plural-Forms: \n"
817+
818+#. module: clause
819+#: help:clause,text:0
820+msgid "Text printed on documents."
821+msgstr "Tekst izpisan na dokumentu"
822+
823+#. module: clause
824+#: model:ir.model,name:clause.model_sale_order
825+msgid "Sales Order"
826+msgstr "Prodajni nalog"
827+
828+#. module: clause
829+#: field:clause,name:0
830+msgid "Name"
831+msgstr "Naziv"
832+
833+#. module: clause
834+#: view:clause:0
835+#: model:ir.model,name:clause.model_clause
836+msgid "Clause"
837+msgstr "Klavzula"
838+
839+#. module: clause
840+#: help:account.fiscal.position,default_clause:0
841+msgid "Clause to be written on output documents when there is no other clause set on partner."
842+msgstr "Klavzula, ki bo izpisana na dokumentu kadar partner nima določene svoje klavzule."
843+
844+#. module: clause
845+#: help:clause,name:0
846+msgid "Short Clause Description"
847+msgstr "Kratek opis"
848+
849+#. module: clause
850+#: field:clause,text:0
851+msgid "Text on report"
852+msgstr "Tekst na dokumentih"
853+
854+#. module: clause
855+#: model:ir.model,name:clause.model_account_fiscal_position
856+msgid "Fiscal Position"
857+msgstr "Davčno območje"
858+
859+#. module: clause
860+#: model:ir.model,name:clause.model_account_invoice
861+msgid "Invoice"
862+msgstr "Račun"
863+
864+#. module: clause
865+#: model:ir.model,name:clause.model_res_partner
866+msgid "Partner"
867+msgstr "Partner"
868+
869+#. module: clause
870+#: field:account.fiscal.position,default_clause:0
871+#: field:res.partner,default_clause:0
872+msgid "Default Clause"
873+msgstr "Privzeta klavzula"
874+
875+#. module: clause
876+#: view:account.invoice:0
877+#: field:account.invoice,clause_ids:0
878+#: view:clause:0
879+#: model:ir.actions.act_window,name:clause.action_clause_form
880+#: model:ir.ui.menu,name:clause.menu_action_account_clause_form
881+#: model:ir.ui.menu,name:clause.menu_action_sale_clause_form
882+#: view:sale.order:0
883+#: field:sale.order,clause_ids:0
884+msgid "Clauses"
885+msgstr "Klavzule"
886+
887+#. module: clause
888+#: view:sale.order:0
889+msgid "Order Lines"
890+msgstr "Postavke naloga"
891+
892+#. module: clause
893+#: help:res.partner,default_clause:0
894+msgid "Clause to be written on output documents for this partner."
895+msgstr "Klavzula, ki bo izpisana na dokumentih tega partnerja"
896+
897+#. module: clause
898+#: view:account.invoice:0
899+msgid "Invoice Lines"
900+msgstr "Postavke računa"
901+
902
903=== added file 'clause/res_partner.py'
904--- clause/res_partner.py 1970-01-01 00:00:00 +0000
905+++ clause/res_partner.py 2012-12-21 09:51:22 +0000
906@@ -0,0 +1,32 @@
907+# -*- coding: utf-8 -*-
908+##############################################################################
909+#
910+# OpenERP, Open Source Management Solution
911+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
912+# Copyright (C) 2012 Mentis d.o.o.
913+#
914+# This program is free software: you can redistribute it and/or modify
915+# it under the terms of the GNU Affero General Public License as
916+# published by the Free Software Foundation, either version 3 of the
917+# License, or (at your option) any later version.
918+#
919+# This program is distributed in the hope that it will be useful,
920+# but WITHOUT ANY WARRANTY; without even the implied warranty of
921+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
922+# GNU Affero General Public License for more details.
923+#
924+# You should have received a copy of the GNU Affero General Public License
925+# along with this program. If not, see <http://www.gnu.org/licenses/>.
926+#
927+##############################################################################
928+
929+from osv import fields, osv
930+from tools.translate import _
931+
932+class res_partner(osv.osv):
933+ _inherit = 'res.partner'
934+ _columns = {
935+ 'default_clause': fields.many2one('clause', 'Default Clause', help="Clause to be written on output documents for this partner."),
936+ }
937+
938+res_partner()
939\ No newline at end of file
940
941=== added file 'clause/res_partner_view.xml'
942--- clause/res_partner_view.xml 1970-01-01 00:00:00 +0000
943+++ clause/res_partner_view.xml 2012-12-21 09:51:22 +0000
944@@ -0,0 +1,15 @@
945+<?xml version="1.0" encoding="utf-8"?>
946+<openerp>
947+ <data>
948+ <record id="view_partner_clause_form" model="ir.ui.view">
949+ <field name="name">res.partner.clause.form</field>
950+ <field name="model">res.partner</field>
951+ <field name="inherit_id" ref="base.view_partner_form"/>
952+ <field name="arch" type="xml">
953+ <field name="lang" position="after">
954+ <field name="default_clause" attrs="{'invisible': [('customer','=', False)]}"/>
955+ </field>
956+ </field>
957+ </record>
958+ </data>
959+</openerp>
960
961=== added file 'clause/sale_order.py'
962--- clause/sale_order.py 1970-01-01 00:00:00 +0000
963+++ clause/sale_order.py 2012-12-21 09:51:22 +0000
964@@ -0,0 +1,50 @@
965+# -*- coding: utf-8 -*-
966+##############################################################################
967+#
968+# OpenERP, Open Source Management Solution
969+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
970+# Copyright (C) 2012 Mentis d.o.o.
971+#
972+# This program is free software: you can redistribute it and/or modify
973+# it under the terms of the GNU Affero General Public License as
974+# published by the Free Software Foundation, either version 3 of the
975+# License, or (at your option) any later version.
976+#
977+# This program is distributed in the hope that it will be useful,
978+# but WITHOUT ANY WARRANTY; without even the implied warranty of
979+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
980+# GNU Affero General Public License for more details.
981+#
982+# You should have received a copy of the GNU Affero General Public License
983+# along with this program. If not, see <http://www.gnu.org/licenses/>.
984+#
985+##############################################################################
986+
987+from osv import fields, osv
988+from tools.translate import _
989+
990+class sale_order(osv.osv):
991+ _inherit = "sale.order"
992+
993+ def onchange_partner_id(self, cr, uid, ids, part, context=None):
994+ result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part)
995+ clause_id = False;
996+ partner = self.pool.get('res.partner').browse(cr, uid, [part])[0]
997+ if partner.default_clause:
998+ clause_id = partner.default_clause.id
999+ else:
1000+ if result['value']['fiscal_position']:
1001+ fiscal_position = self.pool.get('account.fiscal.position').browse(cr, uid, [result['value']['fiscal_position']])[0]
1002+ if fiscal_position.default_clause:
1003+ clause_id = fiscal_position.default_clause.id
1004+ if clause_id:
1005+ result['value']['clause_ids'] = [clause_id]
1006+ else:
1007+ result['value']['clause_ids'] = []
1008+ return result
1009+
1010+ _columns = {
1011+ 'clause_ids': fields.many2many('clause', 'sale_order_clause', 'order_id', 'clause_id', 'Clauses'),
1012+ }
1013+
1014+sale_order()
1015\ No newline at end of file
1016
1017=== added file 'clause/sale_order_view.xml'
1018--- clause/sale_order_view.xml 1970-01-01 00:00:00 +0000
1019+++ clause/sale_order_view.xml 2012-12-21 09:51:22 +0000
1020@@ -0,0 +1,17 @@
1021+<?xml version="1.0" encoding="utf-8"?>
1022+<openerp>
1023+ <data>
1024+ <record id="sale_order_clause_form_view" model="ir.ui.view">
1025+ <field name="name">sale_order.clause.form</field>
1026+ <field name="model">sale.order</field>
1027+ <field name="inherit_id" ref="sale.view_order_form"/>
1028+ <field name="arch" type="xml">
1029+ <page string="Order Lines" position="after">
1030+ <page string="Clauses" attrs="{'readonly':[('state','=','done')]}">
1031+ <field name="clause_ids"/>
1032+ </page>
1033+ </page>
1034+ </field>
1035+ </record>
1036+ </data>
1037+</openerp>
1038
1039=== added directory 'clause/security'
1040=== added file 'clause/security/ir.model.access.csv'
1041--- clause/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
1042+++ clause/security/ir.model.access.csv 2012-12-21 09:51:22 +0000
1043@@ -0,0 +1,3 @@
1044+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
1045+access_account_clause,clause,model_clause,account.group_account_user,1,0,0,0
1046+access_sale_clause,clause,model_clause,base.group_sale_salesman,1,0,0,0

Subscribers

People subscribed via source and target branches