{"action":"created","comment":{"url":"https://api.github.com/repos/odoo-dev/odoo/pulls/comments/26016276","id":26016276,"diff_hunk":"@@ -1,210 +1,162 @@\n # -*- coding: utf-8 -*-\n-##############################################################################\n-#\n-#    OpenERP, Open Source Management Solution\n-#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).\n-#\n-#    This program is free software: you can redistribute it and/or modify\n-#    it under the terms of the GNU Affero General Public License as\n-#    published by the Free Software Foundation, either version 3 of the\n-#    License, or (at your option) any later version.\n-#\n-#    This program is distributed in the hope that it will be useful,\n-#    but WITHOUT ANY WARRANTY; without even the implied warranty of\n-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n-#    GNU Affero General Public License for more details.\n-#\n-#    You should have received a copy of the GNU Affero General Public License\n-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n-#\n-##############################################################################\n-\n-from datetime import date, datetime\n-\n-from openerp.osv import fields, osv\n-from openerp.tools import ustr, DEFAULT_SERVER_DATE_FORMAT\n-from openerp.tools.translate import _\n+from openerp import api, fields, models, tools, _\n+from openerp.tools import ustr\n from openerp.exceptions import UserError\n \n-import openerp.addons.decimal_precision as dp\n-\n \n # ---------------------------------------------------------\n # Utils\n # ---------------------------------------------------------\n def strToDate(dt):\n-    return date(int(dt[0:4]), int(dt[5:7]), int(dt[8:10]))\n+    return fields.Date.from_string(dt)\n \n def strToDatetime(strdate):\n-    return datetime.strptime(strdate, DEFAULT_SERVER_DATE_FORMAT)\n+    return fields.Datetime.from_string(strdate)\n \n # ---------------------------------------------------------\n # Budgets\n # ---------------------------------------------------------\n-class account_budget_post(osv.osv):\n+class AccountBudgetPost(models.Model):\n     _name = \"account.budget.post\"\n     _description = \"Budgetary Position\"\n-    _columns = {\n-        'code': fields.char('Code', size=64, required=True),\n-        'name': fields.char('Name', required=True),\n-        'account_ids': fields.many2many('account.account', 'account_budget_rel', 'budget_id', 'account_id', 'Accounts', domain=[('deprecated', '=', False)]),\n-        'crossovered_budget_line': fields.one2many('crossovered.budget.lines', 'general_budget_id', 'Budget Lines'),\n-        'company_id': fields.many2one('res.company', 'Company', required=True),\n-    }\n-    _defaults = {\n-        'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.budget.post', context=c)\n-    }\n+\n+    code = fields.Char(required=True)\n+    name = fields.Char(required=True)\n+    account_ids = fields.Many2many('account.account', 'account_budget_rel', 'budget_id', 'account_id', string='Accounts', domain=[('deprecated', '=', False)])\n+    crossovered_budget_line = fields.One2many('crossovered.budget.lines', 'general_budget_id', string='Budget Lines')\n+    company_id = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.user.company_id)\n+\n     _order = \"name\"\n \n \n \n-class crossovered_budget(osv.osv):\n+class CrossoveredBudget(models.Model):\n     _name = \"crossovered.budget\"\n     _description = \"Budget\"\n \n-    _columns = {\n-        'name': fields.char('Name', required=True, states={'done':[('readonly',True)]}),\n-        'code': fields.char('Code', size=16, required=True, states={'done':[('readonly',True)]}),\n-        'creating_user_id': fields.many2one('res.users', 'Responsible User'),\n-        'validating_user_id': fields.many2one('res.users', 'Validate User', readonly=True),\n-        'date_from': fields.date('Start Date', required=True, states={'done':[('readonly',True)]}),\n-        'date_to': fields.date('End Date', required=True, states={'done':[('readonly',True)]}),\n-        'state' : fields.selection([('draft','Draft'),('cancel', 'Cancelled'),('confirm','Confirmed'),('validate','Validated'),('done','Done')], 'Status', select=True, required=True, readonly=True, copy=False),\n-        'crossovered_budget_line': fields.one2many('crossovered.budget.lines', 'crossovered_budget_id', 'Budget Lines', states={'done':[('readonly',True)]}, copy=True),\n-        'company_id': fields.many2one('res.company', 'Company', required=True),\n-    }\n-\n-    _defaults = {\n-        'state': 'draft',\n-        'creating_user_id': lambda self, cr, uid, context: uid,\n-        'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.budget.post', context=c)\n-    }\n-\n-    def budget_confirm(self, cr, uid, ids, *args):\n-        self.write(cr, uid, ids, {\n+    name = fields.Char(required=True, states={'done':[('readonly',True)]})\n+    code = fields.Char(required=True, states={'done':[('readonly',True)]})","path":"addons/account_budget/account_budget.py","position":99,"original_position":99,"commit_id":"8806b0f6ba86661194435ad0562be5feaca2a59f","original_commit_id":"8806b0f6ba86661194435ad0562be5feaca2a59f","user":{"login":"mdi-odoo","id":7599791,"avatar_url":"https://avatars.githubusercontent.com/u/7599791?v=3","gravatar_id":"","url":"https://api.github.com/users/mdi-odoo","html_url":"https://github.com/mdi-odoo","followers_url":"https://api.github.com/users/mdi-odoo/followers","following_url":"https://api.github.com/users/mdi-odoo/following{/other_user}","gists_url":"https://api.github.com/users/mdi-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/mdi-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdi-odoo/subscriptions","organizations_url":"https://api.github.com/users/mdi-odoo/orgs","repos_url":"https://api.github.com/users/mdi-odoo/repos","events_url":"https://api.github.com/users/mdi-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/mdi-odoo/received_events","type":"User","site_admin":false},"body":"Why you removed the size ???","created_at":"2015-03-09T05:45:30Z","updated_at":"2015-03-09T05:45:30Z","html_url":"https://github.com/odoo-dev/odoo/pull/94#discussion_r26016276","pull_request_url":"https://api.github.com/repos/odoo-dev/odoo/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/odoo-dev/odoo/pulls/comments/26016276"},"html":{"href":"https://github.com/odoo-dev/odoo/pull/94#discussion_r26016276"},"pull_request":{"href":"https://api.github.com/repos/odoo-dev/odoo/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/odoo-dev/odoo/pulls/94","id":30539042,"html_url":"https://github.com/odoo-dev/odoo/pull/94","diff_url":"https://github.com/odoo-dev/odoo/pull/94.diff","patch_url":"https://github.com/odoo-dev/odoo/pull/94.patch","issue_url":"https://api.github.com/repos/odoo-dev/odoo/issues/94","number":94,"state":"open","locked":false,"title":"Master accounts budget new api avo","user":{"login":"avo-odoo","id":5948061,"avatar_url":"https://avatars.githubusercontent.com/u/5948061?v=3","gravatar_id":"","url":"https://api.github.com/users/avo-odoo","html_url":"https://github.com/avo-odoo","followers_url":"https://api.github.com/users/avo-odoo/followers","following_url":"https://api.github.com/users/avo-odoo/following{/other_user}","gists_url":"https://api.github.com/users/avo-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/avo-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avo-odoo/subscriptions","organizations_url":"https://api.github.com/users/avo-odoo/orgs","repos_url":"https://api.github.com/users/avo-odoo/repos","events_url":"https://api.github.com/users/avo-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/avo-odoo/received_events","type":"User","site_admin":false},"body":"task:-https://www.odoo.com/web#id=12160&view_type=form&model=project.task&menu_id=3942&action=327\r\npad:-https://pad.odoo.com/p/openerp-project.task-9DNPPA8H5M","created_at":"2015-03-05T08:46:45Z","updated_at":"2015-03-09T05:45:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f5ca874a6db0523ab527445522f6e73394239ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/odoo-dev/odoo/pulls/94/commits","review_comments_url":"https://api.github.com/repos/odoo-dev/odoo/pulls/94/comments","review_comment_url":"https://api.github.com/repos/odoo-dev/odoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/odoo-dev/odoo/issues/94/comments","statuses_url":"https://api.github.com/repos/odoo-dev/odoo/statuses/8806b0f6ba86661194435ad0562be5feaca2a59f","head":{"label":"odoo-dev:master-accounts-budget-new-api-avo","ref":"master-accounts-budget-new-api-avo","sha":"8806b0f6ba86661194435ad0562be5feaca2a59f","user":{"login":"odoo-dev","id":7466976,"avatar_url":"https://avatars.githubusercontent.com/u/7466976?v=3","gravatar_id":"","url":"https://api.github.com/users/odoo-dev","html_url":"https://github.com/odoo-dev","followers_url":"https://api.github.com/users/odoo-dev/followers","following_url":"https://api.github.com/users/odoo-dev/following{/other_user}","gists_url":"https://api.github.com/users/odoo-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo-dev/subscriptions","organizations_url":"https://api.github.com/users/odoo-dev/orgs","repos_url":"https://api.github.com/users/odoo-dev/repos","events_url":"https://api.github.com/users/odoo-dev/events{/privacy}","received_events_url":"https://api.github.com/users/odoo-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":19853934,"name":"odoo","full_name":"odoo-dev/odoo","owner":{"login":"odoo-dev","id":7466976,"avatar_url":"https://avatars.githubusercontent.com/u/7466976?v=3","gravatar_id":"","url":"https://api.github.com/users/odoo-dev","html_url":"https://github.com/odoo-dev","followers_url":"https://api.github.com/users/odoo-dev/followers","following_url":"https://api.github.com/users/odoo-dev/following{/other_user}","gists_url":"https://api.github.com/users/odoo-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo-dev/subscriptions","organizations_url":"https://api.github.com/users/odoo-dev/orgs","repos_url":"https://api.github.com/users/odoo-dev/repos","events_url":"https://api.github.com/users/odoo-dev/events{/privacy}","received_events_url":"https://api.github.com/users/odoo-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odoo-dev/odoo","description":"RD Dev Repository","fork":true,"url":"https://api.github.com/repos/odoo-dev/odoo","forks_url":"https://api.github.com/repos/odoo-dev/odoo/forks","keys_url":"https://api.github.com/repos/odoo-dev/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odoo-dev/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odoo-dev/odoo/teams","hooks_url":"https://api.github.com/repos/odoo-dev/odoo/hooks","issue_events_url":"https://api.github.com/repos/odoo-dev/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/odoo-dev/odoo/events","assignees_url":"https://api.github.com/repos/odoo-dev/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/odoo-dev/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/odoo-dev/odoo/tags","blobs_url":"https://api.github.com/repos/odoo-dev/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odoo-dev/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odoo-dev/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/odoo-dev/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odoo-dev/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/odoo-dev/odoo/languages","stargazers_url":"https://api.github.com/repos/odoo-dev/odoo/stargazers","contributors_url":"https://api.github.com/repos/odoo-dev/odoo/contributors","subscribers_url":"https://api.github.com/repos/odoo-dev/odoo/subscribers","subscription_url":"https://api.github.com/repos/odoo-dev/odoo/subscription","commits_url":"https://api.github.com/repos/odoo-dev/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/odoo-dev/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/odoo-dev/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/odoo-dev/odoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/odoo-dev/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/odoo-dev/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odoo-dev/odoo/merges","archive_url":"https://api.github.com/repos/odoo-dev/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odoo-dev/odoo/downloads","issues_url":"https://api.github.com/repos/odoo-dev/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/odoo-dev/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/odoo-dev/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/odoo-dev/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odoo-dev/odoo/labels{/name}","releases_url":"https://api.github.com/repos/odoo-dev/odoo/releases{/id}","created_at":"2014-05-16T11:16:19Z","updated_at":"2015-03-02T11:42:16Z","pushed_at":"2015-03-09T05:44:43Z","git_url":"git://github.com/odoo-dev/odoo.git","ssh_url":"git@github.com:odoo-dev/odoo.git","clone_url":"https://github.com/odoo-dev/odoo.git","svn_url":"https://github.com/odoo-dev/odoo","homepage":"https://www.odoo.com","size":1074258,"stargazers_count":44,"watchers_count":44,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":11,"forks":18,"open_issues":11,"watchers":44,"default_branch":"master"}},"base":{"label":"odoo-dev:master-account-new-api-mdi","ref":"master-account-new-api-mdi","sha":"5a57a3842bac4ef3ed9644989df5fa0c378da148","user":{"login":"odoo-dev","id":7466976,"avatar_url":"https://avatars.githubusercontent.com/u/7466976?v=3","gravatar_id":"","url":"https://api.github.com/users/odoo-dev","html_url":"https://github.com/odoo-dev","followers_url":"https://api.github.com/users/odoo-dev/followers","following_url":"https://api.github.com/users/odoo-dev/following{/other_user}","gists_url":"https://api.github.com/users/odoo-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo-dev/subscriptions","organizations_url":"https://api.github.com/users/odoo-dev/orgs","repos_url":"https://api.github.com/users/odoo-dev/repos","events_url":"https://api.github.com/users/odoo-dev/events{/privacy}","received_events_url":"https://api.github.com/users/odoo-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":19853934,"name":"odoo","full_name":"odoo-dev/odoo","owner":{"login":"odoo-dev","id":7466976,"avatar_url":"https://avatars.githubusercontent.com/u/7466976?v=3","gravatar_id":"","url":"https://api.github.com/users/odoo-dev","html_url":"https://github.com/odoo-dev","followers_url":"https://api.github.com/users/odoo-dev/followers","following_url":"https://api.github.com/users/odoo-dev/following{/other_user}","gists_url":"https://api.github.com/users/odoo-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo-dev/subscriptions","organizations_url":"https://api.github.com/users/odoo-dev/orgs","repos_url":"https://api.github.com/users/odoo-dev/repos","events_url":"https://api.github.com/users/odoo-dev/events{/privacy}","received_events_url":"https://api.github.com/users/odoo-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odoo-dev/odoo","description":"RD Dev Repository","fork":true,"url":"https://api.github.com/repos/odoo-dev/odoo","forks_url":"https://api.github.com/repos/odoo-dev/odoo/forks","keys_url":"https://api.github.com/repos/odoo-dev/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odoo-dev/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odoo-dev/odoo/teams","hooks_url":"https://api.github.com/repos/odoo-dev/odoo/hooks","issue_events_url":"https://api.github.com/repos/odoo-dev/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/odoo-dev/odoo/events","assignees_url":"https://api.github.com/repos/odoo-dev/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/odoo-dev/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/odoo-dev/odoo/tags","blobs_url":"https://api.github.com/repos/odoo-dev/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odoo-dev/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odoo-dev/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/odoo-dev/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odoo-dev/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/odoo-dev/odoo/languages","stargazers_url":"https://api.github.com/repos/odoo-dev/odoo/stargazers","contributors_url":"https://api.github.com/repos/odoo-dev/odoo/contributors","subscribers_url":"https://api.github.com/repos/odoo-dev/odoo/subscribers","subscription_url":"https://api.github.com/repos/odoo-dev/odoo/subscription","commits_url":"https://api.github.com/repos/odoo-dev/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/odoo-dev/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/odoo-dev/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/odoo-dev/odoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/odoo-dev/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/odoo-dev/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odoo-dev/odoo/merges","archive_url":"https://api.github.com/repos/odoo-dev/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odoo-dev/odoo/downloads","issues_url":"https://api.github.com/repos/odoo-dev/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/odoo-dev/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/odoo-dev/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/odoo-dev/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odoo-dev/odoo/labels{/name}","releases_url":"https://api.github.com/repos/odoo-dev/odoo/releases{/id}","created_at":"2014-05-16T11:16:19Z","updated_at":"2015-03-02T11:42:16Z","pushed_at":"2015-03-09T05:44:43Z","git_url":"git://github.com/odoo-dev/odoo.git","ssh_url":"git@github.com:odoo-dev/odoo.git","clone_url":"https://github.com/odoo-dev/odoo.git","svn_url":"https://github.com/odoo-dev/odoo","homepage":"https://www.odoo.com","size":1074258,"stargazers_count":44,"watchers_count":44,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":11,"forks":18,"open_issues":11,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/odoo-dev/odoo/pulls/94"},"html":{"href":"https://github.com/odoo-dev/odoo/pull/94"},"issue":{"href":"https://api.github.com/repos/odoo-dev/odoo/issues/94"},"comments":{"href":"https://api.github.com/repos/odoo-dev/odoo/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/odoo-dev/odoo/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/odoo-dev/odoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/odoo-dev/odoo/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/odoo-dev/odoo/statuses/8806b0f6ba86661194435ad0562be5feaca2a59f"}}}}