{"action":"created","issue":{"url":"https://api.github.com/repos/OCA/server-tools/issues/1350","repository_url":"https://api.github.com/repos/OCA/server-tools","labels_url":"https://api.github.com/repos/OCA/server-tools/issues/1350/labels{/name}","comments_url":"https://api.github.com/repos/OCA/server-tools/issues/1350/comments","events_url":"https://api.github.com/repos/OCA/server-tools/issues/1350/events","html_url":"https://github.com/OCA/server-tools/pull/1350","id":354634343,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExMzQ4NTg0","number":1350,"title":"[ADD] field_dependant_default","user":{"login":"etobella","id":28590170,"node_id":"MDQ6VXNlcjI4NTkwMTcw","avatar_url":"https://avatars1.githubusercontent.com/u/28590170?v=4","gravatar_id":"","url":"https://api.github.com/users/etobella","html_url":"https://github.com/etobella","followers_url":"https://api.github.com/users/etobella/followers","following_url":"https://api.github.com/users/etobella/following{/other_user}","gists_url":"https://api.github.com/users/etobella/gists{/gist_id}","starred_url":"https://api.github.com/users/etobella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etobella/subscriptions","organizations_url":"https://api.github.com/users/etobella/orgs","repos_url":"https://api.github.com/users/etobella/repos","events_url":"https://api.github.com/users/etobella/events{/privacy}","received_events_url":"https://api.github.com/users/etobella/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-28T08:57:50Z","updated_at":"2018-09-18T14:09:36Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/OCA/server-tools/pulls/1350","html_url":"https://github.com/OCA/server-tools/pull/1350","diff_url":"https://github.com/OCA/server-tools/pull/1350.diff","patch_url":"https://github.com/OCA/server-tools/pull/1350.patch"},"body":"This module allows to define default function dependant of the sent values.\r\nIt is useful to create fields dependant of the first sent values.\r\nThe code will only be triggered on creation if the value is False or it is the\r\nsame than the default value\r\n\r\nConfigure\r\n------\r\nFields must be defined with the function. For example::\r\n\r\n        from odoo import api, fields, models\r\n\r\n\r\n        class ResPartner(models.Model):\r\n            _inherit = 'res.partner'\r\n\r\n            ref = fields.Char(dependant_default='default_ref')\r\n\r\n            def default_ref(self, vals):\r\n                # Return the exepcted result from your vals\r\n                return 'AAA'"},"comment":{"url":"https://api.github.com/repos/OCA/server-tools/issues/comments/422408390","html_url":"https://github.com/OCA/server-tools/pull/1350#issuecomment-422408390","issue_url":"https://api.github.com/repos/OCA/server-tools/issues/1350","id":422408390,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjQwODM5MA==","user":{"login":"etobella","id":28590170,"node_id":"MDQ6VXNlcjI4NTkwMTcw","avatar_url":"https://avatars1.githubusercontent.com/u/28590170?v=4","gravatar_id":"","url":"https://api.github.com/users/etobella","html_url":"https://github.com/etobella","followers_url":"https://api.github.com/users/etobella/followers","following_url":"https://api.github.com/users/etobella/following{/other_user}","gists_url":"https://api.github.com/users/etobella/gists{/gist_id}","starred_url":"https://api.github.com/users/etobella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etobella/subscriptions","organizations_url":"https://api.github.com/users/etobella/orgs","repos_url":"https://api.github.com/users/etobella/repos","events_url":"https://api.github.com/users/etobella/events{/privacy}","received_events_url":"https://api.github.com/users/etobella/received_events","type":"User","site_admin":false},"created_at":"2018-09-18T14:09:36Z","updated_at":"2018-09-18T14:09:36Z","author_association":"MEMBER","body":"@lreficent I created the Issue on odoo, but it will take some time to review it. Moreover, I think they will add this improvement on odoo 12 or odoo 13 if they approve the idea.\r\nSo, I think it will be a good idea to review it in order to improve the current modules. What do you think?"}}
{"actor":{"display_login":"etobella"}}