Browse Source

Aug 29: [FIX] Bug Fixed 'inter_company_synchronization'

pull/331/head
Cybrosys Technologies 8 months ago
parent
commit
ae350636cf
  1. 5
      inter_company_synchronization/doc/RELEASE_NOTES.md
  2. 8
      inter_company_synchronization/models/sale_order.py

5
inter_company_synchronization/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 17.0.1.0.0 #### Version 17.0.1.0.0
#### ADD #### ADD
- Initial Commit for Inter Company Sale and Purchase Synchronization - Initial Commit for Inter Company Sale and Purchase Synchronization
#### 27.08.2024
#### Version 17.0.1.0.1
##### UPDT
- Bug Fix - Resolved the error while confirming quotation

8
inter_company_synchronization/models/sale_order.py

@ -30,11 +30,14 @@ class SaleOrder(models.Model):
def _create_purchase_order(self): def _create_purchase_order(self):
"""Create a purchase order based on the current sale order.""" """Create a purchase order based on the current sale order."""
company_id = self.env['res.company'].search( company = self.env['res.company'].search(
[('partner_id', '=', self.partner_id.id)], limit=1) [('partner_id', '=', self.partner_id.id)], limit=1)
if not company:
return False
purchase_order_vals = { purchase_order_vals = {
'partner_id': self.company_id.partner_id.id, 'partner_id': self.company_id.partner_id.id,
'company_id': company_id.id, 'company_id': company.id,
'origin': self.name, 'origin': self.name,
'order_line': [(0, 0, { 'order_line': [(0, 0, {
'product_id': line.product_id.id, 'product_id': line.product_id.id,
@ -43,6 +46,7 @@ class SaleOrder(models.Model):
'price_subtotal': line.price_subtotal, 'price_subtotal': line.price_subtotal,
}) for line in self.order_line], }) for line in self.order_line],
} }
return self.env['purchase.order'].create(purchase_order_vals) return self.env['purchase.order'].create(purchase_order_vals)
def action_confirm(self): def action_confirm(self):

Loading…
Cancel
Save