[255][IMP] data_nature_importer: Add Queue Job support and move to server action
This commit is contained in:
parent
3efc767c42
commit
44bbae8dd7
6 changed files with 20 additions and 18 deletions
|
|
@ -40,6 +40,7 @@ Changelog
|
||||||
|
|
||||||
- 16.0.1.0.0: Initial module.
|
- 16.0.1.0.0: Initial module.
|
||||||
- 16.0.1.0.1: Catch empty metadata response in _get_dn_metadata
|
- 16.0.1.0.1: Catch empty metadata response in _get_dn_metadata
|
||||||
|
- 16.0.1.1.0: Add Queue Job support and move to server action
|
||||||
|
|
||||||
Bug Tracker
|
Bug Tracker
|
||||||
===========
|
===========
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"website": "https://www.bakeup.org",
|
"website": "https://www.bakeup.org",
|
||||||
"category": "product",
|
"category": "product",
|
||||||
"version": "16.0.1.0.1",
|
"version": "16.0.1.0.1",
|
||||||
"depends": ["product"],
|
"depends": ["product", "queue_job"],
|
||||||
"data": [
|
"data": [
|
||||||
"security/ir.model.access.csv",
|
"security/ir.model.access.csv",
|
||||||
"views/product_template_views.xml",
|
"views/product_template_views.xml",
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,7 @@ class ProductTemplate(models.Model):
|
||||||
|
|
||||||
def action_sync_datanature_image(self):
|
def action_sync_datanature_image(self):
|
||||||
for product in self:
|
for product in self:
|
||||||
image_data = product._get_dn_image()
|
product.with_delay()._sync_datanature_image()
|
||||||
if image_data:
|
|
||||||
product.image_1920 = image_data
|
|
||||||
|
|
||||||
def _get_dn_metadata(self):
|
def _get_dn_metadata(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
|
|
@ -31,3 +29,9 @@ class ProductTemplate(models.Model):
|
||||||
if image_data:
|
if image_data:
|
||||||
return image_data
|
return image_data
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def _sync_datanature_image(self):
|
||||||
|
self.ensure_one()
|
||||||
|
image_data = self._get_dn_image()
|
||||||
|
if image_data:
|
||||||
|
self.image_1920 = image_data
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
- 16.0.1.0.0: Initial module.
|
- 16.0.1.0.0: Initial module.
|
||||||
- 16.0.1.0.1: Catch empty metadata response in _get_dn_metadata
|
- 16.0.1.0.1: Catch empty metadata response in _get_dn_metadata
|
||||||
|
- 16.0.1.1.0: Add Queue Job support and move to server action
|
||||||
|
|
|
||||||
|
|
@ -383,6 +383,7 @@ ul.auto-toc {
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li>16.0.1.0.0: Initial module.</li>
|
<li>16.0.1.0.0: Initial module.</li>
|
||||||
<li>16.0.1.0.1: Catch empty metadata response in _get_dn_metadata</li>
|
<li>16.0.1.0.1: Catch empty metadata response in _get_dn_metadata</li>
|
||||||
|
<li>16.0.1.1.0: Add Queue Job support and move to server action</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="bug-tracker">
|
<div class="section" id="bug-tracker">
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,13 @@
|
||||||
<odoo>
|
<odoo>
|
||||||
|
<record id="model_product_template_action_sync_image" model="ir.actions.server">
|
||||||
<record id="product_template_action_menu" model="ir.ui.view">
|
<field name="name">Sync Datanature Image</field>
|
||||||
<field name="name">product.template.action.menu</field>
|
<field name="model_id" ref="product.model_product_template"/> <field
|
||||||
<field name="model">product.template</field>
|
name="binding_model_id"
|
||||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
ref="product.model_product_template"
|
||||||
<field name="arch" type="xml">
|
/>
|
||||||
<xpath expr="//header" position="inside">
|
<field name="state">code</field>
|
||||||
<button
|
<field name="code">
|
||||||
name="action_sync_datanature_image"
|
action = records.action_sync_datanature_image()
|
||||||
type="object"
|
|
||||||
string="Sync DataNature Image"
|
|
||||||
class="oe_highlight"
|
|
||||||
/>
|
|
||||||
</xpath>
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue