mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[MIG] connector_amazon_sp: partial 14.0
Need to investigate form for Amazon orders. Installing it complains that `action_...` doesn't actually exist. I started making pass through methods like `action_unlock` in sale_order.common, but then came to an action that would only exist in inherited views and not in this specific new form.
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -41,3 +41,6 @@
|
|||||||
[submodule "external/hibou-oca/product-attribute"]
|
[submodule "external/hibou-oca/product-attribute"]
|
||||||
path = external/hibou-oca/product-attribute
|
path = external/hibou-oca/product-attribute
|
||||||
url = https://github.com/hibou-io/oca-product-attribute.git
|
url = https://github.com/hibou-io/oca-product-attribute.git
|
||||||
|
[submodule "external/python-amazon-sp-api"]
|
||||||
|
path = external/python-amazon-sp-api
|
||||||
|
url = https://github.com/hibou-io/python-amazon-sp-api.git
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "Amazon Selling Partner Connector",
|
"name": "Amazon Selling Partner Connector",
|
||||||
"version": "11.0.1.0.0",
|
"version": "14.0.1.0.0",
|
||||||
"depends": [
|
"depends": [
|
||||||
"connector_ecommerce",
|
"connector_ecommerce",
|
||||||
"sale_order_dates",
|
|
||||||
"sale_sourced_by_line",
|
"sale_sourced_by_line",
|
||||||
"delivery_hibou",
|
"delivery_hibou",
|
||||||
"sale_planner",
|
"sale_planner",
|
||||||
|
|||||||
@@ -84,8 +84,7 @@ Resolution:
|
|||||||
Check your taxes and fiscal positions configuration and correct them if necessary.</field>
|
Check your taxes and fiscal positions configuration and correct them if necessary.</field>
|
||||||
<field name="sequence">30</field>
|
<field name="sequence">30</field>
|
||||||
<field name="model">sale.order</field>
|
<field name="model">sale.order</field>
|
||||||
<field name="rule_group">sale</field>
|
<field name="code">failed = object.amazon_bind_ids and abs(object.amount_total - object.amazon_bind_ids[0].total_amount) >= 0.01</field>
|
||||||
<field name="code">failed = sale.amazon_bind_ids and abs(sale.amount_total - sale.amazon_bind_ids[0].total_amount) >= 0.01</field>
|
|
||||||
<field name="active" eval="True"/>
|
<field name="active" eval="True"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ class AmazonBackend(models.Model):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
@api.multi
|
|
||||||
def work_on(self, model_name, **kwargs):
|
def work_on(self, model_name, **kwargs):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
amazon_api = self.get_wrapped_api()
|
amazon_api = self.get_wrapped_api()
|
||||||
@@ -180,12 +179,10 @@ class AmazonBackend(models.Model):
|
|||||||
for backend in backends:
|
for backend in backends:
|
||||||
self.env['amazon.product.product'].update_price(backend)
|
self.env['amazon.product.product'].update_price(backend)
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def import_sale_orders(self):
|
def import_sale_orders(self):
|
||||||
self._import_from_date('amazon.sale.order', 'import_orders_from_date')
|
self._import_from_date('amazon.sale.order', 'import_orders_from_date')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def _import_from_date(self, model_name, from_date_field):
|
def _import_from_date(self, model_name, from_date_field):
|
||||||
import_start_time = datetime.now().replace(microsecond=0) - timedelta(seconds=IMPORT_DELTA_BUFFER)
|
import_start_time = datetime.now().replace(microsecond=0) - timedelta(seconds=IMPORT_DELTA_BUFFER)
|
||||||
for backend in self:
|
for backend in self:
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# © 2021 Hibou Corp.
|
# © 2021 Hibou Corp.
|
||||||
|
|
||||||
from odoo import api, models, fields
|
from odoo import api, models, fields
|
||||||
from odoo.addons.queue_job.job import job, related_action
|
|
||||||
|
|
||||||
|
|
||||||
class AmazonBinding(models.AbstractModel):
|
class AmazonBinding(models.AbstractModel):
|
||||||
@@ -26,7 +25,6 @@ class AmazonBinding(models.AbstractModel):
|
|||||||
('Amazon_uniq', 'unique(backend_id, external_id)', 'A binding already exists for this Amazon ID.'),
|
('Amazon_uniq', 'unique(backend_id, external_id)', 'A binding already exists for this Amazon ID.'),
|
||||||
]
|
]
|
||||||
|
|
||||||
@job(default_channel='root.amazon')
|
|
||||||
@api.model
|
@api.model
|
||||||
def import_batch(self, backend, filters=None):
|
def import_batch(self, backend, filters=None):
|
||||||
""" Prepare the import of records modified on Amazon """
|
""" Prepare the import of records modified on Amazon """
|
||||||
@@ -36,29 +34,9 @@ class AmazonBinding(models.AbstractModel):
|
|||||||
importer = work.component(usage='batch.importer')
|
importer = work.component(usage='batch.importer')
|
||||||
return importer.run(filters=filters)
|
return importer.run(filters=filters)
|
||||||
|
|
||||||
@job(default_channel='root.amazon')
|
|
||||||
@related_action(action='related_action_unwrap_binding')
|
|
||||||
@api.model
|
@api.model
|
||||||
def import_record(self, backend, external_id, force=False):
|
def import_record(self, backend, external_id, force=False):
|
||||||
""" Import a Amazon record """
|
""" Import a Amazon record """
|
||||||
with backend.work_on(self._name) as work:
|
with backend.work_on(self._name) as work:
|
||||||
importer = work.component(usage='record.importer')
|
importer = work.component(usage='record.importer')
|
||||||
return importer.run(external_id, force=force)
|
return importer.run(external_id, force=force)
|
||||||
|
|
||||||
# @job(default_channel='root.amazon')
|
|
||||||
# @related_action(action='related_action_unwrap_binding')
|
|
||||||
# @api.multi
|
|
||||||
# def export_record(self, fields=None):
|
|
||||||
# """ Export a record on Amazon """
|
|
||||||
# self.ensure_one()
|
|
||||||
# with self.backend_id.work_on(self._name) as work:
|
|
||||||
# exporter = work.component(usage='record.exporter')
|
|
||||||
# return exporter.run(self, fields)
|
|
||||||
#
|
|
||||||
# @job(default_channel='root.amazon')
|
|
||||||
# @related_action(action='related_action_amazon_link')
|
|
||||||
# def export_delete_record(self, backend, external_id):
|
|
||||||
# """ Delete a record on Amazon """
|
|
||||||
# with backend.work_on(self._name) as work:
|
|
||||||
# deleter = work.component(usage='record.exporter.deleter')
|
|
||||||
# return deleter.run(external_id)
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from base64 import b64encode, b64decode
|
|||||||
from json import loads, dumps
|
from json import loads, dumps
|
||||||
|
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.addons.queue_job.job import job
|
|
||||||
from odoo.addons.component.core import Component
|
from odoo.addons.component.core import Component
|
||||||
from odoo.addons.queue_job.exception import RetryableJobError
|
from odoo.addons.queue_job.exception import RetryableJobError
|
||||||
|
|
||||||
@@ -59,8 +58,6 @@ class AmazonFeed(models.Model):
|
|||||||
string='Listing',
|
string='Listing',
|
||||||
ondelete='set null')
|
ondelete='set null')
|
||||||
|
|
||||||
@api.multi
|
|
||||||
@job(default_channel='root.amazon')
|
|
||||||
def submit_feed(self):
|
def submit_feed(self):
|
||||||
for feed in self:
|
for feed in self:
|
||||||
api_instance = feed.backend_id.get_wrapped_api()
|
api_instance = feed.backend_id.get_wrapped_api()
|
||||||
@@ -80,8 +77,6 @@ class AmazonFeed(models.Model):
|
|||||||
# The rest will be delayed 30 min each
|
# The rest will be delayed 30 min each
|
||||||
feed.with_delay(priority=100).check_feed()
|
feed.with_delay(priority=100).check_feed()
|
||||||
|
|
||||||
@api.multi
|
|
||||||
@job(default_channel='root.amazon', retry_pattern=FEED_RETRY_PATTERN)
|
|
||||||
def check_feed(self):
|
def check_feed(self):
|
||||||
for feed in self.filtered('external_id'):
|
for feed in self.filtered('external_id'):
|
||||||
api_instance = feed.backend_id.get_wrapped_api()
|
api_instance = feed.backend_id.get_wrapped_api()
|
||||||
@@ -106,7 +101,6 @@ class AmazonFeed(models.Model):
|
|||||||
# queue a job to process the response
|
# queue a job to process the response
|
||||||
feed.with_delay(priority=10).process_feed_result()
|
feed.with_delay(priority=10).process_feed_result()
|
||||||
|
|
||||||
@job(default_channel='root.amazon')
|
|
||||||
def process_feed_result(self):
|
def process_feed_result(self):
|
||||||
for feed in self:
|
for feed in self:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from Crypto.Util.Padding import pad
|
|||||||
from base64 import b64decode, b64encode
|
from base64 import b64decode, b64encode
|
||||||
|
|
||||||
from odoo import api
|
from odoo import api
|
||||||
from odoo.tools import pycompat
|
|
||||||
|
|
||||||
PREFIX = 'amz_pii:'
|
PREFIX = 'amz_pii:'
|
||||||
PREFIX_LEN = len(PREFIX)
|
PREFIX_LEN = len(PREFIX)
|
||||||
@@ -17,7 +16,7 @@ AMZ_PII_DECRYPT_FAIL = -1
|
|||||||
|
|
||||||
def make_amz_pii_decrypt(cipher):
|
def make_amz_pii_decrypt(cipher):
|
||||||
def amz_pii_decrypt(value):
|
def amz_pii_decrypt(value):
|
||||||
if value and isinstance(value, pycompat.string_types) and value.startswith(PREFIX):
|
if value and isinstance(value, str) and value.startswith(PREFIX):
|
||||||
try:
|
try:
|
||||||
to_decrypt = b64decode(value[PREFIX_LEN:])
|
to_decrypt = b64decode(value[PREFIX_LEN:])
|
||||||
# remove whitespace and `ack`
|
# remove whitespace and `ack`
|
||||||
@@ -32,7 +31,7 @@ def make_amz_pii_decrypt(cipher):
|
|||||||
|
|
||||||
def make_amz_pii_encrypt(cipher):
|
def make_amz_pii_encrypt(cipher):
|
||||||
def amz_pii_encrypt(value):
|
def amz_pii_encrypt(value):
|
||||||
if value and isinstance(value, pycompat.string_types) and not value.startswith(PREFIX):
|
if value and isinstance(value, str) and not value.startswith(PREFIX):
|
||||||
try:
|
try:
|
||||||
to_encrypt = value.encode()
|
to_encrypt = value.encode()
|
||||||
to_encrypt = pad(to_encrypt, BLOCK_SIZE)
|
to_encrypt = pad(to_encrypt, BLOCK_SIZE)
|
||||||
@@ -112,6 +111,7 @@ def make_amz_pii_cipher(env):
|
|||||||
|
|
||||||
|
|
||||||
def update(self, records, field, values):
|
def update(self, records, field, values):
|
||||||
|
""" Set the values of ``field`` for several ``records``. """
|
||||||
amz_pii_decrypt = getattr(self, 'amz_pii_decrypt', None)
|
amz_pii_decrypt = getattr(self, 'amz_pii_decrypt', None)
|
||||||
amz_pii_decrypt_enabled = records.env.context.get('amz_pii_decrypt')
|
amz_pii_decrypt_enabled = records.env.context.get('amz_pii_decrypt')
|
||||||
if not amz_pii_decrypt and amz_pii_decrypt_enabled:
|
if not amz_pii_decrypt and amz_pii_decrypt_enabled:
|
||||||
@@ -120,8 +120,10 @@ def update(self, records, field, values):
|
|||||||
for i, value in enumerate(values):
|
for i, value in enumerate(values):
|
||||||
values[i] = amz_pii_decrypt(value)
|
values[i] = amz_pii_decrypt(value)
|
||||||
|
|
||||||
key = records.env.cache_key(field)
|
field_cache = self._data[field]
|
||||||
self._data[key][field].update(pycompat.izip(records._ids, values))
|
if field.depends_context:
|
||||||
|
field_cache = field_cache.setdefault(records.env.cache_key(field), {})
|
||||||
|
field_cache.update(zip(records._ids, values))
|
||||||
|
|
||||||
|
|
||||||
def _start_amz_pii_decrypt(self, env):
|
def _start_amz_pii_decrypt(self, env):
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class ProviderAmazonSP(models.Model):
|
|||||||
delivery_type = fields.Selection(selection_add=[
|
delivery_type = fields.Selection(selection_add=[
|
||||||
# ('amazon_sp', 'Amazon Selling Partner'), # TODO buy shipping for regular orders?
|
# ('amazon_sp', 'Amazon Selling Partner'), # TODO buy shipping for regular orders?
|
||||||
('amazon_sp_mfn', 'Amazon SP Merchant Fulfillment')
|
('amazon_sp_mfn', 'Amazon SP Merchant Fulfillment')
|
||||||
])
|
], ondelete={'amazon_sp_mfn': lambda recs: recs.write({'delivery_type': 'fixed', 'fixed_price': 0})})
|
||||||
|
|
||||||
# Fields when uploading shipping to Amazon
|
# Fields when uploading shipping to Amazon
|
||||||
amazon_sp_carrier_code = fields.Char(string='Amazon Carrier Code',
|
amazon_sp_carrier_code = fields.Char(string='Amazon Carrier Code',
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ class AmazonProductProduct(models.Model):
|
|||||||
for product in other:
|
for product in other:
|
||||||
product.external_id = product.external_id
|
product.external_id = product.external_id
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def button_submit_product(self):
|
def button_submit_product(self):
|
||||||
backends = self.mapped('backend_id')
|
backends = self.mapped('backend_id')
|
||||||
for backend in backends:
|
for backend in backends:
|
||||||
@@ -58,7 +57,6 @@ class AmazonProductProduct(models.Model):
|
|||||||
products._submit_product()
|
products._submit_product()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def button_update_inventory(self):
|
def button_update_inventory(self):
|
||||||
backends = self.mapped('backend_id')
|
backends = self.mapped('backend_id')
|
||||||
for backend in backends:
|
for backend in backends:
|
||||||
@@ -66,7 +64,6 @@ class AmazonProductProduct(models.Model):
|
|||||||
products._update_inventory()
|
products._update_inventory()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def button_update_price(self):
|
def button_update_price(self):
|
||||||
backends = self.mapped('backend_id')
|
backends = self.mapped('backend_id')
|
||||||
for backend in backends:
|
for backend in backends:
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import odoo.addons.decimal_precision as dp
|
|||||||
|
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.addons.queue_job.job import job, related_action
|
|
||||||
from odoo.addons.component.core import Component
|
from odoo.addons.component.core import Component
|
||||||
from odoo.addons.queue_job.exception import RetryableJobError
|
from odoo.addons.queue_job.exception import RetryableJobError
|
||||||
|
|
||||||
@@ -72,19 +71,15 @@ class AmazonSaleOrder(models.Model):
|
|||||||
for so in self:
|
for so in self:
|
||||||
so.is_amazon_order = True
|
so.is_amazon_order = True
|
||||||
|
|
||||||
@job(default_channel='root.amazon')
|
|
||||||
@api.model
|
@api.model
|
||||||
def import_batch(self, backend, filters=None):
|
def import_batch(self, backend, filters=None):
|
||||||
""" Prepare the import of Sales Orders from Amazon """
|
""" Prepare the import of Sales Orders from Amazon """
|
||||||
return super(AmazonSaleOrder, self).import_batch(backend, filters=filters)
|
return super(AmazonSaleOrder, self).import_batch(backend, filters=filters)
|
||||||
|
|
||||||
@job(default_channel='root.amazon', retry_pattern=SO_IMPORT_RETRY_PATTERN)
|
|
||||||
@related_action(action='related_action_unwrap_binding')
|
|
||||||
@api.model
|
@api.model
|
||||||
def import_record(self, backend, external_id, force=False):
|
def import_record(self, backend, external_id, force=False):
|
||||||
return super().import_record(backend, external_id, force=force)
|
return super().import_record(backend, external_id, force=force)
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def action_confirm(self):
|
def action_confirm(self):
|
||||||
res = self.odoo_id.action_confirm()
|
res = self.odoo_id.action_confirm()
|
||||||
if res and hasattr(res, '__getitem__'): # Button returned an action: we need to set active_id to the amazon sale order
|
if res and hasattr(res, '__getitem__'): # Button returned an action: we need to set active_id to the amazon sale order
|
||||||
@@ -96,15 +91,12 @@ class AmazonSaleOrder(models.Model):
|
|||||||
})
|
})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def action_cancel(self):
|
def action_cancel(self):
|
||||||
return self.odoo_id.action_cancel()
|
return self.odoo_id.action_cancel()
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def action_draft(self):
|
def action_draft(self):
|
||||||
return self.odoo_id.action_draft()
|
return self.odoo_id.action_draft()
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def action_view_delivery(self):
|
def action_view_delivery(self):
|
||||||
res = self.odoo_id.action_view_delivery()
|
res = self.odoo_id.action_view_delivery()
|
||||||
res.update({
|
res.update({
|
||||||
@@ -115,12 +107,8 @@ class AmazonSaleOrder(models.Model):
|
|||||||
})
|
})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
# @job(default_channel='root.amazon')
|
def action_unlock(self):
|
||||||
# @api.model
|
return self.odoo_id.action_unlock()
|
||||||
# def acknowledge_order(self, backend, external_id):
|
|
||||||
# with backend.work_on(self._name) as work:
|
|
||||||
# adapter = work.component(usage='backend.adapter')
|
|
||||||
# return adapter.acknowledge_order(external_id)
|
|
||||||
|
|
||||||
|
|
||||||
class SaleOrder(models.Model):
|
class SaleOrder(models.Model):
|
||||||
@@ -158,12 +146,6 @@ class SaleOrder(models.Model):
|
|||||||
for so in self:
|
for so in self:
|
||||||
so.is_amazon_order = False
|
so.is_amazon_order = False
|
||||||
|
|
||||||
# @api.multi
|
|
||||||
# def action_confirm(self):
|
|
||||||
# res = super(SaleOrder, self).action_confirm()
|
|
||||||
# self.amazon_bind_ids.action_confirm()
|
|
||||||
# return res
|
|
||||||
|
|
||||||
|
|
||||||
class AmazonSaleOrderLine(models.Model):
|
class AmazonSaleOrderLine(models.Model):
|
||||||
_name = 'amazon.sale.order.line'
|
_name = 'amazon.sale.order.line'
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
|
|
||||||
from odoo import api, models, fields, _
|
from odoo import api, models, fields, _
|
||||||
from odoo.addons.queue_job.job import job, related_action
|
|
||||||
from odoo.addons.component.core import Component
|
from odoo.addons.component.core import Component
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
@@ -24,9 +23,6 @@ class AmazonStockPicking(models.Model):
|
|||||||
string='Amazon Sale Order',
|
string='Amazon Sale Order',
|
||||||
ondelete='set null')
|
ondelete='set null')
|
||||||
|
|
||||||
@job(default_channel='root.amazon')
|
|
||||||
@related_action(action='related_action_unwrap_binding')
|
|
||||||
@api.multi
|
|
||||||
def export_picking_done(self):
|
def export_picking_done(self):
|
||||||
""" Export a complete or partial delivery order. """
|
""" Export a complete or partial delivery order. """
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<group>
|
<group>
|
||||||
<div>
|
<div>
|
||||||
<label string="Import sale orders since" class="oe_inline"/>
|
<label for="import_orders_from_date" string="Import sale orders since" class="oe_inline"/>
|
||||||
<field name="import_orders_from_date"
|
<field name="import_orders_from_date"
|
||||||
class="oe_inline"
|
class="oe_inline"
|
||||||
nolabel="1"/>
|
nolabel="1"/>
|
||||||
@@ -139,7 +139,6 @@
|
|||||||
<record id="action_amazon_backend" model="ir.actions.act_window">
|
<record id="action_amazon_backend" model="ir.actions.act_window">
|
||||||
<field name="name">Amazon Backends</field>
|
<field name="name">Amazon Backends</field>
|
||||||
<field name="res_model">amazon.backend</field>
|
<field name="res_model">amazon.backend</field>
|
||||||
<field name="view_type">form</field>
|
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="view_id" ref="view_amazon_backend_tree"/>
|
<field name="view_id" ref="view_amazon_backend_tree"/>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -55,7 +55,6 @@
|
|||||||
<record id="action_amazon_feed" model="ir.actions.act_window">
|
<record id="action_amazon_feed" model="ir.actions.act_window">
|
||||||
<field name="name">Amazon SP Feeds</field>
|
<field name="name">Amazon SP Feeds</field>
|
||||||
<field name="res_model">amazon.feed</field>
|
<field name="res_model">amazon.feed</field>
|
||||||
<field name="view_type">form</field>
|
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,6 @@
|
|||||||
<record id="action_amazon_product_product" model="ir.actions.act_window">
|
<record id="action_amazon_product_product" model="ir.actions.act_window">
|
||||||
<field name="name">Amazon SP Listings</field>
|
<field name="name">Amazon SP Listings</field>
|
||||||
<field name="res_model">amazon.product.product</field>
|
<field name="res_model">amazon.product.product</field>
|
||||||
<field name="view_type">form</field>
|
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<field name="effective_date"/>
|
<field name="effective_date"/>
|
||||||
<field name="date_planned"/>
|
<field name="date_planned"/>
|
||||||
<field name="requested_date"/>
|
<field name="requested_date"/>
|
||||||
<field name="confirmation_date"/>
|
<field name="date_order"/>
|
||||||
<field name="amount_total" sum="Total Tax Included" widget="monetary"/>
|
<field name="amount_total" sum="Total Tax Included" widget="monetary"/>
|
||||||
<field name="total_amount" sum="Amazon Total Tax Included" widget="monetary" string="Amazon Total"/>
|
<field name="total_amount" sum="Amazon Total Tax Included" widget="monetary" string="Amazon Total"/>
|
||||||
<field name="currency_id" invisible="1"/>
|
<field name="currency_id" invisible="1"/>
|
||||||
@@ -51,45 +51,44 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_amazon_order_form" model="ir.ui.view">
|
<!-- <record id="view_amazon_order_form" model="ir.ui.view">-->
|
||||||
<field name="name">amazon.sale.order.form</field>
|
<!-- <field name="name">amazon.sale.order.form</field>-->
|
||||||
<field name="model">amazon.sale.order</field>
|
<!-- <field name="model">amazon.sale.order</field>-->
|
||||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
<!-- <field name="inherit_id" ref="sale.view_order_form"/>-->
|
||||||
<field name="mode">primary</field>
|
<!-- <field name="mode">primary</field>-->
|
||||||
<field name="arch" type="xml">
|
<!-- <field name="arch" type="xml">-->
|
||||||
<xpath expr="//header" position="replace">
|
<!-- <xpath expr="//header" position="replace">-->
|
||||||
<header>
|
<!-- <header>-->
|
||||||
<button name="action_confirm" id="action_confirm" string="Confirm Sale" class="btn-primary" type="object" attrs="{'invisible': [('state', 'not in', ['draft', 'sent'])]}"/>
|
<!-- <button name="action_confirm" id="action_confirm" string="Confirm Sale" class="btn-primary" type="object" attrs="{'invisible': [('state', 'not in', ['draft', 'sent'])]}"/>-->
|
||||||
<button name="action_cancel" states="draft,sent,sale" type="object" string="Cancel"/>
|
<!-- <button name="action_cancel" states="draft,sent,sale" type="object" string="Cancel"/>-->
|
||||||
<button name="action_draft" states="cancel" type="object" string="Set to Quotation"/>
|
<!-- <button name="action_draft" states="cancel" type="object" string="Set to Quotation"/>-->
|
||||||
<button name="action_unlock" type="object" string="Unlock" states="done" groups="sales_team.group_sale_manager"/>
|
<!-- <button name="action_unlock" type="object" string="Unlock" states="done" groups="sales_team.group_sale_manager"/>-->
|
||||||
<field name="state" widget="statusbar" statusbar_visible="draft,sent,sale"/>
|
<!-- <field name="state" widget="statusbar" statusbar_visible="draft,sent,sale"/>-->
|
||||||
</header>
|
<!-- </header>-->
|
||||||
</xpath>
|
<!-- </xpath>-->
|
||||||
<xpath expr="//sheet/group/group[1]" position="inside">
|
<!-- <xpath expr="//sheet/group/group[1]" position="inside">-->
|
||||||
<field name="fulfillment_channel"/>
|
<!-- <field name="fulfillment_channel"/>-->
|
||||||
<field name="is_prime"/>
|
<!-- <field name="is_prime"/>-->
|
||||||
<field name="is_business_order"/>
|
<!-- <field name="is_business_order"/>-->
|
||||||
<field name="is_global_express_enabled"/>
|
<!-- <field name="is_global_express_enabled"/>-->
|
||||||
<field name="is_premium"/>
|
<!-- <field name="is_premium"/>-->
|
||||||
<field name="is_sold_by_ab"/>
|
<!-- <field name="is_sold_by_ab"/>-->
|
||||||
</xpath>
|
<!-- </xpath>-->
|
||||||
<xpath expr="//sheet/group/group[2]" position="inside">
|
<!-- <xpath expr="//sheet/group/group[2]" position="inside">-->
|
||||||
<field name="ship_service_level"/>
|
<!-- <field name="ship_service_level"/>-->
|
||||||
<field name="ship_service_level_category"/>
|
<!-- <field name="ship_service_level_category"/>-->
|
||||||
<field name="marketplace"/>
|
<!-- <field name="marketplace"/>-->
|
||||||
<field name="order_type"/>
|
<!-- <field name="order_type"/>-->
|
||||||
</xpath>
|
<!-- </xpath>-->
|
||||||
<xpath expr="//field[@name='amount_total']" position="after">
|
<!-- <xpath expr="//field[@name='amount_total']" position="after">-->
|
||||||
<field name="total_amount" string="Amazon Total" widget="monetary"/>
|
<!-- <field name="total_amount" string="Amazon Total" widget="monetary"/>-->
|
||||||
</xpath>
|
<!-- </xpath>-->
|
||||||
</field>
|
<!-- </field>-->
|
||||||
</record>
|
<!-- </record>-->
|
||||||
|
|
||||||
<record id="action_amazon_orders" model="ir.actions.act_window">
|
<record id="action_amazon_orders" model="ir.actions.act_window">
|
||||||
<field name="name">Amazon SP Orders</field>
|
<field name="name">Amazon SP Orders</field>
|
||||||
<field name="res_model">amazon.sale.order</field>
|
<field name="res_model">amazon.sale.order</field>
|
||||||
<field name="view_type">form</field>
|
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="view_id" ref="view_amazon_order_tree"/>
|
<field name="view_id" ref="view_amazon_order_tree"/>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -8,10 +8,11 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template id="report_delivery_document_inherit" inherit_id="stock.report_delivery_document">
|
<!-- xpath error -->
|
||||||
<xpath expr="//div[@name='customer_address']" position="attributes">
|
<!-- <template id="report_delivery_document_inherit" inherit_id="stock.report_delivery_document">-->
|
||||||
<attribute name="t-if">not o.has_amazon_pii()</attribute>
|
<!-- <xpath expr="//div[@name='customer_address']" position="attributes">-->
|
||||||
</xpath>
|
<!-- <attribute name="t-if">not o.has_amazon_pii()</attribute>-->
|
||||||
</template>
|
<!-- </xpath>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
1
external/python-amazon-sp-api
vendored
Submodule
1
external/python-amazon-sp-api
vendored
Submodule
Submodule external/python-amazon-sp-api added at 6322ec978d
Reference in New Issue
Block a user