feat: add pagination, individual price sync arrows, and bulk price sync
- Pagination with page nav for mapped, unmatched Odoo, and unmatched WC tabs - Per-product arrow buttons to push price in either direction - Bulk price sync buttons: All Prices Odoo→WC and All Prices WC→Odoo - Server-side offset/limit with total count in search endpoints Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -727,6 +727,30 @@ class WooInstance(models.Model):
|
||||
'price_unit': total,
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Bulk Price Sync (UI actions)
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
def action_bulk_price_odoo_to_wc(self):
|
||||
"""Push all Odoo prices to WooCommerce for mapped products."""
|
||||
self.ensure_one()
|
||||
maps = self.env['woo.product.map'].search([
|
||||
('instance_id', '=', self.id),
|
||||
('state', '=', 'mapped'),
|
||||
('product_id', '!=', False),
|
||||
])
|
||||
maps.action_push_price_to_wc()
|
||||
|
||||
def action_bulk_price_wc_to_odoo(self):
|
||||
"""Pull all WC prices to Odoo for mapped products."""
|
||||
self.ensure_one()
|
||||
maps = self.env['woo.product.map'].search([
|
||||
('instance_id', '=', self.id),
|
||||
('state', '=', 'mapped'),
|
||||
('product_id', '!=', False),
|
||||
])
|
||||
maps.action_push_price_to_odoo()
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Product / Price Sync (Task 22)
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user