Giter Club home page Giter Club logo

hibou-odoo-suite's Issues

video uploaded cannot view online(file may be broken)

I'm trying to develop a module to upload videos files via MinIO API of Python.

The file can be uploaded to MinIO, but it's cannot view via url like: http://localhost:9000/lms-videos/video/output.mp4. And also the file upload via MinIO should be 19.39Mb and the one uploaded via API turns out to be 25+MB, don't know what cause.....

Following is part of my code :

# minio client
@api.model
def _get_minio_client(self):
    host = '192.168.1.102:9000'
    access_key = 'minioadmin'
    secret_key = 'minioadmin'
    if not all((host, access_key, secret_key)):
        raise exceptions.UserError('Incorrect configuration of MinIO')
    return Minio(
    host,
    access_key = access_key,
    secret_key = secret_key,
    secure = False
    )
# upload
@api.model
def _store_file_write(self):
    client = self._get_minio_client()
    bin_data = self.datas_minio
    fname = "output_test"
    #client.put_object('lms-videos','videos/'+ fname + '.mp4',io.BytesIO(self.datas_minio), len(bin_data),'video/mp4')
    with io.BytesIO(self.datas_minio) as bin_data_io:
        client.put_object('lms-videos',
                          'videos/'+ fname + '.mp4',
                          bin_data_io,
                          len(bin_data),
                          'video/mp4')

@api.depends('document_id', 'slide_type', 'mime_type', 'external_url')
def _compute_embed_code(self):
    res = super(Slide, self)._compute_embed_code()
    for record in self:
        if record.slide_type == 'miniovideo':
            
            self._store_file_write()
            
            content_url = 'http://localhost:9000/lms-videos/videos/' + record.name + '.mp4'
            record.embed_code = '<video class="miniovideo" controls controlsList="nodownload"><source src="' + content_url + '" type=MPEG-4/></video>'
        
@api.onchange('datas_minio')
def _on_change_datas(self):
    res = super(Slide, self)._on_change_datas()
    if self.datas_minio:
        self._store_file_write()
len(bin_data),'video/mp4')
    return res

MARGIN MODULE - ERROR

Received following error on Margin Module

2019-11-08 01:59:46,488 30482 ERROR odoo.http: Exception during JSON request handling.
Traceback (most recent call last):
File "/opt/odoo/odoo13/odoo/api.py", line 753, in get
value = self._data[field][record._ids[0]]
KeyError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo/odoo13/odoo/fields.py", line 955, in get
value = env.cache.get(record, self)
File "/opt/odoo/odoo13/odoo/api.py", line 759, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ("account.move.line(,).margin", None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo/odoo13/odoo/http.py", line 619, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo13/odoo/http.py", line 309, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo/odoo13/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/opt/odoo/odoo13/odoo/http.py", line 664, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo13/odoo/http.py", line 345, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo13/odoo/service/model.py", line 93, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo13/odoo/http.py", line 338, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo13/odoo/http.py", line 909, in call
return self.method(*args, **kw)
File "/opt/odoo/odoo13/odoo/http.py", line 510, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo13/addons/web/controllers/main.py", line 1319, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo13/addons/web/controllers/main.py", line 1311, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo13/odoo/api.py", line 395, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo13/odoo/api.py", line 382, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo13/addons/account/models/account_move.py", line 873, in onchange
return super(AccountMove, self.with_context(recursive_onchanges=False)).onchange(values, field_name, field_onchange)
File "/opt/odoo/odoo13/odoo/models.py", line 6036, in onchange
for name in nametree
File "/opt/odoo/odoo13/odoo/models.py", line 6037, in
if name not in done and snapshot0.has_changed(name)
File "/opt/odoo/odoo13/odoo/models.py", line 5904, in has_changed
return self[name] != record[name]
File "/opt/odoo/odoo13/odoo/models.py", line 5564, in getitem
return self._fields[key].get(self, type(self))
File "/opt/odoo/odoo13/odoo/fields.py", line 950, in get
self.compute_value(recs)
File "/opt/odoo/odoo13/odoo/fields.py", line 1060, in compute_value
records._compute_field_value(self)
File "/opt/odoo/odoo13/odoo/models.py", line 3880, in _compute_field_value
getattr(self, field.compute)()
File "/opt/odoo/custom/hibou/account_invoice_margin/models/account_invoice.py", line 65, in _product_margin
invoice.margin = sum(invoice.invoice_line_ids.mapped('margin'))
File "/opt/odoo/odoo13/odoo/models.py", line 5160, in mapped
recs = recs._mapped_func(operator.itemgetter(name))
File "/opt/odoo/odoo13/odoo/models.py", line 5119, in _mapped_func
vals = [func(rec) for rec in self]
File "/opt/odoo/odoo13/odoo/models.py", line 5119, in
vals = [func(rec) for rec in self]
File "/opt/odoo/odoo13/odoo/models.py", line 5564, in getitem
return self._fields[key].get(self, type(self))
File "/opt/odoo/odoo13/odoo/fields.py", line 979, in get
self.compute_value(recs)
File "/opt/odoo/odoo13/odoo/fields.py", line 1060, in compute_value
records._compute_field_value(self)
File "/opt/odoo/odoo13/odoo/models.py", line 3880, in _compute_field_value
getattr(self, field.compute)()
File "/opt/odoo/custom/hibou/account_invoice_margin/models/account_invoice.py", line 47, in _product_margin
price = from_cur._convert(line.product_id.standard_price, currency, line.company_id, date, round=False)
File "/opt/odoo/odoo13/odoo/addons/base/models/res_currency.py", line 191, in _convert
assert company, "convert amount from unknown company"
AssertionError: convert amount from unknown company

Difference between hr_payroll_timesheet and hr_payroll_attendence modules?

Hello,

First of all, thanks a lot for providing such great modules. Really appreciate that!!!
Secondly, could you pleaes elaborate difference between hr_payroll_timesheet and hr_payroll_attendence modules? Both seem identical in many aspects, so it is hard to know the difference.
Thanks again!

PS: I tried posting this comment on your website at https://hibou.io/docs/hibou-odoo-suite-1/timesheets-on-payslips-37
but got 404 error.

Unable to cancel the shipments in stamps.com using delivery_stamps

We are using your delivery_stamps module. Using that we are unable to cancel the shipments.

It raises the following error:

Server raised fault: 'Server was unable to process request. ---> IndiciumIdentifier is of invalid type. Must either be a StampsTxID (Guid) or a TrackingNumber (string)'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.