I want that a field called project in a po is copied to the same field in a stock picking operation. You can use a related field. The problem is that when I want to create a stock transfer I can't assign a project because of the relation.
Is there any alternative to say to odoo copy the value from the PO to the stock picking, and at the same time use the same field in other stock transfers?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Hi Alejandro:
If you make it a Stored field, it will be picked up automatically in the stock picking form and you will be able to enter a value on other stock transfers.
It is a Stored field. Here you have the code
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
analytic_account_id = fields.Many2one(
string='Project', comodel_name='account.analytic.account', store=True)
class Picking(models.Model):
_inherit = 'stock.picking'
analytic_account_id = fields.Many2one(
related='purchase_id.analytic_account_id', string='Project', store='true')
You have a typo in stock.picking: store='true'
Change this to: store=True
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up