Created
September 14, 2015 20:28
-
-
Save rorymckinley/24aed6c36c2c7fdc53ea to your computer and use it in GitHub Desktop.
Odoo Prototype Model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openerp import models, fields, api | |
class alpha(models.Model): | |
_name = 'lfah.alpha' | |
name = fields.Char() | |
description = fields.Text() | |
def write_to_tmp(self, cr, uid, context=None): | |
f = open("/tmp/alpha_stuff", "w") | |
f.write("Hello from the Alpha model") | |
f.close() | |
def read_from_tmp(self): | |
f = open("/tmp/alpha_in.txt", "r") | |
for line in f: | |
parts = line.split() | |
self.create({'name': parts[0], 'description': parts[1]}) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment