~openerp-commiter/openobject-addons/extra-6.0

« back to all changes in this revision

Viewing changes to dm_edition/dm_edition.py

  • Committer: pso
  • Date: 2009-11-05 08:31:57 UTC
  • Revision ID: pso@tinyerp.com-20091105083157-4ftat3d3wu70vvgu
[ADD] dm_edition: Added new module

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- encoding: utf-8 -*-
 
2
##############################################################################
 
3
#    
 
4
#    OpenERP, Open Source Management Solution
 
5
#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
 
6
#
 
7
#    This program is free software: you can redistribute it and/or modify
 
8
#    it under the terms of the GNU Affero General Public License as
 
9
#    published by the Free Software Foundation, either version 3 of the
 
10
#    License, or (at your option) any later version.
 
11
#
 
12
#    This program is distributed in the hope that it will be useful,
 
13
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
#    GNU Affero General Public License for more details.
 
16
#
 
17
#    You should have received a copy of the GNU Affero General Public License
 
18
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.     
 
19
#
 
20
##############################################################################
 
21
 
 
22
from osv import fields
 
23
from osv import osv
 
24
 
 
25
class dm_document_job_batch(osv.osv): # {{{
 
26
    _name = "dm.document.job.batch"
 
27
 
 
28
    _columns = {
 
29
        'name': fields.char('Name', required=True, size=64),
 
30
        'document_job_ids': fields.one2many('dm.document.job', 'document_job_batch_id', 'Offer Document Jobs'),
 
31
        'state': fields.selection([('Pending','pending'),('Error','error'),('Done','done')], 'State'),
 
32
    }
 
33
    
 
34
dm_document_job_batch() # }}}
 
35
 
 
36
class dm_document_job(osv.osv): # {{{
 
37
    _name = "dm.document.job"
 
38
 
 
39
    _columns = {
 
40
        'name': fields.char('Name', required=True, size=64),
 
41
        'document_job_batch_id': fields.many2one('dm.document.job.batch', 'Job Batch'),
 
42
        'document_ids': fields.one2many('dm.offer.document', 'document_job', 'Offer Documents'),
 
43
        'state': fields.selection([('Pending','pending'),('Error','error'),('Done','done')], 'State'),
 
44
    }
 
45
    
 
46
dm_document_job() # }}}
 
47
 
 
48
class dm_offer_document(osv.osv): # {{{
 
49
    _inherit = "dm.offer.document"
 
50
    
 
51
    _columns = {
 
52
        'printer': fields.char('Printer', size=64),
 
53
        'printer_tray': fields.char('Printer Tray', size=64),
 
54
        'document_job': fields.many2one('dm.document.job', 'Document Job'),
 
55
        'document_job_position': fields.integer('Document Job Position'),
 
56
        'verso': fields.boolean('Verso')
 
57
    }
 
58
    
 
59
    _defaults = {
 
60
        'verso': lambda *a: False,         
 
61
        }
 
62
    
 
63
dm_offer_document() # }}}
 
64
 
 
65
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
 
b'\\ No newline at end of file'