odoo

Why the Create button in the main form does not work?

大兔子大兔子 提交于 2020-06-23 10:30:37
问题 When I click on the "Attach PDF" button, the list form opens, but the "Create" button does not work. But when I go to the list form from the main menu, then everything is fine. What is the problem? model.py from odoo import models, fields, api class AttachPDF(models.Model): _name = 'attach.pdf' product_id = fields.Many2one('product.template', string='Product', required=True) product_attribute_value_id = fields.Many2one('product.attribute.value', string='Attribute Value', required=True,

Odoo 12 can't start Custom Module - TypeError: unsupported operand type(s) for -: 'tuple' and 'datetime.timedelta'

拜拜、爱过 提交于 2020-06-17 13:12:06
问题 iam new to odoo what iam trying to do is , i want to minus datetime.timedelta(days = 90) that is 90 days from the license_renewal_date = (2021,6,6) how to do it , but when i try iam getting this below error before_90_days = datetime.datetime.now().date() - datetime.timedelta(days = 90) datetime.date(2020, 3, 11) license_renewal_date = (2021,6,6) exp_90_days = license_renewal_date - datetime.timedelta(days = 90) Error: Traceback (most recent call last): File "<stdin>", line 1, in <module>

How to make specific records in tree view and form view not editable in odoo?

我的未来我决定 提交于 2020-05-30 08:03:23
问题 I have an entity bill (spanish factura) with an "state" (selection) attribute. Is it possible to make all records in "Bill" with (state='pendiente' or state='pagad') readonly ? That means that when the user clicks on an specific bill on the tree view, he cannot edit any of the "bill" fields. This is my code class PlanificacionFactura(models.Model): _name = 'utepda_planificacion.factura' _rec_name = 'numero' _description = 'Factura' _inherit = ['mail.thread', 'mail.activity.mixin'] fecha =

How to make specific records in tree view and form view not editable in odoo?

て烟熏妆下的殇ゞ 提交于 2020-05-30 08:02:39
问题 I have an entity bill (spanish factura) with an "state" (selection) attribute. Is it possible to make all records in "Bill" with (state='pendiente' or state='pagad') readonly ? That means that when the user clicks on an specific bill on the tree view, he cannot edit any of the "bill" fields. This is my code class PlanificacionFactura(models.Model): _name = 'utepda_planificacion.factura' _rec_name = 'numero' _description = 'Factura' _inherit = ['mail.thread', 'mail.activity.mixin'] fecha =

TypeError: must be str, not mail.mass_mailing.list

杀马特。学长 韩版系。学妹 提交于 2020-05-30 08:00:22
问题 I am making a module on Odoo to send sms from a mailing list. I have run this code but I have an error. contact_list_ids = fields.Many2many('mail.mass_mailing.list', 'phone_number', string='Liste de diffusion') messages_sms = fields.Text(string="message", required=True) # send SMS with GET method @api.multi def send_sms(self): for list in self.contact_list_ids: for contact in list: final_url = ( URL + '&to=' +contact + '&sms=' + self.messages_sms ) r = requests.get(final_url) if not r: return

No usable temporary directory found

青春壹個敷衍的年華 提交于 2020-05-24 20:08:21
问题 I am trying to find a temp directory , but when i am trying to get the directory using tempfile.gettempdir() it's giving me error of File "/usr/lib/python2.6/tempfile.py", line 254, in gettempdir tempdir = _get_default_tempdir() File "/usr/lib/python2.6/tempfile.py", line 201, in _get_default_tempdir ("No usable temporary directory found in %s" % dirlist)) IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/openerp/openerp-server'] The permission

fields does not exist error (working with odoo 12)

人走茶凉 提交于 2020-05-17 07:45:30
问题 i was trying to install a module but each time there is an error like this : Erreur: Odoo Server Error Traceback (most recent call last): File "C:\Program Files (x86)\Odoo 12.0\server\odoo\models.py", line 1126, in _validate_fields check(self) File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 351, in _check_xml self.postprocess_and_fields(view.model, view_doc, view.id) File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py"

How to disable days in Odoo Datepicker before a date?

旧街凉风 提交于 2020-05-16 22:01:20
问题 I have a model in odoo with a fields.Date attribute (expiration_date) How can I disable all days in its odoo datepicker before a date (like january 2016), so all those days before january 2016 would not be accesible in odoo datepicker? 回答1: You need to specify the minDate option of the date picker widget. To disable dates before January 2016 we can pass the date as a string: <field name="date_invoice" options="{'datepicker': {'warn_future': true, 'minDate': '2016-01-01'}}"/> 来源: https:/

How to disable days in Odoo Datepicker before a date?

爱⌒轻易说出口 提交于 2020-05-16 22:01:18
问题 I have a model in odoo with a fields.Date attribute (expiration_date) How can I disable all days in its odoo datepicker before a date (like january 2016), so all those days before january 2016 would not be accesible in odoo datepicker? 回答1: You need to specify the minDate option of the date picker widget. To disable dates before January 2016 we can pass the date as a string: <field name="date_invoice" options="{'datepicker': {'warn_future': true, 'minDate': '2016-01-01'}}"/> 来源: https:/

How to auto login in Odoo's Web-module for res.user, not for res.partner?

北战南征 提交于 2020-05-12 07:18:10
问题 I am trying to login using token-based Auth, because we are using Odoo-web module in mobile-app. currently using GET-method url-passing approach which is "UNSECURE" on websites without SSL certificates and localhost-websites, as myurl.com?username=foo&password=bar How can I do that using Token based approach or passing credentials in POST-method, in Odoo-12? Edit 1: I found this authenticate() method in core-modules of odoo in http-controllers file and I am calling that only now, as: request